-
Notifications
You must be signed in to change notification settings - Fork 48
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
AL2022 AMI name - drop root volume type, add kernel version #81
Conversation
kernel_version_al2022 = "-kernel-5.15" | ||
kernel_version_al2022arm = "-kernel-5.15" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to set them even though they are technically not used in the past release, because otherwise packer static-check throws
Error: Unset variable "kernel_version_al2022"
A used variable must be set or have a default value
@@ -53,10 +53,12 @@ ami_name_al2_arm=$(aws ec2 describe-images --region "$region" --owner amazon --i | |||
# AL2022 | |||
ami_id_al2022_x86=$(aws ssm get-parameters --region "$region" --names /aws/service/ami-amazon-linux-latest/al2022-ami-minimal-kernel-default-x86_64 --query 'Parameters[0].[Value]' --output text) | |||
ami_name_al2022_x86=$(aws ec2 describe-images --region "$region" --owner amazon --image-id "$ami_id_al2022_x86" --query 'Images[0].Name' --output text) | |||
kernel_version_al2022_x86=$(grep -o -e "-kernel-[1-9.]*" <<<"$ami_name_al2022_x86") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just found that there are new names for us to get AL2022 and AL2022 ARM AMI IDs with the specified kernel version in SSM. Can we update the script to use the new name as we will prefer to support AMIs with certain kernel version and release AMIs with new kernel version after testing is done?
New name field for SSM:
- AL2022:
/aws/service/ami-amazon-linux-latest/al2022-ami-minimal-kernel-5.15-x86_64
ami-0a100548f6e970961 in us-west-2
^ the same AMI ID as using "/aws/service/ami-amazon-linux-latest/al2022-ami-minimal-kernel-default-x86_64" returned so far - AL2022 ARM:
/aws/service/ami-amazon-linux-latest/al2022-ami-minimal-kernel-5.15-arm64
ami-0a11fe2d14d48cb2d in us-west-2
^ the same AMI ID as using "/aws/service/ami-amazon-linux-latest/al2022-ami-minimal-kernel-default-arm64" returned so far
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we will prefer to support AMIs with certain kernel version and release AMIs with new kernel version after testing is done
I think, ideally, ECS AMIs want to stay in sync with AL on the "recommended" (or default) kernel version. It does mean that we need to work with AL on qualification, before they start pointing the default image to the ones with newer kernels.
But either way, I'd prefer to take it as a separate issue, which can have a more profound change (changing source AMIs) than what this PR is intended for (just updating ECS AMI names).
@@ -104,6 +104,16 @@ variable "distribution_release_al2022" { | |||
description = "Amazon Linux 2022 distribution release." | |||
} | |||
|
|||
variable "kernel_version_al2022" { | |||
type = string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we merge kernel_version_al2022
and kernel_version_al2022arm
into one variable kernel_version_al2022
when we update the generate-release-vars.sh to use the kernel version and get AL2022 and AL2022 ARM AMI IDs from SSM? If it is yes, should we set default value kernel-5.15
for kernel_version_al2022
in variables.pkr.hcl instead of adding new variables to the generate-release-vars.sh?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above - would like to have a separate discussion on whether we would like to start pinning kernel versions for ECS Optimized AMIs.
Summary
Drop root volume type and add kernel version to AL2022 ECS Optimized AMI names, in order to be more consistent with AL2022 AMI naming.
Implementation details
kernel_version_al2022
andkernel_version_al2022arm
. The variables will be populated when runninggenerate-release-vars.sh
, if the kernel versions are present in base AL2022 AMI names.-ebs
root volume type, as well as pick up kernel version parameter.Testing
Description for the changelog
AL2022 AMI name - drop root volume type, add kernel version
Licensing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.