EcsMachineImage

class aws_cdk.aws_batch.EcsMachineImage(*, image=None, image_type=None)

Bases: object

A Batch MachineImage that is compatible with ECS.

Parameters:
  • image (Optional[IMachineImage]) – The machine image to use. Default: - chosen by batch

  • image_type (Optional[EcsMachineImageType]) – Tells Batch which instance type to launch this image on. Default: - ‘ECS_AL2’ for non-gpu instances, ‘ECS_AL2_NVIDIA’ for gpu instances

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_batch as batch
from aws_cdk import aws_ec2 as ec2

# machine_image: ec2.IMachineImage

ecs_machine_image = batch.EcsMachineImage(
    image=machine_image,
    image_type=batch.EcsMachineImageType.ECS_AL2
)

Attributes

image

The machine image to use.

Default:
  • chosen by batch

image_type

Tells Batch which instance type to launch this image on.

Default:
  • ‘ECS_AL2’ for non-gpu instances, ‘ECS_AL2_NVIDIA’ for gpu instances