@Generated(value="jsii-pacmak/1.72.0 (build 4b8828b)", date="2023-01-03T16:22:40.517Z") @Stability(value=Stable) public interface EcsRunTaskProps extends software.amazon.jsii.JsiiSerializable, TaskStateBaseProps
Example:
IVpc vpc = Vpc.fromLookup(this, "Vpc", VpcLookupOptions.builder()
.isDefault(true)
.build());
Cluster cluster = Cluster.Builder.create(this, "Ec2Cluster").vpc(vpc).build();
cluster.addCapacity("DefaultAutoScalingGroup", AddCapacityOptions.builder()
.instanceType(new InstanceType("t2.micro"))
.vpcSubnets(SubnetSelection.builder().subnetType(SubnetType.PUBLIC).build())
.build());
TaskDefinition taskDefinition = TaskDefinition.Builder.create(this, "TD")
.compatibility(Compatibility.EC2)
.build();
taskDefinition.addContainer("TheContainer", ContainerDefinitionOptions.builder()
.image(ContainerImage.fromRegistry("foo/bar"))
.memoryLimitMiB(256)
.build());
EcsRunTask runTask = EcsRunTask.Builder.create(this, "Run")
.integrationPattern(IntegrationPattern.RUN_JOB)
.cluster(cluster)
.taskDefinition(taskDefinition)
.launchTarget(EcsEc2LaunchTarget.Builder.create()
.placementStrategies(List.of(PlacementStrategy.spreadAcrossInstances(), PlacementStrategy.packedByCpu(), PlacementStrategy.randomly()))
.placementConstraints(List.of(PlacementConstraint.memberOf("blieptuut")))
.build())
.build();
| Modifier and Type | Interface and Description |
|---|---|
static class |
EcsRunTaskProps.Builder
A builder for
EcsRunTaskProps |
static class |
EcsRunTaskProps.Jsii$Proxy
An implementation for
EcsRunTaskProps |
| Modifier and Type | Method and Description |
|---|---|
static EcsRunTaskProps.Builder |
builder() |
default Boolean |
getAssignPublicIp()
Assign public IP addresses to each task.
|
ICluster |
getCluster()
The ECS cluster to run the task on.
|
default List<ContainerOverride> |
getContainerOverrides()
Container setting overrides.
|
IEcsLaunchTarget |
getLaunchTarget()
An Amazon ECS launch type determines the type of infrastructure on which your tasks and services are hosted.
|
default List<ISecurityGroup> |
getSecurityGroups()
Existing security groups to use for the tasks.
|
default SubnetSelection |
getSubnets()
Subnets to place the task's ENIs.
|
TaskDefinition |
getTaskDefinition()
[disable-awslint:ref-via-interface] Task Definition used for running tasks in the service.
|
getComment, getHeartbeat, getInputPath, getIntegrationPattern, getOutputPath, getResultPath, getResultSelector, getTimeout@Stability(value=Stable) @NotNull ICluster getCluster()
@Stability(value=Stable) @NotNull IEcsLaunchTarget getLaunchTarget()
@Stability(value=Stable) @NotNull TaskDefinition getTaskDefinition()
Note: this must be TaskDefinition, and not ITaskDefinition, as it requires properties that are not known for imported task definitions
@Stability(value=Stable) @Nullable default Boolean getAssignPublicIp()
Default: false
@Stability(value=Stable) @Nullable default List<ContainerOverride> getContainerOverrides()
Specify the container to use and the overrides to apply.
Default: - No overrides
@Stability(value=Stable) @Nullable default List<ISecurityGroup> getSecurityGroups()
Default: - A new security group is created
@Stability(value=Stable) @Nullable default SubnetSelection getSubnets()
Default: - Public subnets if assignPublicIp is set. Private subnets otherwise.
@Stability(value=Stable) static EcsRunTaskProps.Builder builder()
builder in interface TaskStateBasePropsEcsRunTaskProps.Builder of EcsRunTaskPropsCopyright © 2023. All rights reserved.