Closed nibty closed 3 years ago
Hey @nibty, thanks for opening the issue. We already have such a feature.
If you use packer build --except=amazon-import template.pkr.hcl
packer will not run the amazon-import
post-processor.
See here the docs: https://www.packer.io/docs/templates/hcl_templates/blocks/build/post-processor#run-on-specific-builds
Great! I didn't know you could use --except on post-processors. Thank you.
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
Add a skip_import argument to the Amazon import post-processor to allow for skipping the import on specific builds. "true" means that we should skip the import, "false" means to import as usual.
I have a branch with the feature ready. I'm creating this issue to discuss whether or not the feature is wanted. If so, I can create a pull request. https://github.com/nibty/packer-plugin-amazon/commit/c2343a63a29800f887662afadaa77ae4ca4edeff
Use Case(s)
Sometimes I do not wish to import an image to Amazon. With a skip import feature, I can pass a variable from the command line to the post-processor to control whether or not the image is imported into Amazon.
Potential configuration
Potential References