I have a packer recipe that uses var files to fill in account-specific parameters at various parts of the build process. This allows us to use the same build across multiple accounts from the same source code repo.
I was very happy to discover the "
region_kms_key_ids" parameter, as this will remove an in-house process for distributing the packer-built AMI across the regions we utilize. I would like our var files to look something like this:
{
"somevar": "someval",
"kms_key_ids_by_region": {
"us-east-1": "keyid",
[...]
}
}
However I have run into a snag, with the issue
https://github.com/hashicorp/packer/issues/2441 and the error "
Error reading variables in 'test.json': json: cannot unmarshal object into Go value of type string" It looks like putting maps into a variable file is not a supported operation. My questions are, is there any timeline for fixing this? Is there a recommended workaround? Having a separate manifest per account is a pretty bad DRY violation.
Thanks!
--Alex