Solutions for region_kms_key_ids and ami_regions across environments

223 views
Skip to first unread message

Chris Stevens

unread,
Apr 11, 2019, 2:08:18 PM4/11/19
to Packer
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" 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





Rickard von Essen

unread,
Apr 11, 2019, 3:10:51 PM4/11/19
to packe...@googlegroups.com
The simplest way is to overwrite region_kms_key_ids with something like jq or a scripting language (python etc). 

--
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 packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/9fae05e6-99b0-4f99-8fe4-80d9b59f9673%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages