Class EcsContainerDefinitionProps.Builder
java.lang.Object
software.amazon.awscdk.services.batch.EcsContainerDefinitionProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<EcsContainerDefinitionProps>
- Enclosing interface:
EcsContainerDefinitionProps
@Stability(Stable)
public static final class EcsContainerDefinitionProps.Builder
extends Object
implements software.amazon.jsii.Builder<EcsContainerDefinitionProps>
A builder for
EcsContainerDefinitionProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.Sets the value ofEcsContainerDefinitionProps.getCommand()
Sets the value ofEcsContainerDefinitionProps.getCpu()
environment
(Map<String, String> environment) Sets the value ofEcsContainerDefinitionProps.getEnvironment()
executionRole
(IRole executionRole) Sets the value ofEcsContainerDefinitionProps.getExecutionRole()
image
(ContainerImage image) Sets the value ofEcsContainerDefinitionProps.getImage()
Sets the value ofEcsContainerDefinitionProps.getJobRole()
linuxParameters
(LinuxParameters linuxParameters) Sets the value ofEcsContainerDefinitionProps.getLinuxParameters()
Sets the value ofEcsContainerDefinitionProps.getLogging()
Sets the value ofEcsContainerDefinitionProps.getMemory()
readonlyRootFilesystem
(Boolean readonlyRootFilesystem) Sets the value ofEcsContainerDefinitionProps.getReadonlyRootFilesystem()
Sets the value ofEcsContainerDefinitionProps.getSecrets()
Sets the value ofEcsContainerDefinitionProps.getUser()
Sets the value ofEcsContainerDefinitionProps.getVolumes()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
cpu
Sets the value ofEcsContainerDefinitionProps.getCpu()
- Parameters:
cpu
- The number of vCPUs reserved for the container. This parameter is required. Each vCPU is equivalent to 1,024 CPU shares. For containers running on EC2 resources, you must specify at least one vCPU.- Returns:
this
-
image
Sets the value ofEcsContainerDefinitionProps.getImage()
- Parameters:
image
- The image that this container will run. This parameter is required.- Returns:
this
-
memory
Sets the value ofEcsContainerDefinitionProps.getMemory()
- Parameters:
memory
- The memory hard limit present to the container. This parameter is required. If your container attempts to exceed the memory specified, the container is terminated. You must specify at least 4 MiB of memory for a job.- Returns:
this
-
command
Sets the value ofEcsContainerDefinitionProps.getCommand()
- Parameters:
command
- The command that's passed to the container.- Returns:
this
-
environment
@Stability(Stable) public EcsContainerDefinitionProps.Builder environment(Map<String, String> environment) Sets the value ofEcsContainerDefinitionProps.getEnvironment()
- Parameters:
environment
- The environment variables to pass to a container. Cannot start withAWS_BATCH
. We don't recommend using plaintext environment variables for sensitive information, such as credential data.- Returns:
this
-
executionRole
Sets the value ofEcsContainerDefinitionProps.getExecutionRole()
- Parameters:
executionRole
- The role used by Amazon ECS container and AWS Fargate agents to make AWS API calls on your behalf.- Returns:
this
-
jobRole
Sets the value ofEcsContainerDefinitionProps.getJobRole()
- Parameters:
jobRole
- The role that the container can assume.- Returns:
this
-
linuxParameters
@Stability(Stable) public EcsContainerDefinitionProps.Builder linuxParameters(LinuxParameters linuxParameters) Sets the value ofEcsContainerDefinitionProps.getLinuxParameters()
- Parameters:
linuxParameters
- Linux-specific modifications that are applied to the container, such as details for device mappings.- Returns:
this
-
logging
Sets the value ofEcsContainerDefinitionProps.getLogging()
- Parameters:
logging
- The loging configuration for this Job.- Returns:
this
-
readonlyRootFilesystem
@Stability(Stable) public EcsContainerDefinitionProps.Builder readonlyRootFilesystem(Boolean readonlyRootFilesystem) Sets the value ofEcsContainerDefinitionProps.getReadonlyRootFilesystem()
- Parameters:
readonlyRootFilesystem
- Gives the container readonly access to its root filesystem.- Returns:
this
-
secrets
@Stability(Stable) public EcsContainerDefinitionProps.Builder secrets(Map<String, ? extends Secret> secrets) Sets the value ofEcsContainerDefinitionProps.getSecrets()
- Parameters:
secrets
- A map from environment variable names to the secrets for the container. Allows your job definitions to reference the secret by the environment variable name defined in this property.- Returns:
this
-
user
Sets the value ofEcsContainerDefinitionProps.getUser()
- Parameters:
user
- The user name to use inside the container.- Returns:
this
-
volumes
@Stability(Stable) public EcsContainerDefinitionProps.Builder volumes(List<? extends EcsVolume> volumes) Sets the value ofEcsContainerDefinitionProps.getVolumes()
- Parameters:
volumes
- The volumes to mount to this container. Automatically added to the job definition.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<EcsContainerDefinitionProps>
- Returns:
- a new instance of
EcsContainerDefinitionProps
- Throws:
NullPointerException
- if any required attribute was not provided
-