Packer: panic on amazon-ebs nil region_kms_key_ids map

Created on 13 May 2019  ·  4Comments  ·  Source: hashicorp/packer

On our builds with the amazon-ebs builder, we're trying to use a Customer Managed Key (CMK) to encrypt the AMI (so that we can share it across accounts). I've been unable to come up with a configuration that uses the CMK that works. Following the discussion in #7499 I've tried to use @SwampDragons's build from #7507 and it results in a panic if the region_kms_key_ids map is unset, or a failure if it is set.

I'd be happy to contribute a patch for the nil map, but I'm not sure if the intended behavior _should_ fail (and so should be caught in an earlier config validation step), or whether the map just needs a default value.

Most helpful comment

Oh, I missed that commit! Thanks @SwampDragons !

All 4 comments

Hello there @tgross thanks for reporting, if you would like to contribute I think it's very much okay to default the map to a non-nil map, it's what I would've done 🙂

Ah, I found that bug very shortly after making the linked PR and fixed it in https://github.com/hashicorp/packer/commit/105d3f885380553b5b49ab93e556187f1dc29104. Sorry for that. You can find binaries on https://github.com/hashicorp/packer/pull/7521 but I believe both patches should also be available on our nightly build.

Oh, I missed that commit! Thanks @SwampDragons !

I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings