class EcsFargateLaunchTarget
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.StepFunctions.Tasks.EcsFargateLaunchTarget |
Java | software.amazon.awscdk.services.stepfunctions.tasks.EcsFargateLaunchTarget |
Python | aws_cdk.aws_stepfunctions_tasks.EcsFargateLaunchTarget |
TypeScript (source) | @aws-cdk/aws-stepfunctions-tasks » EcsFargateLaunchTarget |
Implements
IEcs
Configuration for running an ECS task on Fargate.
See also: https://docs.aws.amazon.com/AmazonECS/latest/userguide/launch_types.html#launch-type-fargate
Example
const vpc = ec2.Vpc.fromLookup(this, 'Vpc', {
isDefault: true,
});
const cluster = new ecs.Cluster(this, 'FargateCluster', { vpc });
const taskDefinition = new ecs.TaskDefinition(this, 'TD', {
memoryMiB: '512',
cpu: '256',
compatibility: ecs.Compatibility.FARGATE,
});
const containerDefinition = taskDefinition.addContainer('TheContainer', {
image: ecs.ContainerImage.fromRegistry('foo/bar'),
memoryLimitMiB: 256,
});
const runTask = new tasks.EcsRunTask(this, 'RunFargate', {
integrationPattern: sfn.IntegrationPattern.RUN_JOB,
cluster,
taskDefinition,
assignPublicIp: true,
containerOverrides: [{
containerDefinition,
environment: [{ name: 'SOME_KEY', value: sfn.JsonPath.stringAt('$.SomeKey') }],
}],
launchTarget: new tasks.EcsFargateLaunchTarget(),
});
Initializer
new EcsFargateLaunchTarget(options?: EcsFargateLaunchTargetOptions)
Parameters
- options
Ecs
Fargate Launch Target Options
Methods
Name | Description |
---|---|
bind(_task, launchTargetOptions) | Called when the Fargate launch type configured on RunTask. |
bind(_task, launchTargetOptions)
public bind(_task: EcsRunTask, launchTargetOptions: LaunchTargetBindOptions): EcsLaunchTargetConfig
Parameters
- _task
Ecs
Run Task - launchTargetOptions
Launch
Target Bind Options
Returns
Called when the Fargate launch type configured on RunTask.