A container orchestrated by ECS that uses Fargate resources.
import { EcsFargateContainerDefinition } from 'aws-cdk-lib/aws-batch';Or use the module namespace:
import * as batch from 'aws-cdk-lib/aws-batch';
// batch.EcsFargateContainerDefinitionConfiguration passed to the constructor as EcsFargateContainerDefinitionProps.
assignPublicIpOptionalbooleanIndicates 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.
Default: false
ephemeralStorageSizeOptionalSizeThe size for ephemeral storage.
Default: - 20 GiB
fargateCpuArchitectureOptionalCpuArchitectureThe vCPU architecture of Fargate Runtime.
Default: - X86_64
fargateOperatingSystemFamilyOptionalOperatingSystemFamilyThe operating system for the compute environment.
Default: - LINUX
fargatePlatformVersionOptionalFargatePlatformVersionWhich version of Fargate to use when running this container.
Default: LATEST
EcsContainerDefinitionPropscpuRequiredinherited from EcsContainerDefinitionPropsnumberThe 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.
imageRequiredinherited from EcsContainerDefinitionPropsContainerImageThe image that this container will run.
memoryRequiredinherited from EcsContainerDefinitionPropsSizeThe 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.
commandOptionalinherited from EcsContainerDefinitionPropsstring[]The command that's passed to the container.
Default: - no command
enableExecuteCommandOptionalinherited from EcsContainerDefinitionPropsbooleanDetermines whether execute command functionality is turned on for this task. If true, execute command functionality is turned on all the containers in the task. This allows you to use ECS Exec to access containers interactively. When enabled, a job role with required SSM permissions will be created automatically if no job role is provided. If a job role is alreadyprovided, the required permissions will be added to it.
Default: undefined - AWS Batch default is false
environmentOptionalinherited from EcsContainerDefinitionProps{ [key: string]: string }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.
Default: - no environment variables
executionRoleOptionalinherited from EcsContainerDefinitionPropsIRoleThe role used by Amazon ECS container and AWS Fargate agents to make AWS API calls on your behalf.
Default: - a Role will be created
jobRoleOptionalinherited from EcsContainerDefinitionPropsIRoleThe role that the container can assume.
Default: - no job role
linuxParametersOptionalinherited from EcsContainerDefinitionPropsLinuxParametersLinux-specific modifications that are applied to the container, such as details for device mappings.
Default: none
loggingOptionalinherited from EcsContainerDefinitionPropsLogDriverThe loging configuration for this Job.
Default: - the log configuration of the Docker daemon
readonlyRootFilesystemOptionalinherited from EcsContainerDefinitionPropsbooleanGives the container readonly access to its root filesystem.
Default: false
secretsOptionalinherited from EcsContainerDefinitionProps{ [key: string]: Secret }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.
Default: - no secrets
userOptionalinherited from EcsContainerDefinitionPropsstringThe user name to use inside the container.
Default: - no user
volumesOptionalinherited from EcsContainerDefinitionPropsEcsVolume[]The volumes to mount to this container. Automatically added to the job definition.
Default: - no volumes
Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.
Subscribe to Newsletteraws-batch