interface JobDefinitionContainer
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Batch.JobDefinitionContainer |
![]() | software.amazon.awscdk.services.batch.JobDefinitionContainer |
![]() | aws_cdk.aws_batch.JobDefinitionContainer |
![]() | @aws-cdk/aws-batch ยป JobDefinitionContainer |
Properties of a job definition container.
Example
import * as ssm from '@aws-cdk/aws-ssm';
new batch.JobDefinition(this, 'job-def', {
container: {
image: ecs.EcrImage.fromRegistry('docker/whalesay'),
logConfiguration: {
logDriver: batch.LogDriver.AWSLOGS,
options: { 'awslogs-region': 'us-east-1' },
secretOptions: [
batch.ExposedSecret.fromParametersStore('xyz', ssm.StringParameter.fromStringParameterName(this, 'parameter', 'xyz')),
],
},
},
});
Properties
Name | Type | Description |
---|---|---|
image | Container | The image used to start a container. |
assign | boolean | Whether or not to assign a public IP to the job. |
command? | string[] | The command that is passed to the container. |
environment? | { [string]: string } | The environment variables to pass to the container. |
execution | IRole | The IAM role that AWS Batch can assume. |
gpu | number | The number of physical GPUs to reserve for the container. |
instance | Instance | The instance type to use for a multi-node parallel job. |
job | IRole | The IAM role that the container can assume for AWS permissions. |
linux | Linux | Linux-specific modifications that are applied to the container, such as details for device mappings. |
log | Log | The log configuration specification for the container. |
memory | number | The hard limit (in MiB) of memory to present to the container. |
mount | Mount [] | The mount points for data volumes in your container. |
platform | Fargate | Fargate platform version. |
privileged? | boolean | When this parameter is true, the container is given elevated privileges on the host container instance (similar to the root user). |
read | boolean | When this parameter is true, the container is given read-only access to its root file system. |
ulimits? | Ulimit [] | A list of ulimits to set in the container. |
user? | string | The user name to use inside the container. |
vcpus? | number | The number of vCPUs reserved for the container. |
volumes? | Volume [] | A list of data volumes used in a job. |
image
Type:
Container
The image used to start a container.
assignPublicIp?
Type:
boolean
(optional, default: false)
Whether or not to assign a public IP to the job.
command?
Type:
string[]
(optional, default: CMD value built into container image.)
The command that is passed to the container.
If you provide a shell command as a single string, you have to quote command-line arguments.
environment?
Type:
{ [string]: string }
(optional, default: none)
The environment variables to pass to the container.
executionRole?
Type:
IRole
(optional, default: None)
The IAM role that AWS Batch can assume.
Required when using Fargate.
gpuCount?
Type:
number
(optional, default: No GPU reservation.)
The number of physical GPUs to reserve for the container.
The number of GPUs reserved for all containers in a job should not exceed the number of available GPUs on the compute resource that the job is launched on.
instanceType?
Type:
Instance
(optional, default: None)
The instance type to use for a multi-node parallel job.
Currently all node groups in a multi-node parallel job must use the same instance type. This parameter is not valid for single-node container jobs.
jobRole?
Type:
IRole
(optional, default: An IAM role will created.)
The IAM role that the container can assume for AWS permissions.
linuxParams?
Type:
Linux
(optional, default: None will be used.)
Linux-specific modifications that are applied to the container, such as details for device mappings.
For now, only the devices
property is supported.
logConfiguration?
Type:
Log
(optional, default: containers use the same logging driver that the Docker daemon uses)
The log configuration specification for the container.
memoryLimitMiB?
Type:
number
(optional, default: 4 for EC2, 512 for Fargate)
The hard limit (in MiB) of memory to present to the container.
If your container attempts to exceed the memory specified here, the container is killed. You must specify at least 4 MiB of memory for EC2 and 512 MiB for Fargate.
mountPoints?
Type:
Mount
[]
(optional, default: No mount points will be used.)
The mount points for data volumes in your container.
platformVersion?
Type:
Fargate
(optional, default: LATEST platform version will be used)
Fargate platform version.
privileged?
Type:
boolean
(optional, default: false)
When this parameter is true, the container is given elevated privileges on the host container instance (similar to the root user).
readOnly?
Type:
boolean
(optional, default: false)
When this parameter is true, the container is given read-only access to its root file system.
ulimits?
Type:
Ulimit
[]
(optional, default: No limits.)
A list of ulimits to set in the container.
user?
Type:
string
(optional, default: None will be used.)
The user name to use inside the container.
vcpus?
Type:
number
(optional, default: 1 for EC2, 0.25 for Fargate)
The number of vCPUs reserved for the container.
Each vCPU is equivalent to 1,024 CPU shares. You must specify at least one vCPU for EC2 and 0.25 for Fargate.
volumes?
Type:
Volume
[]
(optional, default: No data volumes will be used.)
A list of data volumes used in a job.