Class NetworkLoadBalancedTaskImageProps.Builder
java.lang.Object
software.amazon.awscdk.services.ecs.patterns.NetworkLoadBalancedTaskImageProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<NetworkLoadBalancedTaskImageProps>
- Enclosing interface:
NetworkLoadBalancedTaskImageProps
@Stability(Stable)
public static final class NetworkLoadBalancedTaskImageProps.Builder
extends Object
implements software.amazon.jsii.Builder<NetworkLoadBalancedTaskImageProps>
A builder for
NetworkLoadBalancedTaskImageProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.containerName
(String containerName) Sets the value ofNetworkLoadBalancedTaskImageProps.getContainerName()
containerPorts
(List<? extends Number> containerPorts) Sets the value ofNetworkLoadBalancedTaskImageProps.getContainerPorts()
dockerLabels
(Map<String, String> dockerLabels) Sets the value ofNetworkLoadBalancedTaskImageProps.getDockerLabels()
enableLogging
(Boolean enableLogging) Sets the value ofNetworkLoadBalancedTaskImageProps.getEnableLogging()
environment
(Map<String, String> environment) Sets the value ofNetworkLoadBalancedTaskImageProps.getEnvironment()
executionRole
(IRole executionRole) Sets the value ofNetworkLoadBalancedTaskImageProps.getExecutionRole()
Sets the value ofNetworkLoadBalancedTaskImageProps.getFamily()
image
(ContainerImage image) Sets the value ofNetworkLoadBalancedTaskImageProps.getImage()
Sets the value ofNetworkLoadBalancedTaskImageProps.getLogDriver()
Sets the value ofNetworkLoadBalancedTaskImageProps.getSecrets()
Sets the value ofNetworkLoadBalancedTaskImageProps.getTaskRole()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
image
Sets the value ofNetworkLoadBalancedTaskImageProps.getImage()
- Parameters:
image
- The image used to start a container. This parameter is required. Image or taskDefinition must be specified, but not both.- Returns:
this
-
containerName
@Stability(Stable) public NetworkLoadBalancedTaskImageProps.Builder containerName(String containerName) Sets the value ofNetworkLoadBalancedTaskImageProps.getContainerName()
- Parameters:
containerName
- The container name value to be specified in the task definition.- Returns:
this
-
containerPorts
@Stability(Stable) public NetworkLoadBalancedTaskImageProps.Builder containerPorts(List<? extends Number> containerPorts) Sets the value ofNetworkLoadBalancedTaskImageProps.getContainerPorts()
- Parameters:
containerPorts
- A list of port numbers on the container that is bound to the user-specified or automatically assigned host port. If you are using containers in a task with the awsvpc or host network mode, exposed ports should be specified using containerPort. If you are using containers in a task with the bridge network mode and you specify a container port and not a host port, your container automatically receives a host port in the ephemeral port range.Port mappings that are automatically assigned in this way do not count toward the 100 reserved ports limit of a container instance.
For more information, see hostPort.
- Returns:
this
-
dockerLabels
@Stability(Stable) public NetworkLoadBalancedTaskImageProps.Builder dockerLabels(Map<String, String> dockerLabels) Sets the value ofNetworkLoadBalancedTaskImageProps.getDockerLabels()
- Parameters:
dockerLabels
- A key/value map of labels to add to the container.- Returns:
this
-
enableLogging
@Stability(Stable) public NetworkLoadBalancedTaskImageProps.Builder enableLogging(Boolean enableLogging) Sets the value ofNetworkLoadBalancedTaskImageProps.getEnableLogging()
- Parameters:
enableLogging
- Flag to indicate whether to enable logging.- Returns:
this
-
environment
@Stability(Stable) public NetworkLoadBalancedTaskImageProps.Builder environment(Map<String, String> environment) Sets the value ofNetworkLoadBalancedTaskImageProps.getEnvironment()
- Parameters:
environment
- The environment variables to pass to the container.- Returns:
this
-
executionRole
@Stability(Stable) public NetworkLoadBalancedTaskImageProps.Builder executionRole(IRole executionRole) Sets the value ofNetworkLoadBalancedTaskImageProps.getExecutionRole()
- Parameters:
executionRole
- The name of the task execution IAM role that grants the Amazon ECS container agent permission to call AWS APIs on your behalf.- Returns:
this
-
family
Sets the value ofNetworkLoadBalancedTaskImageProps.getFamily()
- Parameters:
family
- The name of a family that this task definition is registered to. A family groups multiple versions of a task definition.- Returns:
this
-
logDriver
Sets the value ofNetworkLoadBalancedTaskImageProps.getLogDriver()
- Parameters:
logDriver
- The log driver to use.- Returns:
this
-
secrets
@Stability(Stable) public NetworkLoadBalancedTaskImageProps.Builder secrets(Map<String, ? extends Secret> secrets) Sets the value ofNetworkLoadBalancedTaskImageProps.getSecrets()
- Parameters:
secrets
- The secrets to expose to the container as an environment variable.- Returns:
this
-
taskRole
Sets the value ofNetworkLoadBalancedTaskImageProps.getTaskRole()
- Parameters:
taskRole
- The name of the task 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:
build
in interfacesoftware.amazon.jsii.Builder<NetworkLoadBalancedTaskImageProps>
- Returns:
- a new instance of
NetworkLoadBalancedTaskImageProps
- Throws:
NullPointerException
- if any required attribute was not provided
-