public static final class NetworkLoadBalancedTaskImageOptions.Builder
extends java.lang.Object
NetworkLoadBalancedTaskImageOptions
Constructor and Description |
---|
Builder() |
public NetworkLoadBalancedTaskImageOptions.Builder image(ContainerImage image)
NetworkLoadBalancedTaskImageOptions.getImage()
image
- The image used to start a container. This parameter is required.
Image or taskDefinition must be specified, but not both.this
public NetworkLoadBalancedTaskImageOptions.Builder containerName(java.lang.String containerName)
NetworkLoadBalancedTaskImageOptions.getContainerName()
containerName
- The container name value to be specified in the task definition.this
public NetworkLoadBalancedTaskImageOptions.Builder containerPort(java.lang.Number containerPort)
NetworkLoadBalancedTaskImageOptions.getContainerPort()
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.
this
public NetworkLoadBalancedTaskImageOptions.Builder dockerLabels(java.util.Map<java.lang.String,java.lang.String> dockerLabels)
NetworkLoadBalancedTaskImageOptions.getDockerLabels()
dockerLabels
- A key/value map of labels to add to the container.this
public NetworkLoadBalancedTaskImageOptions.Builder enableLogging(java.lang.Boolean enableLogging)
NetworkLoadBalancedTaskImageOptions.getEnableLogging()
enableLogging
- Flag to indicate whether to enable logging.this
public NetworkLoadBalancedTaskImageOptions.Builder environment(java.util.Map<java.lang.String,java.lang.String> environment)
NetworkLoadBalancedTaskImageOptions.getEnvironment()
environment
- The environment variables to pass to the container.this
public NetworkLoadBalancedTaskImageOptions.Builder executionRole(IRole executionRole)
NetworkLoadBalancedTaskImageOptions.getExecutionRole()
executionRole
- The name of the task execution IAM role that grants the Amazon ECS container agent permission to call AWS APIs on your behalf.this
public NetworkLoadBalancedTaskImageOptions.Builder family(java.lang.String family)
NetworkLoadBalancedTaskImageOptions.getFamily()
family
- The name of a family that this task definition is registered to.
A family groups multiple versions of a task definition.this
public NetworkLoadBalancedTaskImageOptions.Builder logDriver(LogDriver logDriver)
NetworkLoadBalancedTaskImageOptions.getLogDriver()
logDriver
- The log driver to use.this
public NetworkLoadBalancedTaskImageOptions.Builder secrets(java.util.Map<java.lang.String,? extends Secret> secrets)
NetworkLoadBalancedTaskImageOptions.getSecrets()
secrets
- The secret to expose to the container as an environment variable.this
public NetworkLoadBalancedTaskImageOptions.Builder taskRole(IRole taskRole)
NetworkLoadBalancedTaskImageOptions.getTaskRole()
taskRole
- The name of the task IAM role that grants containers in the task permission to call AWS APIs on your behalf.this
public NetworkLoadBalancedTaskImageOptions build()
NetworkLoadBalancedTaskImageOptions
java.lang.NullPointerException
- if any required attribute was not provided