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