Class EcsFargateLaunchTarget

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.stepfunctions.tasks.EcsFargateLaunchTarget
All Implemented Interfaces:
IEcsLaunchTarget, software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-22T02:24:10.308Z") @Stability(Stable) public class EcsFargateLaunchTarget extends software.amazon.jsii.JsiiObject implements IEcsLaunchTarget
Configuration for running an ECS task on Fargate.

Example:

 IVpc vpc = Vpc.fromLookup(this, "Vpc", VpcLookupOptions.builder()
         .isDefault(true)
         .build());
 Cluster cluster = Cluster.Builder.create(this, "FargateCluster").vpc(vpc).build();
 TaskDefinition taskDefinition = TaskDefinition.Builder.create(this, "TD")
         .memoryMiB("512")
         .cpu("256")
         .compatibility(Compatibility.FARGATE)
         .build();
 ContainerDefinition containerDefinition = taskDefinition.addContainer("TheContainer", ContainerDefinitionOptions.builder()
         .image(ContainerImage.fromRegistry("foo/bar"))
         .memoryLimitMiB(256)
         .build());
 EcsRunTask runTask = EcsRunTask.Builder.create(this, "RunFargate")
         .integrationPattern(IntegrationPattern.RUN_JOB)
         .cluster(cluster)
         .taskDefinition(taskDefinition)
         .assignPublicIp(true)
         .containerOverrides(List.of(ContainerOverride.builder()
                 .containerDefinition(containerDefinition)
                 .environment(List.of(TaskEnvironmentVariable.builder().name("SOME_KEY").value(JsonPath.stringAt("$.SomeKey")).build()))
                 .build()))
         .launchTarget(new EcsFargateLaunchTarget())
         .propagatedTagSource(PropagatedTagSource.TASK_DEFINITION)
         .build();
 

See Also:
  • Constructor Details

    • EcsFargateLaunchTarget

      protected EcsFargateLaunchTarget(software.amazon.jsii.JsiiObjectRef objRef)
    • EcsFargateLaunchTarget

      protected EcsFargateLaunchTarget(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • EcsFargateLaunchTarget

      @Stability(Stable) public EcsFargateLaunchTarget(@Nullable EcsFargateLaunchTargetOptions options)
      Parameters:
      options -
    • EcsFargateLaunchTarget

      @Stability(Stable) public EcsFargateLaunchTarget()
  • Method Details