@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:50.222Z") public interface EcsRunTaskProps extends 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 java.lang.Boolean |
getAssignPublicIp()
Assign public IP addresses to each task.
|
ICluster |
getCluster()
The ECS cluster to run the task on.
|
default java.util.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 java.util.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
ICluster getCluster()
IEcsLaunchTarget getLaunchTarget()
TaskDefinition getTaskDefinition()
Note: this must be TaskDefinition, and not ITaskDefinition, as it requires properties that are not known for imported task definitions
default java.lang.Boolean getAssignPublicIp()
Default: false
default java.util.List<ContainerOverride> getContainerOverrides()
Specify the container to use and the overrides to apply.
Default: - No overrides
default java.util.List<ISecurityGroup> getSecurityGroups()
Default: - A new security group is created
default SubnetSelection getSubnets()
Default: - Public subnets if assignPublicIp is set. Private subnets otherwise.
static EcsRunTaskProps.Builder builder()
builder
in interface TaskStateBaseProps
EcsRunTaskProps.Builder
of EcsRunTaskProps