Interface EcsRunTaskProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
,TaskStateBaseProps
- All Known Implementing Classes:
EcsRunTaskProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2025-01-15T21:09:27.955Z")
@Stability(Stable)
public interface EcsRunTaskProps
extends software.amazon.jsii.JsiiSerializable, TaskStateBaseProps
Properties for ECS Tasks.
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();
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
A builder forEcsRunTaskProps
static final class
An implementation forEcsRunTaskProps
-
Method Summary
Modifier and TypeMethodDescriptionstatic EcsRunTaskProps.Builder
builder()
default Boolean
Assign public IP addresses to each task.The ECS cluster to run the task on.default List<ContainerOverride>
Container setting overrides.default String
getCpu()
Cpu setting override.default Boolean
Whether ECS Exec should be enabled.An Amazon ECS launch type determines the type of infrastructure on which your tasks and services are hosted.default String
Memory setting override.default PropagatedTagSource
Specifies whether to propagate the tags from the task definition to the task.default Number
The revision number of ECS task definition family.default List<ISecurityGroup>
Existing security groups to use for the tasks.default SubnetSelection
Subnets to place the task's ENIs.[disable-awslint:ref-via-interface] Task Definition used for running tasks in the service.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
Methods inherited from interface software.amazon.awscdk.services.stepfunctions.TaskStateBaseProps
getComment, getCredentials, getHeartbeat, getHeartbeatTimeout, getInputPath, getIntegrationPattern, getOutputPath, getResultPath, getResultSelector, getStateName, getTaskTimeout, getTimeout
-
Method Details
-
getCluster
The ECS cluster to run the task on. -
getLaunchTarget
An Amazon ECS launch type determines the type of infrastructure on which your tasks and services are hosted.- See Also:
-
getTaskDefinition
[disable-awslint:ref-via-interface] Task Definition used for running tasks in the service.Note: this must be TaskDefinition, and not ITaskDefinition, as it requires properties that are not known for imported task definitions If you want to run a RunTask with an imported task definition, consider using CustomState
-
getAssignPublicIp
Assign public IP addresses to each task.Default: false
-
getContainerOverrides
Container setting overrides.Specify the container to use and the overrides to apply.
Default: - No overrides
-
getCpu
Cpu setting override.Default: - No override
- See Also:
-
getEnableExecuteCommand
Whether ECS Exec should be enabled.Default: false
- See Also:
-
getMemoryMiB
Memory setting override.Default: - No override
- See Also:
-
getPropagatedTagSource
Specifies whether to propagate the tags from the task definition to the task.An error will be received if you specify the SERVICE option when running a task.
Default: - No tags are propagated.
- See Also:
-
getRevisionNumber
The revision number of ECS task definition family.Default: - '$latest'
-
getSecurityGroups
Existing security groups to use for the tasks.Default: - A new security group is created
-
getSubnets
Subnets to place the task's ENIs.Default: - Public subnets if assignPublicIp is set. Private subnets otherwise.
-
builder
- Returns:
- a
EcsRunTaskProps.Builder
ofEcsRunTaskProps
-