Skip to content

Commit

Permalink
Skip TestAccWorkstationsWorkstationConfig_workstationConfigEncryption…
Browse files Browse the repository at this point in the history
…KeyExample (#7415) (#5299)

Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored Mar 8, 2023
1 parent 90a0888 commit 12a164f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 107 deletions.
3 changes: 3 additions & 0 deletions .changelog/7415.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:none

```
102 changes: 0 additions & 102 deletions google-beta/resource_workstations_workstation_config_generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,108 +343,6 @@ resource "google_workstations_workstation_config" "default" {
`, context)
}

func TestAccWorkstationsWorkstationConfig_workstationConfigEncryptionKeyExample(t *testing.T) {
t.Parallel()

context := map[string]interface{}{
"random_suffix": RandString(t, 10),
}

VcrTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: TestAccProvidersOiCS,
CheckDestroy: testAccCheckWorkstationsWorkstationConfigDestroyProducer(t),
Steps: []resource.TestStep{
{
Config: testAccWorkstationsWorkstationConfig_workstationConfigEncryptionKeyExample(context),
},
{
ResourceName: "google_workstations_workstation_config.default",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"workstation_config_id", "workstation_cluster_id", "location"},
},
},
})
}

func testAccWorkstationsWorkstationConfig_workstationConfigEncryptionKeyExample(context map[string]interface{}) string {
return Nprintf(`
resource "google_compute_network" "default" {
provider = google-beta
name = "tf-test-workstation-cluster%{random_suffix}"
auto_create_subnetworks = false
}
resource "google_compute_subnetwork" "default" {
provider = google-beta
name = "tf-test-workstation-cluster%{random_suffix}"
ip_cidr_range = "10.0.0.0/24"
region = "us-central1"
network = google_compute_network.default.name
}
resource "google_workstations_workstation_cluster" "default" {
provider = google-beta
workstation_cluster_id = "tf-test-workstation-cluster%{random_suffix}"
network = google_compute_network.default.id
subnetwork = google_compute_subnetwork.default.id
location = "us-central1"
labels = {
"label" = "key"
}
annotations = {
label-one = "value-one"
}
}
resource "google_kms_key_ring" "default" {
name = "tf-test-workstation-cluster%{random_suffix}"
location = "global"
provider = google-beta
}
resource "google_kms_crypto_key" "default" {
name = "tf-test-workstation-cluster%{random_suffix}"
key_ring = google_kms_key_ring.default.id
rotation_period = "100000s"
provider = google-beta
}
resource "google_service_account" "default" {
account_id = "tf-test-my-account%{random_suffix}"
display_name = "Service Account"
provider = google-beta
}
resource "google_workstations_workstation_config" "default" {
provider = google-beta
workstation_config_id = "tf-test-workstation-config%{random_suffix}"
workstation_cluster_id = google_workstations_workstation_cluster.default.workstation_cluster_id
location = "us-central1"
host {
gce_instance {
machine_type = "e2-standard-4"
boot_disk_size_gb = 35
disable_public_ip_addresses = true
shielded_instance_config {
enable_secure_boot = true
enable_vtpm = true
}
}
}
encryption_key {
kms_key = google_kms_crypto_key.default.id
kms_key_service_account = google_service_account.default.email
}
}
`, context)
}

func testAccCheckWorkstationsWorkstationConfigDestroyProducer(t *testing.T) func(s *terraform.State) error {
return func(s *terraform.State) error {
for name, rs := range s.RootModule().Resources {
Expand Down
5 changes: 0 additions & 5 deletions website/docs/r/workstations_workstation_config.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,6 @@ resource "google_workstations_workstation_config" "default" {
}
}
```
<div class = "oics-button" style="float: right; margin: 0 0 -15px">
<a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgit.luolix.top%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=workstation_config_encryption_key&cloudshell_image=gcr.io%2Fgraphite-cloud-shell-images%2Fterraform%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank">
<img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
</a>
</div>
## Example Usage - Workstation Config Encryption Key


Expand Down

0 comments on commit 12a164f

Please sign in to comment.