Skip to content

Commit

Permalink
Adding enableConfidentialCompute field for Hyperdisk (#8324) (#15180)
Browse files Browse the repository at this point in the history
* adding in enableConfidentialCompute for Hyper disk

* added in min_version

* Adding in enableConfidentialCompute field for Hyperdisk

* Adding in Test

Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored Jul 14, 2023
1 parent 2664aad commit f22350c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/8324.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
compute: added field `enableConfidentialCompute` for `google_compute_disk` resource
```
17 changes: 17 additions & 0 deletions google/resource_compute_disk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,23 @@ resource "google_compute_instance_group_manager" "manager" {
`, diskName, mgrName)
}

func testAccComputeDisk_pdHyperDiskEnableConfidentialCompute(context map[string]interface{}) string {
return Nprintf(`
resource "google_compute_disk" "foobar" {
name = "tf-test-ecc-%{random_suffix}"
size = %{disk_size}
type = "hyperdisk-balanced"
zone = "us-central1-a"
enable_confidential_compute = %{confidential_compute}
disk_encryption_key {
kms_key_self_link = "%{kms}"
}
}
`, context)
}

func testAccComputeDisk_pdHyperDiskProvisionedIopsLifeCycle(context map[string]interface{}) string {
return acctest.Nprintf(`
resource "google_compute_disk" "foobar" {
Expand Down
5 changes: 5 additions & 0 deletions website/docs/r/compute_disk.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,11 @@ The following arguments are supported:
[`google_compute_disk_resource_policy_attachment`](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_disk_resource_policy_attachment)
to allow for updating the resource policy attached to the disk.

* `enable_confidential_compute` -
(Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html))
Whether this disk is using confidential compute mode.
Note: Only supported on hyperdisk skus, disk_encryption_key is required when setting to true

* `multi_writer` -
(Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html))
Indicates whether or not the disk can be read/write attached to more than one instance.
Expand Down

0 comments on commit f22350c

Please sign in to comment.