Class EcsTaskProps.Builder
java.lang.Object
software.amazon.awscdk.services.events.targets.EcsTaskProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<EcsTaskProps>
- Enclosing interface:
EcsTaskProps
@Stability(Stable)
public static final class EcsTaskProps.Builder
extends Object
implements software.amazon.jsii.Builder<EcsTaskProps>
A builder for
EcsTaskProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionassignPublicIp
(Boolean assignPublicIp) Sets the value ofEcsTaskProps.getAssignPublicIp()
build()
Builds the configured instance.Sets the value ofEcsTaskProps.getCluster()
containerOverrides
(List<? extends ContainerOverride> containerOverrides) Sets the value ofEcsTaskProps.getContainerOverrides()
deadLetterQueue
(IQueue deadLetterQueue) Sets the value ofTargetBaseProps.getDeadLetterQueue()
enableExecuteCommand
(Boolean enableExecuteCommand) Sets the value ofEcsTaskProps.getEnableExecuteCommand()
launchType
(LaunchType launchType) Sets the value ofEcsTaskProps.getLaunchType()
maxEventAge
(Duration maxEventAge) Sets the value ofTargetBaseProps.getMaxEventAge()
platformVersion
(FargatePlatformVersion platformVersion) Sets the value ofEcsTaskProps.getPlatformVersion()
propagateTags
(PropagatedTagSource propagateTags) Sets the value ofEcsTaskProps.getPropagateTags()
retryAttempts
(Number retryAttempts) Sets the value ofTargetBaseProps.getRetryAttempts()
Sets the value ofEcsTaskProps.getRole()
securityGroups
(List<? extends ISecurityGroup> securityGroups) Sets the value ofEcsTaskProps.getSecurityGroups()
subnetSelection
(SubnetSelection subnetSelection) Sets the value ofEcsTaskProps.getSubnetSelection()
Sets the value ofEcsTaskProps.getTags()
Sets the value ofEcsTaskProps.getTaskCount()
taskDefinition
(ITaskDefinition taskDefinition) Sets the value ofEcsTaskProps.getTaskDefinition()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
cluster
Sets the value ofEcsTaskProps.getCluster()
- Parameters:
cluster
- Cluster where service will be deployed. This parameter is required.- Returns:
this
-
taskDefinition
Sets the value ofEcsTaskProps.getTaskDefinition()
- Parameters:
taskDefinition
- Task Definition of the task that should be started. This parameter is required.- Returns:
this
-
assignPublicIp
Sets the value ofEcsTaskProps.getAssignPublicIp()
- Parameters:
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.- Returns:
this
-
containerOverrides
@Stability(Stable) public EcsTaskProps.Builder containerOverrides(List<? extends ContainerOverride> containerOverrides) Sets the value ofEcsTaskProps.getContainerOverrides()
- Parameters:
containerOverrides
- Container setting overrides. Key is the name of the container to override, value is the values you want to override.- Returns:
this
-
enableExecuteCommand
Sets the value ofEcsTaskProps.getEnableExecuteCommand()
- Parameters:
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.- Returns:
this
-
launchType
Sets the value ofEcsTaskProps.getLaunchType()
- Parameters:
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.- Returns:
this
-
platformVersion
@Stability(Stable) public EcsTaskProps.Builder platformVersion(FargatePlatformVersion platformVersion) Sets the value ofEcsTaskProps.getPlatformVersion()
- Parameters:
platformVersion
- The platform version on which to run your task. Unless you have specific compatibility requirements, you don't need to specify this.- Returns:
this
-
propagateTags
Sets the value ofEcsTaskProps.getPropagateTags()
- Parameters:
propagateTags
- Specifies whether to propagate the tags from the task definition to the task. If no value is specified, the tags are not propagated.- Returns:
this
-
role
Sets the value ofEcsTaskProps.getRole()
- Parameters:
role
- Existing IAM role to run the ECS task.- Returns:
this
-
securityGroups
@Stability(Stable) public EcsTaskProps.Builder securityGroups(List<? extends ISecurityGroup> securityGroups) Sets the value ofEcsTaskProps.getSecurityGroups()
- Parameters:
securityGroups
- Existing security groups to use for the task's ENIs. (Only applicable in case the TaskDefinition is configured for AwsVpc networking)- Returns:
this
-
subnetSelection
Sets the value ofEcsTaskProps.getSubnetSelection()
- Parameters:
subnetSelection
- In what subnets to place the task's ENIs. (Only applicable in case the TaskDefinition is configured for AwsVpc networking)- Returns:
this
-
tags
Sets the value ofEcsTaskProps.getTags()
- Parameters:
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.- Returns:
this
-
taskCount
Sets the value ofEcsTaskProps.getTaskCount()
- Parameters:
taskCount
- How many tasks should be started when this event is triggered.- Returns:
this
-
deadLetterQueue
Sets the value ofTargetBaseProps.getDeadLetterQueue()
- Parameters:
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.- Returns:
this
-
maxEventAge
Sets the value ofTargetBaseProps.getMaxEventAge()
- Parameters:
maxEventAge
- The maximum age of a request that Lambda sends to a function for processing. Minimum value of 60. Maximum value of 86400.- Returns:
this
-
retryAttempts
Sets the value ofTargetBaseProps.getRetryAttempts()
- Parameters:
retryAttempts
- The maximum number of times to retry when the function returns an error. Minimum value of 0. Maximum value of 185.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<EcsTaskProps>
- Returns:
- a new instance of
EcsTaskProps
- Throws:
NullPointerException
- if any required attribute was not provided
-