Class ApplicationLoadBalancedTaskImageOptions.Builder
java.lang.Object
software.amazon.awscdk.services.ecs.patterns.ApplicationLoadBalancedTaskImageOptions.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<ApplicationLoadBalancedTaskImageOptions>
- Enclosing interface:
ApplicationLoadBalancedTaskImageOptions
@Stability(Stable)
public static final class ApplicationLoadBalancedTaskImageOptions.Builder
extends Object
implements software.amazon.jsii.Builder<ApplicationLoadBalancedTaskImageOptions>
A builder for
ApplicationLoadBalancedTaskImageOptions
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.Sets the value ofApplicationLoadBalancedTaskImageOptions.getCommand()
containerName
(String containerName) Sets the value ofApplicationLoadBalancedTaskImageOptions.getContainerName()
containerPort
(Number containerPort) Sets the value ofApplicationLoadBalancedTaskImageOptions.getContainerPort()
dockerLabels
(Map<String, String> dockerLabels) Sets the value ofApplicationLoadBalancedTaskImageOptions.getDockerLabels()
enableLogging
(Boolean enableLogging) Sets the value ofApplicationLoadBalancedTaskImageOptions.getEnableLogging()
entryPoint
(List<String> entryPoint) Sets the value ofApplicationLoadBalancedTaskImageOptions.getEntryPoint()
environment
(Map<String, String> environment) Sets the value ofApplicationLoadBalancedTaskImageOptions.getEnvironment()
executionRole
(IRole executionRole) Sets the value ofApplicationLoadBalancedTaskImageOptions.getExecutionRole()
Sets the value ofApplicationLoadBalancedTaskImageOptions.getFamily()
image
(ContainerImage image) Sets the value ofApplicationLoadBalancedTaskImageOptions.getImage()
Sets the value ofApplicationLoadBalancedTaskImageOptions.getLogDriver()
Sets the value ofApplicationLoadBalancedTaskImageOptions.getSecrets()
Sets the value ofApplicationLoadBalancedTaskImageOptions.getTaskRole()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
image
@Stability(Stable) public ApplicationLoadBalancedTaskImageOptions.Builder image(ContainerImage image) Sets the value ofApplicationLoadBalancedTaskImageOptions.getImage()
- Parameters:
image
- The image used to start a container. This parameter is required. Image or taskDefinition must be specified, not both.- Returns:
this
-
command
@Stability(Stable) public ApplicationLoadBalancedTaskImageOptions.Builder command(List<String> command) Sets the value ofApplicationLoadBalancedTaskImageOptions.getCommand()
- Parameters:
command
- The command that's passed to the container. If there are multiple arguments, make sure that each argument is a separated string in the array.This parameter maps to
Cmd
in the Create a container section of the Docker Remote API and theCOMMAND
parameter to docker run.For more information about the Docker
CMD
parameter, see https://docs.docker.com/engine/reference/builder/#cmd.- Returns:
this
-
containerName
@Stability(Stable) public ApplicationLoadBalancedTaskImageOptions.Builder containerName(String containerName) Sets the value ofApplicationLoadBalancedTaskImageOptions.getContainerName()
- Parameters:
containerName
- The container name value to be specified in the task definition.- Returns:
this
-
containerPort
@Stability(Stable) public ApplicationLoadBalancedTaskImageOptions.Builder containerPort(Number containerPort) Sets the value ofApplicationLoadBalancedTaskImageOptions.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 ApplicationLoadBalancedTaskImageOptions.Builder dockerLabels(Map<String, String> dockerLabels) Sets the value ofApplicationLoadBalancedTaskImageOptions.getDockerLabels()
- Parameters:
dockerLabels
- A key/value map of labels to add to the container.- Returns:
this
-
enableLogging
@Stability(Stable) public ApplicationLoadBalancedTaskImageOptions.Builder enableLogging(Boolean enableLogging) Sets the value ofApplicationLoadBalancedTaskImageOptions.getEnableLogging()
- Parameters:
enableLogging
- Flag to indicate whether to enable logging.- Returns:
this
-
entryPoint
@Stability(Stable) public ApplicationLoadBalancedTaskImageOptions.Builder entryPoint(List<String> entryPoint) Sets the value ofApplicationLoadBalancedTaskImageOptions.getEntryPoint()
- Parameters:
entryPoint
- The entry point that's passed to the container. This parameter maps toEntrypoint
in the Create a container section of the Docker Remote API and the--entrypoint
option to docker run.For more information about the Docker
ENTRYPOINT
parameter, see https://docs.docker.com/engine/reference/builder/#entrypoint.- Returns:
this
-
environment
@Stability(Stable) public ApplicationLoadBalancedTaskImageOptions.Builder environment(Map<String, String> environment) Sets the value ofApplicationLoadBalancedTaskImageOptions.getEnvironment()
- Parameters:
environment
- The environment variables to pass to the container.- Returns:
this
-
executionRole
@Stability(Stable) public ApplicationLoadBalancedTaskImageOptions.Builder executionRole(IRole executionRole) Sets the value ofApplicationLoadBalancedTaskImageOptions.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 ofApplicationLoadBalancedTaskImageOptions.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 ApplicationLoadBalancedTaskImageOptions.Builder logDriver(LogDriver logDriver) Sets the value ofApplicationLoadBalancedTaskImageOptions.getLogDriver()
- Parameters:
logDriver
- The log driver to use.- Returns:
this
-
secrets
@Stability(Stable) public ApplicationLoadBalancedTaskImageOptions.Builder secrets(Map<String, ? extends Secret> secrets) Sets the value ofApplicationLoadBalancedTaskImageOptions.getSecrets()
- Parameters:
secrets
- The secret to expose to the container as an environment variable.- Returns:
this
-
taskRole
Sets the value ofApplicationLoadBalancedTaskImageOptions.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<ApplicationLoadBalancedTaskImageOptions>
- Returns:
- a new instance of
ApplicationLoadBalancedTaskImageOptions
- Throws:
NullPointerException
- if any required attribute was not provided
-