From a0aee8d7714d9291f2708983c9d5a05891ec08be Mon Sep 17 00:00:00 2001 From: Nathan Mckinley Date: Tue, 4 Aug 2020 16:50:01 -0700 Subject: [PATCH] Move shieldedvmconfig -> shieldedinstanceconfig due to rename. --- .../data_sources/data_source_google_compute_instance.go | 2 +- .../terraform/resources/resource_compute_instance.go.erb | 6 +++--- .../resources/resource_compute_instance_template.go.erb | 4 ++-- third_party/terraform/utils/compute_instance_helpers.go.erb | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/third_party/terraform/data_sources/data_source_google_compute_instance.go b/third_party/terraform/data_sources/data_source_google_compute_instance.go index e227b94ab5d1..201003eff6c6 100644 --- a/third_party/terraform/data_sources/data_source_google_compute_instance.go +++ b/third_party/terraform/data_sources/data_source_google_compute_instance.go @@ -135,7 +135,7 @@ func dataSourceGoogleComputeInstanceRead(d *schema.ResourceData, meta interface{ return err } - err = d.Set("shielded_instance_config", flattenShieldedVmConfig(instance.ShieldedVmConfig)) + err = d.Set("shielded_instance_config", flattenShieldedVmConfig(instance.ShieldedInstanceConfig)) if err != nil { return err } diff --git a/third_party/terraform/resources/resource_compute_instance.go.erb b/third_party/terraform/resources/resource_compute_instance.go.erb index a4efa69275f4..b62370b496a1 100644 --- a/third_party/terraform/resources/resource_compute_instance.go.erb +++ b/third_party/terraform/resources/resource_compute_instance.go.erb @@ -816,7 +816,7 @@ func expandComputeInstance(project string, d *schema.ResourceData, config *Confi DeletionProtection: d.Get("deletion_protection").(bool), Hostname: d.Get("hostname").(string), ForceSendFields: []string{"CanIpForward", "DeletionProtection"}, - ShieldedVmConfig: expandShieldedVmConfigs(d), + ShieldedInstanceConfig: expandShieldedVmConfigs(d), DisplayDevice: expandDisplayDevice(d), ResourcePolicies: convertStringArr(d.Get("resource_policies").([]interface{})), }, nil @@ -1098,7 +1098,7 @@ func resourceComputeInstanceRead(d *schema.ResourceData, meta interface{}) error d.Set("scratch_disk", scratchDisks) d.Set("scheduling", flattenScheduling(instance.Scheduling)) d.Set("guest_accelerator", flattenGuestAccelerators(instance.GuestAccelerators)) - d.Set("shielded_instance_config", flattenShieldedVmConfig(instance.ShieldedVmConfig)) + d.Set("shielded_instance_config", flattenShieldedVmConfig(instance.ShieldedInstanceConfig)) d.Set("enable_display", flattenEnableDisplay(instance.DisplayDevice)) d.Set("cpu_platform", instance.CpuPlatform) d.Set("min_cpu_platform", instance.MinCpuPlatform) @@ -1628,7 +1628,7 @@ func resourceComputeInstanceUpdate(d *schema.ResourceData, meta interface{}) err if d.HasChange("shielded_instance_config") { shieldedVmConfig := expandShieldedVmConfigs(d) - op, err := config.clientComputeBeta.Instances.UpdateShieldedVmConfig(project, zone, instance.Name, shieldedVmConfig).Do() + op, err := config.clientComputeBeta.Instances.UpdateShieldedInstanceConfig(project, zone, instance.Name, shieldedVmConfig).Do() if err != nil { return fmt.Errorf("Error updating shielded vm config: %s", err) } diff --git a/third_party/terraform/resources/resource_compute_instance_template.go.erb b/third_party/terraform/resources/resource_compute_instance_template.go.erb index d3c36e319795..9761b7e6fe16 100644 --- a/third_party/terraform/resources/resource_compute_instance_template.go.erb +++ b/third_party/terraform/resources/resource_compute_instance_template.go.erb @@ -835,7 +835,7 @@ func resourceComputeInstanceTemplateCreate(d *schema.ResourceData, meta interfac Scheduling: scheduling, ServiceAccounts: expandServiceAccounts(d.Get("service_account").([]interface{})), Tags: resourceInstanceTags(d), - ShieldedVmConfig: expandShieldedVmConfigs(d), + ShieldedInstanceConfig: expandShieldedVmConfigs(d), DisplayDevice: expandDisplayDevice(d), } @@ -1199,7 +1199,7 @@ func resourceComputeInstanceTemplateRead(d *schema.ResourceData, meta interface{ } } if instanceTemplate.Properties.ShieldedVmConfig != nil { - if err = d.Set("shielded_instance_config", flattenShieldedVmConfig(instanceTemplate.Properties.ShieldedVmConfig)); err != nil { + if err = d.Set("shielded_instance_config", flattenShieldedVmConfig(instanceTemplate.Properties.ShieldedInstanceConfig)); err != nil { return fmt.Errorf("Error setting shielded_instance_config: %s", err) } } diff --git a/third_party/terraform/utils/compute_instance_helpers.go.erb b/third_party/terraform/utils/compute_instance_helpers.go.erb index 73860f2c80be..6fb1d06b412b 100644 --- a/third_party/terraform/utils/compute_instance_helpers.go.erb +++ b/third_party/terraform/utils/compute_instance_helpers.go.erb @@ -315,13 +315,13 @@ func resourceInstanceTags(d TerraformResourceData) *computeBeta.Tags { return tags } -func expandShieldedVmConfigs(d TerraformResourceData) *computeBeta.ShieldedVmConfig { +func expandShieldedVmConfigs(d TerraformResourceData) *computeBeta.ShieldedInstanceConfig { if _, ok := d.GetOk("shielded_instance_config"); !ok { return nil } prefix := "shielded_instance_config.0" - return &computeBeta.ShieldedVmConfig{ + return &computeBeta.ShieldedInstanceConfig{ EnableSecureBoot: d.Get(prefix + ".enable_secure_boot").(bool), EnableVtpm: d.Get(prefix + ".enable_vtpm").(bool), EnableIntegrityMonitoring: d.Get(prefix + ".enable_integrity_monitoring").(bool), @@ -329,7 +329,7 @@ func expandShieldedVmConfigs(d TerraformResourceData) *computeBeta.ShieldedVmCon } } -func flattenShieldedVmConfig(shieldedVmConfig *computeBeta.ShieldedVmConfig) []map[string]bool { +func flattenShieldedVmConfig(shieldedVmConfig *computeBeta.ShieldedInstanceConfig) []map[string]bool { if shieldedVmConfig == nil { return nil }