interface EcsFargateContainerDefinitionProps
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Batch.EcsFargateContainerDefinitionProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsbatch#EcsFargateContainerDefinitionProps |
Java | software.amazon.awscdk.services.batch.EcsFargateContainerDefinitionProps |
Python | aws_cdk.aws_batch.EcsFargateContainerDefinitionProps |
TypeScript (source) | aws-cdk-lib » aws_batch » EcsFargateContainerDefinitionProps |
Props to configure an EcsFargateContainerDefinition.
Example
const jobDefn = new batch.EcsJobDefinition(this, 'JobDefn', {
container: new batch.EcsFargateContainerDefinition(this, 'myFargateContainer', {
image: ecs.ContainerImage.fromRegistry('public.ecr.aws/amazonlinux/amazonlinux:latest'),
memory: cdk.Size.mebibytes(2048),
cpu: 256,
ephemeralStorageSize: cdk.Size.gibibytes(100),
fargateCpuArchitecture: ecs.CpuArchitecture.ARM64,
fargateOperatingSystemFamily: ecs.OperatingSystemFamily.LINUX,
}),
});
Properties
Name | Type | Description |
---|---|---|
cpu | number | The number of vCPUs reserved for the container. |
image | Container | The image that this container will run. |
memory | Size | The memory hard limit present to the container. |
assign | boolean | Indicates whether the job has a public IP address. |
command? | string[] | The command that's passed to the container. |
environment? | { [string]: string } | The environment variables to pass to a container. |
ephemeral | Size | The size for ephemeral storage. |
execution | IRole | The role used by Amazon ECS container and AWS Fargate agents to make AWS API calls on your behalf. |
fargate | Cpu | The vCPU architecture of Fargate Runtime. |
fargate | Operating | The operating system for the compute environment. |
fargate | Fargate | Which version of Fargate to use when running this container. |
job | IRole | The role that the container can assume. |
linux | Linux | Linux-specific modifications that are applied to the container, such as details for device mappings. |
logging? | Log | The loging configuration for this Job. |
readonly | boolean | Gives the container readonly access to its root filesystem. |
secrets? | { [string]: Secret } | A map from environment variable names to the secrets for the container. |
user? | string | The user name to use inside the container. |
volumes? | Ecs [] | The volumes to mount to this container. |
cpu
Type:
number
The number of vCPUs reserved for the container.
Each vCPU is equivalent to 1,024 CPU shares. For containers running on EC2 resources, you must specify at least one vCPU.
image
Type:
Container
The image that this container will run.
memory
Type:
Size
The memory hard limit present to the container.
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.
assignPublicIp?
Type:
boolean
(optional, default: false)
Indicates whether the job has a public IP address.
For a job that's running on Fargate resources in a private subnet to send outbound traffic to the internet (for example, to pull container images), the private subnet requires a NAT gateway be attached to route requests to the internet.
command?
Type:
string[]
(optional, default: no command)
The command that's passed to the container.
See also: https://docs.docker.com/engine/reference/builder/#cmd
environment?
Type:
{ [string]: string }
(optional, default: no environment variables)
The environment variables to pass to a container.
Cannot start with AWS_BATCH
.
We don't recommend using plaintext environment variables for sensitive information, such as credential data.
ephemeralStorageSize?
Type:
Size
(optional, default: 20 GiB)
The size for ephemeral storage.
executionRole?
Type:
IRole
(optional, default: a Role will be created)
The role used by Amazon ECS container and AWS Fargate agents to make AWS API calls on your behalf.
See also: https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html
fargateCpuArchitecture?
Type:
Cpu
(optional, default: X86_64)
The vCPU architecture of Fargate Runtime.
fargateOperatingSystemFamily?
Type:
Operating
(optional, default: LINUX)
The operating system for the compute environment.
fargatePlatformVersion?
Type:
Fargate
(optional, default: LATEST)
Which version of Fargate to use when running this container.
jobRole?
Type:
IRole
(optional, default: no job role)
The role that the container can assume.
See also: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html
linuxParameters?
Type:
Linux
(optional, default: none)
Linux-specific modifications that are applied to the container, such as details for device mappings.
logging?
Type:
Log
(optional, default: the log configuration of the Docker daemon)
The loging configuration for this Job.
readonlyRootFilesystem?
Type:
boolean
(optional, default: false)
Gives the container readonly access to its root filesystem.
secrets?
Type:
{ [string]:
Secret
}
(optional, default: no 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.
user?
Type:
string
(optional, default: no user)
The user name to use inside the container.
volumes?
Type:
Ecs
[]
(optional, default: no volumes)
The volumes to mount to this container.
Automatically added to the job definition.