Skip to content
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

providers/google: Add support for encrypting a disk #11167

Merged
merged 3 commits into from
Jan 18, 2017

Conversation

danawillow
Copy link
Contributor

This provides the ability to use raw customer-supplied encryption keys for disks created using the disk or instance resources.
https://cloud.google.com/compute/docs/disks/customer-supplied-encryption

Copy link
Contributor

@stack72 stack72 left a comment

Choose a reason for hiding this comment

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

Hi @danawillow

Thanks for the work here - left a few questions inline about parameters

thanks

Paul

@@ -28,6 +28,17 @@ func resourceComputeDisk() *schema.Resource {
ForceNew: true,
},

"disk_encryption_key_raw": &schema.Schema{
Copy link
Contributor

Choose a reason for hiding this comment

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

is this a sensitive key? If so, we should add Sensitive: true to the schema

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -75,6 +75,17 @@ func resourceComputeInstance() *schema.Resource {
Type: schema.TypeString,
Optional: true,
},

"disk_encryption_key_raw": &schema.Schema{
Copy link
Contributor

Choose a reason for hiding this comment

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

does this also need Sensitive: true ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

"auto_delete": d.Get(fmt.Sprintf("disk.%d.auto_delete", i)),
"size": d.Get(fmt.Sprintf("disk.%d.size", i)),
"device_name": d.Get(fmt.Sprintf("disk.%d.device_name", i)),
"disk_encryption_key_raw": d.Get(fmt.Sprintf("disk.%d.disk_encryption_key_raw", i)),
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to add the raw encryption key to the state?

Copy link
Contributor

Choose a reason for hiding this comment

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

FYI, this is not happening in compute_disk

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think you're right. Removed.

@stack72
Copy link
Contributor

stack72 commented Jan 18, 2017

this looks great now @danawillow :)

% make testacc TEST=./builtin/providers/google TESTARGS='-run=TestAccComputeDisk_'                                                        ✭
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/01/18 13:46:38 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/google -v -run=TestAccComputeDisk_ -timeout 120m
=== RUN   TestAccComputeDisk_basic
--- PASS: TestAccComputeDisk_basic (29.67s)
=== RUN   TestAccComputeDisk_encryption
--- PASS: TestAccComputeDisk_encryption (29.65s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/google	59.335s

@ghost
Copy link

ghost commented Apr 17, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants