Skip to content

Commit f6b649d

Browse files
authored
feat(asg): support keypair functionality for asg (#29679)
### Issue When creating an instance directly through the asg, it is not possible to define the `keyPair`, in addition to bringing a warning message that the `keyName` will be removed This configuration allows sending the `keyPair` to the asg since the LaunchTemplate allows its integration Warning: > [WARNING] aws-cdk-lib.aws_ec2.LaunchTemplateProps#keyName is deprecated. Closes #29237 ### Reason for this change I'm working directly with CDK and needed to implement a way to use my `keyPair` and avoid warning that `keyName` will be removed soon when i'm creating my ASG ### Description of changes - Add `keyPair` to CommonAutoScalingGroupProps interface - Prevent `keyPair` and `keyName` from being set at the same time - Send `keyPair` when creating LaunchTemplate if flag `AUTOSCALING_GENERATE_LAUNCH_TEMPLATE` is enabled - Prevent `keyPair` if the flag `AUTOSCALING_GENERATE_LAUNCH_TEMPLATE` is disabled ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 38a2284 commit f6b649d

12 files changed

+2219
-2
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.asg-keypair.js.snapshot/AsgIntegKeyPairDefaultTestDeployAssert4EC47FB2.assets.json

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.asg-keypair.js.snapshot/AsgIntegKeyPairDefaultTestDeployAssert4EC47FB2.template.json

+36
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.asg-keypair.js.snapshot/aws-cdk-asg-integ.assets.json

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)