Skip to content

adding KMS key encryption to disks#569

Merged
modular-magician merged 11 commits into
GoogleCloudPlatform:masterfrom
chrisst:kms-disk-encruption
Oct 20, 2018
Merged

adding KMS key encryption to disks#569
modular-magician merged 11 commits into
GoogleCloudPlatform:masterfrom
chrisst:kms-disk-encruption

Conversation

@chrisst
Copy link
Copy Markdown

@chrisst chrisst commented Oct 16, 2018

Also adding to Image and Snapshot even though those resources aren't generated
yet.


[all]

[terraform]

adding KMS key encryption to disks

[puppet]

[puppet-bigquery]

[puppet-compute]

[puppet-container]

[puppet-dns]

[puppet-logging]

[puppet-pubsub]

[puppet-resourcemanager]

[puppet-sql]

[puppet-storage]

[chef]

[chef-compute]

[chef-container]

[chef-dns]

[chef-logging]

[chef-spanner]

[chef-sql]

[chef-storage]

[ansible]

@chrisst
Copy link
Copy Markdown
Author

chrisst commented Oct 16, 2018

Will add tests once #568 is merged.

@danawillow
Copy link
Copy Markdown
Contributor

Looks like this failed in concourse: https://terraform.ci.cloud-graphite.com/builds/9663. I'm a bit confused why puppet tried to do anything with it, given that it's min_version: beta.

@chrisst chrisst force-pushed the kms-disk-encruption branch from f2d7bce to 66e21c9 Compare October 16, 2018 19:08
@chrisst
Copy link
Copy Markdown
Author

chrisst commented Oct 17, 2018

@danawillow it appears that MM never correctly handled 'beta' versions nested below a certain depth. I added a commit to strip out properties that are at the wrong version.

@danawillow
Copy link
Copy Markdown
Contributor

Is that generated PR expected? It looks like it put the new field in the GA provider so I'm going to hold off on reviewing now assuming it wasn't expected.

@chrisst
Copy link
Copy Markdown
Author

chrisst commented Oct 17, 2018

I guess the PR is kind of expected. I'm adding new beta fields with new custom code and new tests that depend on the beta fields. So I'm not sure how we have dealt with testing beta fields in the past, or more importantly how we deal with them now. But at least it's not generating chef and puppet code like it was before!

@danawillow
Copy link
Copy Markdown
Contributor

Got it! We'll add protectors around the beta stuff- I'm working on that right now. It should be doable in the custom code parts with an <% if version == 'beta' -%> or something like that, but for tests I don't have it ready yet (it'll be part of #502).

Copy link
Copy Markdown
Contributor

@danawillow danawillow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I'd prefer this wait until my changes get in so you can exclude the test from the GA provider, but I'm willing to be convinced otherwise.

resource "google_project_services" "apis" {
project = "${google_project.project.project_id}"
services = [
"oslogin.googleapis.com",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: spaces vs tabs in this list

// The raw key won't be returned, so we need to use the original.
transformed["rawKey"] = d.Get("disk_encryption_key.0.raw_key")
transformed["sha256"] = original["sha256"]
// The response for crypto keys often includes the version of the key which needs to be removed
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should add version checks in ruby here so that these don't appear in the GA version:

<% unless version.nil? || version == 'ga' %>

(you can do this now, without my changes)

@chrisst
Copy link
Copy Markdown
Author

chrisst commented Oct 17, 2018

I would agree except that d26bd76 solves a long standing MM bug
Also I'm a little nervous that some of the PR's into the beta provider to get it up and running will have huge diffs and it might not get noticed that hashicorp/terraform-provider-google-beta#8 will be reverted.

If it's just 1 test that will be failing, I'm all for merging it in.

@danawillow
Copy link
Copy Markdown
Contributor

It wouldn't be reverted though, it would start getting generated, right?

Anyway yeah that's fine, it's just one test and we'll probably have it fixed by the end of tomorrow (if not sooner) anyway.

@chrisst chrisst force-pushed the kms-disk-encruption branch 3 times, most recently from b84e14b to d3532dc Compare October 19, 2018 23:02
@danawillow
Copy link
Copy Markdown
Contributor

If it's not a big deal, I'd rather we do version comparisons against ga instead of against beta. If we were to add an alpha version, this feature would be a part of it.

@modular-magician
Copy link
Copy Markdown
Collaborator

I am (still) a robot that works on MagicModules PRs!

I just wanted to let you know that your changes (as of commit 2ff85db) have been included in your existing downstream PRs.

@chrisst chrisst force-pushed the kms-disk-encruption branch 2 times, most recently from 1da4856 to 105ee40 Compare October 20, 2018 00:56
@chrisst chrisst force-pushed the kms-disk-encruption branch from 105ee40 to d4bc1b4 Compare October 20, 2018 02:43
@modular-magician
Copy link
Copy Markdown
Collaborator

I am a robot that works on MagicModules PRs!

I built this PR into one or more PRs on other repositories, and when those are closed, this PR will also be merged and closed.
depends: hashicorp/terraform-provider-google-beta#19

Tracked submodules are build/puppet/_bundle build/puppet/auth build/puppet/bigquery build/puppet/compute build/puppet/sql build/puppet/storage build/puppet/spanner build/puppet/container build/puppet/dns build/puppet/pubsub build/puppet/resourcemanager build/chef/_bundle build/chef/auth build/chef/compute build/chef/sql build/chef/storage build/chef/spanner build/chef/container build/chef/dns build/chef/iam build/terraform-beta build/terraform build/ansible build/inspec.
@modular-magician modular-magician merged commit 51f2020 into GoogleCloudPlatform:master Oct 20, 2018
@chrisst chrisst deleted the kms-disk-encruption branch October 20, 2018 04:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants