packer-plugin-amazon
packer-plugin-amazon copied to clipboard
feat: AMI Deregistration Protection
Please search the existing issues for relevant feature requests, and use the reaction feature (https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to add upvotes to pre-existing requests.
Community Note
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request. If you are interested in working on this issue or have submitted a pull request, please leave a comment.
Description
AWS released in May 2024 the capability to protect AMIs against mistaken Deregistrations.
- https://aws.amazon.com/about-aws/whats-new/2024/05/amazon-ec2-protects-amis-accidental-deregistration/
- https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/deregister-ami.html#ami-deregistration-protection
It would be nice to take this feature into account in order to streamline the setup of this additional layer of protection at AMI build time through Packer.
Use Case(s)
Some use cases could be:
- Prevention against mistaken AMI deregistration,
- legal locks for compliance, ...
Potential configuration
source "amazon-ebs" "basic-example" {
source_ami_filter {
filters = {
virtualization-type = "hvm"
name = "ubuntu/images/*ubuntu-xenial-16.04-amd64-server-*"
root-device-type = "ebs"
}
owners = ["099720109477"]
most_recent = true
deregistration_protection {
enabled = true
cooldown_period = "24h"
}
}
}
Potential References
AWS References:
- https://aws.amazon.com/about-aws/whats-new/2024/05/amazon-ec2-protects-amis-accidental-deregistration/
- https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/deregister-ami.html#ami-deregistration-protection