Skip to content
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

chore: deprecate latestAmazonLinux2022() #26284

Merged
merged 7 commits into from
Jul 25, 2023

Conversation

pahud
Copy link
Contributor

@pahud pahud commented Jul 7, 2023

SSM parameter is not offering any al2022 AMIs as described in #26274. This PR marks latestAmazonLinux2022() as deprecated and uses latestAmazonLinux2023() instead.

  • mark latestAmazonLinux2022 as deprecated
  • update the aws-ec2 README to use latestAmazonLinux2023 instead

Closes #26274


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@gitpod-io
Copy link

gitpod-io bot commented Jul 7, 2023

@aws-cdk-automation aws-cdk-automation requested a review from a team July 7, 2023 15:10
@github-actions github-actions bot added bug This issue is a bug. effort/medium Medium work item – several days of effort p2 labels Jul 7, 2023
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Jul 7, 2023
@pahud pahud marked this pull request as ready for review July 7, 2023 15:12
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jul 7, 2023
@mrgrain
Copy link
Contributor

mrgrain commented Jul 18, 2023

@pahud can we find out if these images are still published and hardcode the latest values so people are not completely broken when using latestAmazonLinux2022()?

Co-authored-by: Momo Kornher <mail@moritzkornher.de>
@pahud
Copy link
Contributor Author

pahud commented Jul 24, 2023

@pahud can we find out if these images are still published and hardcode the latest values so people are not completely broken when using latestAmazonLinux2022()?

I can confirm latestAmazonLinux2022() does not resolve any Ami from the generated parameter path and the user will receive this error when cdk deploy:

 test-ec2-stack failed: Error [ValidationError]: Unable to fetch parameters [/aws/service/ami-amazon-linux-latest/al2022-ami-kernel-5.15-x86_64] from parameter store for this account.

This means:

  1. Users previously successfully deploy with latestAmazonLinux2022() will not be able to redeploy because cloudformation will not find the original parameter path and as far as I can see from the doc there's no amazon linux 2022 latest AMI provided anymore.
  2. They will have to choose other MachineImage and update their stack either using the original static AmiId or latestAmazonLinux2023(), which triggers instance replacement.

I am not sure if we should completely remove the latestAmazonLinux2022() method but this PR just adds the deprecated tag on it.

@mrgrain
Copy link
Contributor

mrgrain commented Jul 25, 2023

@pahud I meant can we find out what the actual AMI image ID is and put that in?

@pahud
Copy link
Contributor Author

pahud commented Jul 25, 2023

@pahud I meant can we find out what the actual AMI image ID is and put that in?

Unfortunately I can't find anywhere about the latest AMI ID of Amazon Linux 2022

The latest release note is 20230118 https://docs.aws.amazon.com/linux/al2022/release-notes/relnotes-20230118.html and nothing else after then.

minor fix
@mergify
Copy link
Contributor

mergify bot commented Jul 25, 2023

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).

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jul 25, 2023
@mergify
Copy link
Contributor

mergify bot commented Jul 25, 2023

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).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: f9543e8
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify
Copy link
Contributor

mergify bot commented Jul 25, 2023

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).

@mergify mergify bot merged commit dc287e5 into aws:main Jul 25, 2023
bmoffatt pushed a commit to bmoffatt/aws-cdk that referenced this pull request Jul 29, 2023
SSM parameter is not offering any al2022 AMIs as described in aws#26274. This PR marks `latestAmazonLinux2022()` as deprecated and uses `latestAmazonLinux2023()` instead. 

- [x] mark latestAmazonLinux2022 as deprecated
- [x] update the aws-ec2 README to use latestAmazonLinux2023 instead


Closes aws#26274 

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. contribution/core This is a PR that came from AWS. effort/medium Medium work item – several days of effort p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ec2: latestAmazonLinux2022() does not return available parameters
4 participants