The simplest way is to overwrite region_kms_key_ids with something like jq
or a scripting language (python etc).

On Thu, Apr 11, 2019, 20:08 Chris Stevens <[email protected]> wrote:

> Does anybody have a good solution for working with region_kms_key_ids
> where different environments use different regions?
>
> I've read several posts here like parameterizing "region_kms_key_ids"
> <https://groups.google.com/forum/#!msg/packer-tool/5mbqr5VopMw/4XhBE6cQAQAJ> 
> and
> some issues over on Github. The object can't be parameterized or passed in
> as noted in the thread attached here.
>
> I define ami_regions for each environment in a var-file and use a single
> packer json file for all environments.
>
> What I had hoped was that region_kms_key_ids could hold a superset of
> regions to keys and only the regions present in ami_regions would be used.
>
> Instead, I received the error "Region us-east-2 is in region_kms_key_ids
> but not in ami_regions".
>
> If region_kms_key_ids could be made to act as a superset of ami_regions
> and ami_regions actually control the copy operation, I think that a number
> of the issues people have reported over the years might be handled. This
> sounds safely compatible as well.
>
> Thoughts? Worth writing up on Github?
>
> - Chris
>
>
>
>
>
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in
> violation of those guidelines may result in your removal from this mailing
> list.
>
> GitHub Issues: https://github.com/mitchellh/packer/issues
> IRC: #packer-tool on Freenode
> ---
> You received this message because you are subscribed to the Google Groups
> "Packer" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/9fae05e6-99b0-4f99-8fe4-80d9b59f9673%40googlegroups.com
> <https://groups.google.com/d/msgid/packer-tool/9fae05e6-99b0-4f99-8fe4-80d9b59f9673%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt_Jm2DhRpJz_5sAS0eKxHisWLWgNKENRe9h6Ae6qp532Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to