-
Notifications
You must be signed in to change notification settings - Fork 566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add encryption support #34
Add encryption support #34
Conversation
The encryption block is dynamic to avoid adding an empty block. An empty encryption block results in terraform expecting changes every apply. Separate keys can be used for each bucket similar to versioning and force_destroy.
I've ran the docs and linting jobs from the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this! Just a few minor nits, but overall looks good/fine.
Co-Authored-By: Morgante Pell <morgante.pell@morgante.net>
I pushed earlier but I didn't notice it failed because of the commit I made with the GH suggestion. |
encryption => encryption_key_names
9918fbe
to
9914446
Compare
Force pushed the update to the README I forgot to add with the make command |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the addition! Also, if you get a chance, it'd be helpful to add this to one of the examples/tests (but that's an optional follow-up).
I've already got most of an example done but it needs a couple tweaks. I haven't looked much at the tests just yet. |
Resolves #27
This PR allows for users to specify the
default_kms_key_name
attribute to enable encryption.Encryption can be enabled on a bucket by bucket basis similar to the existing settings:
versioning
andforce_delete
The TF handles for empty strings because while an empty string is a valid input that results in a normal google managed key bucket, terraform will see this as a change every
terraform apply
.There is no
enable = false
attribute option to have theencryption
block ignored.See the bottom of the PR for an example & plan demonstrating the issue
(Also bumps the version in requirements to match the compatibility section)
Example Usage:
Here bucket
a
will have CMEK encryption and bucketb
will have the default google managed encryptionResulting Plan:
Example of the re-apply issue:
First plan:
Every repeat plan: