IEcsContainerDefinition

class aws_cdk.aws_batch.IEcsContainerDefinition(*args, **kwargs)

Bases: IConstruct, Protocol

A container that can be run with ECS orchestration.

Methods

add_volume(volume)

Add a Volume to this container.

Parameters:

volume (EcsVolume) –

Return type:

None

Attributes

command

The command that’s passed to the container.

See:

https://docs.docker.com/engine/reference/builder/#cmd

cpu

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.

environment

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

execution_role

The role used by Amazon ECS container and AWS Fargate agents to make AWS API calls on your behalf.

See:

https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html

image

The image that this container will run.

job_role

The role that the container can assume.

Default:
  • no jobRole

See:

https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html

linux_parameters

Linux-specific modifications that are applied to the container, such as details for device mappings.

Default:

none

log_driver_config

The configuration of the log driver.

memory

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

The tree node.

readonly_root_filesystem

Gives the container readonly access to its root filesystem.

Default:

false

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.

Default:
  • no secrets

See:

https://docs.aws.amazon.com/batch/latest/userguide/specifying-sensitive-data.html

user

The user name to use inside the container.

Default:
  • no user

volumes

The volumes to mount to this container.

Automatically added to the job definition.

Default:
  • no volumes