Class CfnJobDefinition.EksContainerProperty.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnJobDefinition.EksContainerProperty>
- Enclosing interface:
CfnJobDefinition.EksContainerProperty
CfnJobDefinition.EksContainerProperty
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionSets the value ofCfnJobDefinition.EksContainerProperty.getArgs()
build()
Builds the configured instance.Sets the value ofCfnJobDefinition.EksContainerProperty.getCommand()
Sets the value ofCfnJobDefinition.EksContainerProperty.getEnv()
env
(IResolvable env) Sets the value ofCfnJobDefinition.EksContainerProperty.getEnv()
Sets the value ofCfnJobDefinition.EksContainerProperty.getImage()
imagePullPolicy
(String imagePullPolicy) Sets the value ofCfnJobDefinition.EksContainerProperty.getImagePullPolicy()
Sets the value ofCfnJobDefinition.EksContainerProperty.getName()
resources
(IResolvable resources) Sets the value ofCfnJobDefinition.EksContainerProperty.getResources()
resources
(CfnJobDefinition.ResourcesProperty resources) Sets the value ofCfnJobDefinition.EksContainerProperty.getResources()
securityContext
(IResolvable securityContext) Sets the value ofCfnJobDefinition.EksContainerProperty.getSecurityContext()
securityContext
(CfnJobDefinition.SecurityContextProperty securityContext) Sets the value ofCfnJobDefinition.EksContainerProperty.getSecurityContext()
volumeMounts
(List<? extends Object> volumeMounts) Sets the value ofCfnJobDefinition.EksContainerProperty.getVolumeMounts()
volumeMounts
(IResolvable volumeMounts) Sets the value ofCfnJobDefinition.EksContainerProperty.getVolumeMounts()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
image
Sets the value ofCfnJobDefinition.EksContainerProperty.getImage()
- Parameters:
image
- The Docker image used to start the container. This parameter is required.- Returns:
this
-
args
Sets the value ofCfnJobDefinition.EksContainerProperty.getArgs()
- Parameters:
args
- An array of arguments to the entrypoint. If this isn't specified, theCMD
of the container image is used. This corresponds to theargs
member in the Entrypoint portion of the Pod in Kubernetes. Environment variable references are expanded using the container's environment.If the referenced environment variable doesn't exist, the reference in the command isn't changed. For example, if the reference is to "
$(NAME1)
" and theNAME1
environment variable doesn't exist, the command string will remain "$(NAME1)
."$$
is replaced with$
, and the resulting string isn't expanded. For example,$$(VAR_NAME)
is passed as$(VAR_NAME)
whether or not theVAR_NAME
environment variable exists. For more information, see Dockerfile reference: CMD and Define a command and arguments for a pod in the Kubernetes documentation .- Returns:
this
-
command
@Stability(Stable) public CfnJobDefinition.EksContainerProperty.Builder command(List<String> command) Sets the value ofCfnJobDefinition.EksContainerProperty.getCommand()
- Parameters:
command
- The entrypoint for the container. This isn't run within a shell. If this isn't specified, theENTRYPOINT
of the container image is used. Environment variable references are expanded using the container's environment.If the referenced environment variable doesn't exist, the reference in the command isn't changed. For example, if the reference is to "
$(NAME1)
" and theNAME1
environment variable doesn't exist, the command string will remain "$(NAME1)
."$$
is replaced with$
and the resulting string isn't expanded. For example,$$(VAR_NAME)
will be passed as$(VAR_NAME)
whether or not theVAR_NAME
environment variable exists. The entrypoint can't be updated. For more information, see ENTRYPOINT in the Dockerfile reference and Define a command and arguments for a container and Entrypoint in the Kubernetes documentation .- Returns:
this
-
env
Sets the value ofCfnJobDefinition.EksContainerProperty.getEnv()
- Parameters:
env
- The environment variables to pass to a container.Environment variables cannot start with "
AWS_BATCH
". This naming convention is reserved for variables that AWS Batch sets.- Returns:
this
-
env
@Stability(Stable) public CfnJobDefinition.EksContainerProperty.Builder env(List<? extends Object> env) Sets the value ofCfnJobDefinition.EksContainerProperty.getEnv()
- Parameters:
env
- The environment variables to pass to a container.Environment variables cannot start with "
AWS_BATCH
". This naming convention is reserved for variables that AWS Batch sets.- Returns:
this
-
imagePullPolicy
@Stability(Stable) public CfnJobDefinition.EksContainerProperty.Builder imagePullPolicy(String imagePullPolicy) Sets the value ofCfnJobDefinition.EksContainerProperty.getImagePullPolicy()
- Parameters:
imagePullPolicy
- The image pull policy for the container. Supported values areAlways
,IfNotPresent
, andNever
. This parameter defaults toIfNotPresent
. However, if the:latest
tag is specified, it defaults toAlways
. For more information, see Updating images in the Kubernetes documentation .- Returns:
this
-
name
Sets the value ofCfnJobDefinition.EksContainerProperty.getName()
- Parameters:
name
- The name of the container. If the name isn't specified, the default name "Default
" is used. Each container in a pod must have a unique name.- Returns:
this
-
resources
@Stability(Stable) public CfnJobDefinition.EksContainerProperty.Builder resources(IResolvable resources) Sets the value ofCfnJobDefinition.EksContainerProperty.getResources()
- Parameters:
resources
- The type and amount of resources to assign to a container. The supported resources includememory
,cpu
, andnvidia.com/gpu
. For more information, see Resource management for pods and containers in the Kubernetes documentation .- Returns:
this
-
resources
@Stability(Stable) public CfnJobDefinition.EksContainerProperty.Builder resources(CfnJobDefinition.ResourcesProperty resources) Sets the value ofCfnJobDefinition.EksContainerProperty.getResources()
- Parameters:
resources
- The type and amount of resources to assign to a container. The supported resources includememory
,cpu
, andnvidia.com/gpu
. For more information, see Resource management for pods and containers in the Kubernetes documentation .- Returns:
this
-
securityContext
@Stability(Stable) public CfnJobDefinition.EksContainerProperty.Builder securityContext(IResolvable securityContext) Sets the value ofCfnJobDefinition.EksContainerProperty.getSecurityContext()
- Parameters:
securityContext
- The security context for a job. For more information, see Configure a security context for a pod or container in the Kubernetes documentation .- Returns:
this
-
securityContext
@Stability(Stable) public CfnJobDefinition.EksContainerProperty.Builder securityContext(CfnJobDefinition.SecurityContextProperty securityContext) Sets the value ofCfnJobDefinition.EksContainerProperty.getSecurityContext()
- Parameters:
securityContext
- The security context for a job. For more information, see Configure a security context for a pod or container in the Kubernetes documentation .- Returns:
this
-
volumeMounts
@Stability(Stable) public CfnJobDefinition.EksContainerProperty.Builder volumeMounts(IResolvable volumeMounts) Sets the value ofCfnJobDefinition.EksContainerProperty.getVolumeMounts()
- Parameters:
volumeMounts
- The volume mounts for the container. AWS Batch supportsemptyDir
,hostPath
, andsecret
volume types. For more information about volumes and volume mounts in Kubernetes, see Volumes in the Kubernetes documentation .- Returns:
this
-
volumeMounts
@Stability(Stable) public CfnJobDefinition.EksContainerProperty.Builder volumeMounts(List<? extends Object> volumeMounts) Sets the value ofCfnJobDefinition.EksContainerProperty.getVolumeMounts()
- Parameters:
volumeMounts
- The volume mounts for the container. AWS Batch supportsemptyDir
,hostPath
, andsecret
volume types. For more information about volumes and volume mounts in Kubernetes, see Volumes in the Kubernetes documentation .- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnJobDefinition.EksContainerProperty>
- Returns:
- a new instance of
CfnJobDefinition.EksContainerProperty
- Throws:
NullPointerException
- if any required attribute was not provided
-