-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ecs: "The provided launch template does not expose its user data" when trying to add a second capacity provider #30742
Comments
@rantoniuk Good afternoon. Thanks for opening the issue. The error is perhaps thrown here. Please refer to section Clusters in Amazon ECS Construct Library README. It mentions that We also have an open issue #26035 (comment) to improve error messaging in case user data is missing from launch template, however, don't have ETA as of now. Thanks, |
Yes. If you look at the stack trace, it fails at this method:
message: The provided launch template does not expose its user data. And if you check here: aws-cdk/packages/aws-cdk-lib/aws-autoscaling/lib/auto-scaling-group.ts Lines 1702 to 1712 in b7f626b
If launchTemplate is provided, it has to have Looking at your const launchTemplateInf1 = new ec2.LaunchTemplate(this, 'EcsClusterInf1', {
machineImage: ec2.MachineImage.genericLinux({
// aws ssm get-parameters --names /aws/service/ecs/optimized-ami/amazon-linux-2023/neuron/recommended
'us-west-2': 'ami-00a3a4671e9889e76',
}),
instanceType: new ec2.InstanceType('inf1.2xlarge'),
role: ltRole,
securityGroup: gpuinstanceSecurityGroup,
// blockDevices: [rootVolume],
requireImdsv2: true,
}); |
Yes, I confirm that fixes the issue: const userDataInf1= ec2.UserData.forLinux();
// GPU EC2 Launch Template
const launchTemplateInf1 = new ec2.LaunchTemplate(this, 'EcsClusterInf1', {
machineImage:
ec2.MachineImage.fromSsmParameter(
'/aws/service/ecs/optimized-ami/amazon-linux-2023/neuron/recommended/image_id',
),
instanceType: new ec2.InstanceType('inf1.2xlarge'),
role: ltRole,
userData: userDataInf1,
securityGroup: gpuinstanceSecurityGroup,
// blockDevices: [rootVolume],
requireImdsv2: true,
}); However let me ask a follow-up questions then:
then Cloudformation complained that it can't find imageId. I had to use an undocumented suffix, so |
Describe the bug
The code below works perfectly fine until the line
----- inf1
, so with onegpuCapacityProvider
.When trying to add additional
inf1CP
capacity provider, with a new LaunchTemplate that does not mention anything about UserData, it errors out oncdk diff
with:which is specifically caused by this line:
Expected Behavior
Current Behavior
Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.146.0 (build b368c78)
Framework Version
No response
Node.js Version
v20.13.1
OS
MacOS
Language
TypeScript
Language Version
"typescript": "~5.2.0"
Other information
No response
The text was updated successfully, but these errors were encountered: