feat(ec2): support using ssm parameter to resolve AMI ID at instance launch time#26273
Merged
mergify[bot] merged 8 commits intoaws:mainfrom Jul 10, 2023
Merged
Conversation
mrgrain
reviewed
Jul 7, 2023
packages/aws-cdk-lib/aws-ec2/lib/machine-image/machine-image.ts
Outdated
Show resolved
Hide resolved
mrgrain
reviewed
Jul 7, 2023
packages/aws-cdk-lib/aws-ec2/lib/machine-image/machine-image.ts
Outdated
Show resolved
Hide resolved
mrgrain
requested changes
Jul 7, 2023
packages/aws-cdk-lib/aws-ec2/lib/machine-image/machine-image.ts
Outdated
Show resolved
Hide resolved
mrgrain
reviewed
Jul 7, 2023
packages/aws-cdk-lib/aws-ec2/lib/machine-image/machine-image.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Momo Kornher <mail@moritzkornher.de>
Co-authored-by: Momo Kornher <mail@moritzkornher.de>
Co-authored-by: Momo Kornher <mail@moritzkornher.de>
mrgrain
approved these changes
Jul 10, 2023
Contributor
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Collaborator
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Contributor
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
2 tasks
bmoffatt
pushed a commit
to bmoffatt/aws-cdk
that referenced
this pull request
Jul 29, 2023
…launch time (aws#26273) Launch Template and EC2 instance support using SSM parameter to resolve the AMI ID at instance launch time(`resolve:ssm:parameter`) rather than the CFN deploy time(`CfnDynamicReference`). This PR introduces a new support for that. - [Using SSM Parameter with Autoscaling and Launch Template](https://docs.aws.amazon.com/autoscaling/ec2/userguide/using-systems-manager-parameters.html) - [Launch an instance using a Systems Manager parameter](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/finding-an-ami.html#using-systems-manager-parameter-to-find-AMI) Remove `latestAmazonLinux2022()` from the integ test as it does not return any valid al2022 images anymore as described in aws#26274 Closes aws#24551 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Any code examples to use this feature? Thanks |
Contributor
const launchTemplate = new ec2.LaunchTemplate(stack, 'LaunchTemplate', {
machineImage: ec2.MachineImage.resolveSsmParameterAtLaunch('parameterName');
}); |
Contributor
|
Make sure your SSM Param is of |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Launch Template and EC2 instance support using SSM parameter to resolve the AMI ID at instance launch time(
resolve:ssm:parameter) rather than the CFN deploy time(CfnDynamicReference). This PR introduces a new support for that.Remove
latestAmazonLinux2022()from the integ test as it does not return any valid al2022 images anymore as described in #26274Closes #24551
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license