Class TaskDefinitionAttributes.Builder
java.lang.Object
software.amazon.awscdk.services.ecs.TaskDefinitionAttributes.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<TaskDefinitionAttributes>
- Enclosing interface:
TaskDefinitionAttributes
@Stability(Stable)
public static final class TaskDefinitionAttributes.Builder
extends Object
implements software.amazon.jsii.Builder<TaskDefinitionAttributes>
A builder for
TaskDefinitionAttributes-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the configured instance.compatibility(Compatibility compatibility) Sets the value ofTaskDefinitionAttributes.getCompatibility()executionRole(IRole executionRole) Sets the value ofCommonTaskDefinitionAttributes.getExecutionRole()networkMode(NetworkMode networkMode) Sets the value ofCommonTaskDefinitionAttributes.getNetworkMode()taskDefinitionArn(String taskDefinitionArn) Sets the value ofCommonTaskDefinitionAttributes.getTaskDefinitionArn()Sets the value ofCommonTaskDefinitionAttributes.getTaskRole()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
compatibility
@Stability(Stable) public TaskDefinitionAttributes.Builder compatibility(Compatibility compatibility) Sets the value ofTaskDefinitionAttributes.getCompatibility()- Parameters:
compatibility- What launch types this task definition should be compatible with.- Returns:
this
-
taskDefinitionArn
@Stability(Stable) public TaskDefinitionAttributes.Builder taskDefinitionArn(String taskDefinitionArn) Sets the value ofCommonTaskDefinitionAttributes.getTaskDefinitionArn()- Parameters:
taskDefinitionArn- The arn of the task definition. This parameter is required.- Returns:
this
-
executionRole
Sets the value ofCommonTaskDefinitionAttributes.getExecutionRole()- Parameters:
executionRole- The IAM role that grants containers and Fargate agents permission to make AWS API calls on your behalf. Some tasks do not have an execution role.- Returns:
this
-
networkMode
Sets the value ofCommonTaskDefinitionAttributes.getNetworkMode()- Parameters:
networkMode- The networking mode to use for the containers in the task.- Returns:
this
-
taskRole
Sets the value ofCommonTaskDefinitionAttributes.getTaskRole()- Parameters:
taskRole- The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf.- Returns:
this
-
build
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<TaskDefinitionAttributes>- Returns:
- a new instance of
TaskDefinitionAttributes - Throws:
NullPointerException- if any required attribute was not provided
-