-
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
(aws-autoscaling): AutoScalingGroup.requireImdsv2 throws error with LaunchTemplates #27586
Comments
Hi @patlougheed , thanks for reaching out. I tried to reproduce the error with this updated code -
I can confirm the error. Here is a similiar non-responsive issue created in the past as well. Marking this as P1. |
…unchTemplates (#27648) This PR fixes the bug that AutoScalingGroup.requireImdsv2 throws error with LaunchTemplates. This handles `LaunchTemplate` in `AutoScalingGroupRequireImdsv2Aspect` when a feature flag `AUTOSCALING_GENERATE_LAUNCH_TEMPLATE` is true. Closes #27586. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
…unchTemplates (#27648) This PR fixes the bug that AutoScalingGroup.requireImdsv2 throws error with LaunchTemplates. This handles `LaunchTemplate` in `AutoScalingGroupRequireImdsv2Aspect` when a feature flag `AUTOSCALING_GENERATE_LAUNCH_TEMPLATE` is true. Closes #27586. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Hi folks - this problem appears to also exist when using A LaunchTemplate with a MixedInstancesPolicy and |
Going to see if I can get a PR on the go for the above issue |
I also get the above error, but was able to solve it by setting
|
Describe the bug
When configuring an AutoScalingGroup with
requireImdsv2
set to true and thegenerateLaunchTemplateInsteadOfLaunchConfig
context flag set to true,cdk synth
throws an error:Expected Behavior
No error; launch template should have
LaunchTemplateData.MetadataOptions.HttpTokens
set to "required" in resulting CloudFormation output.Current Behavior
cdk synth
yields:Reproduction Steps
In stack.py:
In cdk.json:
Then run
cdk synth
.Possible Solution
aws-autoscaling/lib/aspects/require-imdsv2-aspect.ts appears to target
LaunchConfiguration
s only, notLaunchTemplate
s.It similar aspect in (aws-ec2)[https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-ec2/lib/aspects/require-imdsv2-aspect.ts] has similar code that appears to support
LaunchTemplate
s.Additional Information/Context
No response
CDK CLI Version
2.101.1
Framework Version
2.101.1
Node.js Version
v20.7.0
OS
MacOS 14
Language
Python
Language Version
Python 3.10.9
Other information
No response
The text was updated successfully, but these errors were encountered: