Class NetworkLoadBalancedTaskImageOptions.Builder
java.lang.Object
software.amazon.awscdk.services.ecs.patterns.NetworkLoadBalancedTaskImageOptions.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<NetworkLoadBalancedTaskImageOptions>
- Enclosing interface:
- NetworkLoadBalancedTaskImageOptions
@Stability(Stable)
public static final class NetworkLoadBalancedTaskImageOptions.Builder
extends Object
implements software.amazon.jsii.Builder<NetworkLoadBalancedTaskImageOptions>
A builder for
NetworkLoadBalancedTaskImageOptions
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.containerName
(String containerName) Sets the value ofNetworkLoadBalancedTaskImageOptions.getContainerName()
containerPort
(Number containerPort) Sets the value ofNetworkLoadBalancedTaskImageOptions.getContainerPort()
dockerLabels
(Map<String, String> dockerLabels) Sets the value ofNetworkLoadBalancedTaskImageOptions.getDockerLabels()
enableLogging
(Boolean enableLogging) Sets the value ofNetworkLoadBalancedTaskImageOptions.getEnableLogging()
environment
(Map<String, String> environment) Sets the value ofNetworkLoadBalancedTaskImageOptions.getEnvironment()
executionRole
(IRole executionRole) Sets the value ofNetworkLoadBalancedTaskImageOptions.getExecutionRole()
Sets the value ofNetworkLoadBalancedTaskImageOptions.getFamily()
image
(ContainerImage image) Sets the value ofNetworkLoadBalancedTaskImageOptions.getImage()
Sets the value ofNetworkLoadBalancedTaskImageOptions.getLogDriver()
Sets the value ofNetworkLoadBalancedTaskImageOptions.getSecrets()
Sets the value ofNetworkLoadBalancedTaskImageOptions.getTaskRole()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
image
Sets the value ofNetworkLoadBalancedTaskImageOptions.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 NetworkLoadBalancedTaskImageOptions.Builder containerName(String containerName) Sets the value ofNetworkLoadBalancedTaskImageOptions.getContainerName()
- Parameters:
containerName
- The container name value to be specified in the task definition.- Returns:
this
-
containerPort
@Stability(Stable) public NetworkLoadBalancedTaskImageOptions.Builder containerPort(Number containerPort) Sets the value ofNetworkLoadBalancedTaskImageOptions.getContainerPort()
- Parameters:
containerPort
- The port number 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 NetworkLoadBalancedTaskImageOptions.Builder dockerLabels(Map<String, String> dockerLabels) Sets the value ofNetworkLoadBalancedTaskImageOptions.getDockerLabels()
- Parameters:
dockerLabels
- A key/value map of labels to add to the container.- Returns:
this
-
enableLogging
@Stability(Stable) public NetworkLoadBalancedTaskImageOptions.Builder enableLogging(Boolean enableLogging) Sets the value ofNetworkLoadBalancedTaskImageOptions.getEnableLogging()
- Parameters:
enableLogging
- Flag to indicate whether to enable logging.- Returns:
this
-
environment
@Stability(Stable) public NetworkLoadBalancedTaskImageOptions.Builder environment(Map<String, String> environment) Sets the value ofNetworkLoadBalancedTaskImageOptions.getEnvironment()
- Parameters:
environment
- The environment variables to pass to the container.- Returns:
this
-
executionRole
@Stability(Stable) public NetworkLoadBalancedTaskImageOptions.Builder executionRole(IRole executionRole) Sets the value ofNetworkLoadBalancedTaskImageOptions.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 ofNetworkLoadBalancedTaskImageOptions.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
@Stability(Stable) public NetworkLoadBalancedTaskImageOptions.Builder logDriver(LogDriver logDriver) Sets the value ofNetworkLoadBalancedTaskImageOptions.getLogDriver()
- Parameters:
logDriver
- The log driver to use.- Returns:
this
-
secrets
@Stability(Stable) public NetworkLoadBalancedTaskImageOptions.Builder secrets(Map<String, ? extends Secret> secrets) Sets the value ofNetworkLoadBalancedTaskImageOptions.getSecrets()
- Parameters:
secrets
- The secret to expose to the container as an environment variable.- Returns:
this
-
taskRole
Sets the value ofNetworkLoadBalancedTaskImageOptions.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<NetworkLoadBalancedTaskImageOptions>
- Returns:
- a new instance of
NetworkLoadBalancedTaskImageOptions
- Throws:
NullPointerException
- if any required attribute was not provided
-