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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the configured instance.Sets the value ofEcsTaskProps.getCluster()containerOverrides(List<? extends ContainerOverride> containerOverrides) Sets the value ofEcsTaskProps.getContainerOverrides()platformVersion(FargatePlatformVersion platformVersion) Sets the value ofEcsTaskProps.getPlatformVersion()Sets the value ofEcsTaskProps.getRole()securityGroup(ISecurityGroup securityGroup) Deprecated.use securityGroups insteadsecurityGroups(List<? extends ISecurityGroup> securityGroups) Sets the value ofEcsTaskProps.getSecurityGroups()subnetSelection(SubnetSelection subnetSelection) Sets the value ofEcsTaskProps.getSubnetSelection()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
-
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
-
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
-
role
Sets the value ofEcsTaskProps.getRole()- Parameters:
role- Existing IAM role to run the ECS task.- Returns:
this
-
securityGroup
@Stability(Deprecated) @Deprecated public EcsTaskProps.Builder securityGroup(ISecurityGroup securityGroup) Deprecated.use securityGroups insteadSets the value ofEcsTaskProps.getSecurityGroup()- Parameters:
securityGroup- Existing security group to use for the task's ENIs. (Only applicable in case the TaskDefinition is configured for AwsVpc networking)- 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
-
taskCount
Sets the value ofEcsTaskProps.getTaskCount()- Parameters:
taskCount- How many tasks should be started when this event is triggered.- Returns:
this
-
build
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<EcsTaskProps>- Returns:
- a new instance of
EcsTaskProps - Throws:
NullPointerException- if any required attribute was not provided
-