AWS Batch Construct Library
This is a developer preview (public beta) module.
All classes with the Cfn
prefix in this module (CFN Resources)
are auto-generated from CloudFormation. They are stable and safe to use.
However, all other classes, i.e., higher level constructs, are under active development and subject to non-backward
compatible changes or removal in any future version. These are not subject to the Semantic Versioning model.
This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.
This module is part of the AWS Cloud Development Kit project.
Launch template support
Usage
Simply define your Launch Template:
const myLaunchTemplate = new ec2.CfnLaunchTemplate(this, 'LaunchTemplate', {
launchTemplateName: 'extra-storage-template',
launchTemplateData: {
blockDeviceMappings: [
{
deviceName: '/dev/xvdcz',
ebs: {
encrypted: true,
volumeSize: 100,
volumeType: 'gp2'
}
}
]
}
});
and use it:
const myComputeEnv = new batch.ComputeEnvironment(this, 'ComputeEnv', {
computeResources: {
launchTemplate: {
launchTemplateName: myLaunchTemplate.launchTemplateName as string,
},
vpc,
},
computeEnvironmentName: 'MyStorageCapableComputeEnvironment',
});