hashicorp / hashicorp/packer-plugin-amazon
Support creating an AMI via a snapshot of the root volume
- Dominant language
- Go
- Stars
- 91
- Forks
- 141
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 3
Description
#### Community Note
Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) 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 recommends [creating AMIs via a snapshot of a root EBS volume](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami-ebs.html#creating-launching-ami-from-snapshot) as a faster way of creating images. (This would be using the [RegisterImage](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RegisterImage.html) API rather than the [CreateImage](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateImage.html) API.) Despite this potentially offering large speed improvements, this feature seems to be missing from the Amazon Packer plugin.
The [`amazon-ebssurrogate` builder](https://developer.hashicorp.com/packer/integrations/hashicorp/amazon/latest/components/builder/ebssurrogate) exists, but as far as I can tell, that's designed to create an AMI based on a snapshot of a volume that is _not_ the root volume of the Packer builder instance.
#### Use Case(s)
- Creating AMIs more quickly
#### Potential configuration
This could be implemented using a `use_create_image` option on the `amazon-ebs` builder, similar to the option that already exists on the `amazon-ebssurrogate` builder. The main difference is that `use_create_image` would need to default to `true` on the `amazon-ebs` builder to preserve existing behavior.
```hcl
source "amazon-ebs" "ebs-source-abc" {
// ...
use_create_image = false
// ...
}
```
Contributor guide
Assessment
This issue has not been assessed yet.