aws-autoscaling: LaunchTemplate
resource should be created for AutoScalingGroup
instead of LaunchConfiguration
when running unit tests
#28750
Labels
@aws-cdk/aws-autoscaling
Related to Amazon EC2 Auto Scaling
bug
This issue is a bug.
effort/medium
Medium work item – several days of effort
p2
Describe the bug
Hi, template generated from stack in unit tests creates a
LaunchConfiguration
resource instead of the recommendedLaunchTemplate
resource when anAutoScalingGroup
resource is created. So when a test like this is added:It will fail with:
Please note that this only happens for unit tests, when
cdk synth
is executedAutoScalingGroup
is correctly created with aLaunchTemplate
:Expected Behavior
LaunchTemplate
should be created instead ofLaunchConfiguration
forAutoScalingGroup
when template is created during unit test execution. This as per recommendation of Template reference docs.Current Behavior
LaunchConfiguration
is created forAutoScalingGroup
instead ofLaunchTemplate
when template is created during unit test execution. This is against recommendation of Template reference docs.Reproduction Steps
cdk init app --language typescript
using latest CDK CLI (version2.121.1 (build d86bb1a)
).lib/
with this code:test/
with this code:npm test
.Possible Solution
Possibly solution from #23165 could be extended.
Additional Information/Context
Contents from
package.json
:CDK CLI Version
2.121.1 (build d86bb1a)
Framework Version
2.121.1
Node.js Version
v18.18.0
OS
macOS Sonoma 14.2.1
Language
TypeScript
Language Version
Version 5.3.3
Other information
The text was updated successfully, but these errors were encountered: