@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:39.325Z") @Stability(value=Stable) public interface EcsTaskProps extends software.amazon.jsii.JsiiSerializable, TargetBaseProps
Example:
import software.amazon.awscdk.services.events.Rule;
import software.amazon.awscdk.services.events.Schedule;
import software.amazon.awscdk.services.events.targets.EcsTask;
import software.amazon.awscdk.services.ecs.Cluster;
import software.amazon.awscdk.services.ecs.TaskDefinition;
import software.amazon.awscdk.services.iam.Role;
Cluster cluster;
TaskDefinition taskDefinition;
Role role;
EcsTask ecsTaskTarget = EcsTask.Builder.create().cluster(cluster).taskDefinition(taskDefinition).role(role).build();
Rule.Builder.create(this, "ScheduleRule")
.schedule(Schedule.cron(CronOptions.builder().minute("0").hour("4").build()))
.targets(List.of(ecsTaskTarget))
.build();
| Modifier and Type | Interface and Description |
|---|---|
static class |
EcsTaskProps.Builder
A builder for
EcsTaskProps |
static class |
EcsTaskProps.Jsii$Proxy
An implementation for
EcsTaskProps |
| Modifier and Type | Method and Description |
|---|---|
static EcsTaskProps.Builder |
builder() |
ICluster |
getCluster()
Cluster where service will be deployed.
|
default List<ContainerOverride> |
getContainerOverrides()
Container setting overrides.
|
default FargatePlatformVersion |
getPlatformVersion()
The platform version on which to run your task.
|
default IRole |
getRole()
Existing IAM role to run the ECS task.
|
default List<ISecurityGroup> |
getSecurityGroups()
Existing security groups to use for the task's ENIs.
|
default SubnetSelection |
getSubnetSelection()
In what subnets to place the task's ENIs.
|
default Number |
getTaskCount()
How many tasks should be started when this event is triggered.
|
ITaskDefinition |
getTaskDefinition()
Task Definition of the task that should be started.
|
getDeadLetterQueue, getMaxEventAge, getRetryAttempts@Stability(value=Stable) @NotNull ICluster getCluster()
@Stability(value=Stable) @NotNull ITaskDefinition getTaskDefinition()
@Stability(value=Stable) @Nullable default List<ContainerOverride> getContainerOverrides()
Key is the name of the container to override, value is the values you want to override.
@Stability(value=Stable) @Nullable default FargatePlatformVersion getPlatformVersion()
Unless you have specific compatibility requirements, you don't need to specify this.
Default: - ECS will set the Fargate platform version to 'LATEST'
@Stability(value=Stable) @Nullable default IRole getRole()
Default: A new IAM role is created
@Stability(value=Stable) @Nullable default List<ISecurityGroup> getSecurityGroups()
(Only applicable in case the TaskDefinition is configured for AwsVpc networking)
Default: A new security group is created
@Stability(value=Stable) @Nullable default SubnetSelection getSubnetSelection()
(Only applicable in case the TaskDefinition is configured for AwsVpc networking)
Default: Private subnets
@Stability(value=Stable) @Nullable default Number getTaskCount()
Default: 1
@Stability(value=Stable) static EcsTaskProps.Builder builder()
builder in interface TargetBasePropsEcsTaskProps.Builder of EcsTaskPropsCopyright © 2022. All rights reserved.