Skip to content
v2.274.0

EcsMachineImage Struct ​

A Batch MachineImage that is compatible with ECS.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_batch as batch } from 'aws-cdk-lib';
import { aws_ec2 as ec2 } from 'aws-cdk-lib';

declare const machineImage: ec2.IMachineImage;
const ecsMachineImage: batch.EcsMachineImage = {
  image: machineImage,
  imageType: batch.EcsMachineImageType.ECS_AL2,
};

Properties ​

imageoptionalIMachineImageimageoptionalIMachineImageimageoptionalIMachineImageImageoptionalIMachineImageImageoptionalIMachineImage#
The machine image to use.

Default: chosen by batch

imageTypeoptionalEcsMachineImageTypeimage_typeoptionalEcsMachineImageTypeimageTypeoptionalEcsMachineImageTypeImageTypeoptionalEcsMachineImageTypeImageTypeoptionalEcsMachineImageType#
Tells Batch which instance type to launch this image on.

Default: 'ECS_AL2' for non-gpu instances, 'ECS_AL2_NVIDIA' for gpu instances. If the '@aws-cdk/aws-batch:defaultToAL2023' feature flag is set, 'ECS_AL2023' will be used instead of 'ECS_AL2'.