【发布时间】:2022-08-03 15:15:03
【问题描述】:
我正在尝试使用 LaunchTemplate 设置一个简单的批处理计算环境,以便我可以指定大于默认值的卷大小:
const templateName = \'my-template\'
const jobLaunchTemplate = new ec2.LaunchTemplate(stack, \'Template\', {
launchTemplateName: templateName,
blockDevices: [ ..vol config .. ]
})
const computeEnv = new batch.CfnComputeEnvironment(stack, \'CompEnvironment\', {
type: \'managed\',
computeResources: {
instanceRole: jobRole.roleName,
instanceTypes: [
InstanceType.of(InstanceClass.C4, InstanceSize.LARGE).toString()
],
maxvCpus: 64,
minvCpus: 0,
desiredvCpus: 0,
subnets: vpc.publicSubnets.map(sn => sn.subnetId),
securityGroupIds: [vpc.vpcDefaultSecurityGroup],
type: \'EC2\',
launchTemplate: {
launchTemplateName: templateName,
}
},
})
它们在未链接时都可以正常初始化,但是一旦将 launchTemplate 块添加到计算环境中,我就会收到以下错误:
Error: Resource handler returned message: \"Resource of type \'AWS::Batch::ComputeEnvironment\' with identifier \'compute-env-arn\' did not stabilize.\" (RequestToken: token, HandlerErrorCode: NotStabilized)
任何建议都非常感谢,在此先感谢!
标签: amazon-ec2 amazon-cloudformation aws-cdk aws-batch