hashicorp / packer-plugin-amazon

Packer plugin for Amazon AMI Builder
https://www.packer.io/docs/builders/amazon
Mozilla Public License 2.0
69 stars 104 forks source link

feat: AMI Deregistration Protection #486

Open schniber opened 1 week ago

schniber commented 1 week ago

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.

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:

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:

lbajolet-hashicorp commented 1 week ago

Hi @schniber,

Thanks for bringing this one up! This looks like a good candidate for a first contribution, would you be interested in contributing this? We can provide help if you're interested, let us know!

Otherwise we can see to include this in the future, can't promise when as other priorities clash with this, but we'll keep an eye open.