Class EcsTask.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<EcsTask>
- Enclosing class:
EcsTask
EcsTask
.-
Method Summary
Modifier and TypeMethodDescriptionassignPublicIp
(Boolean assignPublicIp) Specifies whether the task's elastic network interface receives a public IP address.build()
Cluster where service will be deployed.containerOverrides
(List<? extends ContainerOverride> containerOverrides) Container setting overrides.static EcsTask.Builder
create()
deadLetterQueue
(IQueue deadLetterQueue) The SQS queue to be used as deadLetterQueue.enableExecuteCommand
(Boolean enableExecuteCommand) Whether or not to enable the execute command functionality for the containers in this task.launchType
(LaunchType launchType) Specifies the launch type on which your task is running.maxEventAge
(Duration maxEventAge) The maximum age of a request that Lambda sends to a function for processing.platformVersion
(FargatePlatformVersion platformVersion) The platform version on which to run your task.propagateTags
(PropagatedTagSource propagateTags) Specifies whether to propagate the tags from the task definition to the task.retryAttempts
(Number retryAttempts) The maximum number of times to retry when the function returns an error.Existing IAM role to run the ECS task.securityGroups
(List<? extends ISecurityGroup> securityGroups) Existing security groups to use for the task's ENIs.subnetSelection
(SubnetSelection subnetSelection) In what subnets to place the task's ENIs.The metadata that you apply to the task to help you categorize and organize them.How many tasks should be started when this event is triggered.taskDefinition
(ITaskDefinition taskDefinition) Task Definition of the task that should be started.
-
Method Details
-
create
- Returns:
- a new instance of
EcsTask.Builder
.
-
deadLetterQueue
The SQS queue to be used as deadLetterQueue. Check out the considerations for using a dead-letter queue.The events not successfully delivered are automatically retried for a specified period of time, depending on the retry policy of the target. If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue.
Default: - no dead-letter queue
- Parameters:
deadLetterQueue
- The SQS queue to be used as deadLetterQueue. Check out the considerations for using a dead-letter queue. This parameter is required.- Returns:
this
-
maxEventAge
The maximum age of a request that Lambda sends to a function for processing.Minimum value of 60. Maximum value of 86400.
Default: Duration.hours(24)
- Parameters:
maxEventAge
- The maximum age of a request that Lambda sends to a function for processing. This parameter is required.- Returns:
this
-
retryAttempts
The maximum number of times to retry when the function returns an error.Minimum value of 0. Maximum value of 185.
Default: 185
- Parameters:
retryAttempts
- The maximum number of times to retry when the function returns an error. This parameter is required.- Returns:
this
-
cluster
Cluster where service will be deployed.- Parameters:
cluster
- Cluster where service will be deployed. This parameter is required.- Returns:
this
-
taskDefinition
Task Definition of the task that should be started.- Parameters:
taskDefinition
- Task Definition of the task that should be started. This parameter is required.- Returns:
this
-
assignPublicIp
Specifies whether the task's elastic network interface receives a public IP address.You can specify true only when LaunchType is set to FARGATE.
Default: - true if the subnet type is PUBLIC, otherwise false
- Parameters:
assignPublicIp
- Specifies whether the task's elastic network interface receives a public IP address. This parameter is required.- Returns:
this
-
containerOverrides
@Stability(Stable) public EcsTask.Builder containerOverrides(List<? extends ContainerOverride> containerOverrides) Container setting overrides.Key is the name of the container to override, value is the values you want to override.
- Parameters:
containerOverrides
- Container setting overrides. This parameter is required.- Returns:
this
-
enableExecuteCommand
Whether or not to enable the execute command functionality for the containers in this task.If true, this enables execute command functionality on all containers in the task.
Default: - false
- Parameters:
enableExecuteCommand
- Whether or not to enable the execute command functionality for the containers in this task. This parameter is required.- Returns:
this
-
launchType
Specifies the launch type on which your task is running.The launch type that you specify here must match one of the launch type (compatibilities) of the target task.
Default: - 'EC2' if `isEc2Compatible` for the `taskDefinition` is true, otherwise 'FARGATE'
- Parameters:
launchType
- Specifies the launch type on which your task is running. This parameter is required.- Returns:
this
-
platformVersion
The platform version on which to run your task.Unless you have specific compatibility requirements, you don't need to specify this.
Default: - ECS will set the Fargate platform version to 'LATEST'
- Parameters:
platformVersion
- The platform version on which to run your task. This parameter is required.- Returns:
this
- See Also:
-
propagateTags
Specifies whether to propagate the tags from the task definition to the task.If no value is specified, the tags are not propagated.
Default: - Tags will not be propagated
- Parameters:
propagateTags
- Specifies whether to propagate the tags from the task definition to the task. This parameter is required.- Returns:
this
-
role
Existing IAM role to run the ECS task.Default: A new IAM role is created
- Parameters:
role
- Existing IAM role to run the ECS task. This parameter is required.- Returns:
this
-
securityGroups
@Stability(Stable) public EcsTask.Builder securityGroups(List<? extends ISecurityGroup> securityGroups) Existing security groups to use for the task's ENIs.(Only applicable in case the TaskDefinition is configured for AwsVpc networking)
Default: A new security group is created
- Parameters:
securityGroups
- Existing security groups to use for the task's ENIs. This parameter is required.- Returns:
this
-
subnetSelection
In what subnets to place the task's ENIs.(Only applicable in case the TaskDefinition is configured for AwsVpc networking)
Default: Private subnets
- Parameters:
subnetSelection
- In what subnets to place the task's ENIs. This parameter is required.- Returns:
this
-
tags
The metadata that you apply to the task to help you categorize and organize them.Each tag consists of a key and an optional value, both of which you define.
Default: - No additional tags are applied to the task
- Parameters:
tags
- The metadata that you apply to the task to help you categorize and organize them. This parameter is required.- Returns:
this
-
taskCount
How many tasks should be started when this event is triggered.Default: 1
- Parameters:
taskCount
- How many tasks should be started when this event is triggered. This parameter is required.- Returns:
this
-
build
-