interface IEcsContainerDefinition
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Batch.IEcsContainerDefinition |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsbatch#IEcsContainerDefinition |
Java | software.amazon.awscdk.services.batch.IEcsContainerDefinition |
Python | aws_cdk.aws_batch.IEcsContainerDefinition |
TypeScript (source) | aws-cdk-lib » aws_batch » IEcsContainerDefinition |
Implemented by
Ecs
, Ecs
A container that can be run with ECS orchestration.
Properties
Name | Type | Description |
---|---|---|
cpu | number | The number of vCPUs reserved for the container. |
execution | IRole | The role used by Amazon ECS container and AWS Fargate agents to make AWS API calls on your behalf. |
image | Container | The image that this container will run. |
memory | Size | The memory hard limit present to the container. |
node | Node | The tree node. |
volumes | Ecs [] | The volumes to mount to this container. |
command? | string[] | The command that's passed to the container. |
environment? | { [string]: string } | The environment variables to pass to a 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. |
log | Log | The configuration of the log driver. |
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. |
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.
executionRole
Type:
IRole
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
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.
node
Type:
Node
The tree node.
volumes
Type:
Ecs
[]
The volumes to mount to this container.
Automatically added to the job definition.
command?
Type:
string[]
(optional)
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.
jobRole?
Type:
IRole
(optional, default: no jobRole)
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.
logDriverConfig?
Type:
Log
(optional)
The configuration of the log driver.
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.
See also: https://docs.aws.amazon.com/batch/latest/userguide/specifying-sensitive-data.html
user?
Type:
string
(optional, default: no user)
The user name to use inside the container.
Methods
Name | Description |
---|---|
add | Add a Volume to this container. |
addVolume(volume)
public addVolume(volume: EcsVolume): void
Parameters
- volume
Ecs
Volume
Add a Volume to this container.