diff --git a/products/accesscontextmanager/terraform.yaml b/products/accesscontextmanager/terraform.yaml index 0e0d6e646838..a11fda4e45c6 100644 --- a/products/accesscontextmanager/terraform.yaml +++ b/products/accesscontextmanager/terraform.yaml @@ -19,6 +19,7 @@ overrides: !ruby/object:Overrides::ResourceOverrides update_minutes: 6 delete_minutes: 6 autogen_async: true + id_format: "{{name}}" import_format: ["{{name}}"] examples: - !ruby/object:Provider::Terraform::Examples diff --git a/third_party/terraform/resources/resource_bigtable_table.go b/third_party/terraform/resources/resource_bigtable_table.go index d5b55b08b72d..290f585a3d98 100644 --- a/third_party/terraform/resources/resource_bigtable_table.go +++ b/third_party/terraform/resources/resource_bigtable_table.go @@ -111,7 +111,7 @@ func resourceBigtableTableCreate(d *schema.ResourceData, meta interface{}) error } } - id, err := replaceVars(d, config, "projects/{{project}}/instances/{{instance_id}}/tables/{{name}}") + id, err := replaceVars(d, config, "projects/{{project}}/instances/{{instance_name}}/tables/{{name}}") if err != nil { return fmt.Errorf("Error constructing id: %s", err) } @@ -137,7 +137,7 @@ func resourceBigtableTableRead(d *schema.ResourceData, meta interface{}) error { defer c.Close() - name := d.Id() + name := d.Get("name").(string) table, err := c.TableInfo(ctx, name) if err != nil { log.Printf("[WARN] Removing %s because it's gone", name) diff --git a/third_party/terraform/resources/resource_cloudiot_registry.go b/third_party/terraform/resources/resource_cloudiot_registry.go index f392f02681cb..21916631c45b 100644 --- a/third_party/terraform/resources/resource_cloudiot_registry.go +++ b/third_party/terraform/resources/resource_cloudiot_registry.go @@ -404,6 +404,8 @@ func resourceCloudIoTRegistryRead(d *schema.ResourceData, meta interface{}) erro } d.Set("credentials", credentials) d.Set("log_level", res.LogLevel) + // Removed Computed field must be set to nil to prevent spurious diffs + d.Set("event_notification_config", nil) return nil } diff --git a/third_party/terraform/tests/resource_compute_instance_template_test.go b/third_party/terraform/tests/resource_compute_instance_template_test.go index e8519f66eb07..43695f5cf11b 100644 --- a/third_party/terraform/tests/resource_compute_instance_template_test.go +++ b/third_party/terraform/tests/resource_compute_instance_template_test.go @@ -1998,6 +1998,7 @@ resource "google_compute_instance_template" "foobar" { } disk { auto_delete = true + disk_size_gb = 375 type = "SCRATCH" disk_type = "local-ssd" } diff --git a/third_party/terraform/tests/resource_compute_target_pool_test.go b/third_party/terraform/tests/resource_compute_target_pool_test.go index d4a624f778c9..7a0eafd2e14f 100644 --- a/third_party/terraform/tests/resource_compute_target_pool_test.go +++ b/third_party/terraform/tests/resource_compute_target_pool_test.go @@ -139,7 +139,7 @@ func testAccCheckComputeTargetPoolHealthCheck(targetPool, healthCheck string) re hcLink := healthCheckRes.Primary.Attributes["self_link"] if targetPoolRes.Primary.Attributes["health_checks.0"] != hcLink { - return fmt.Errorf("Health check not set up. Expected %q", hcLink) + return fmt.Errorf("Health check not set up. Expected %q to equal %q", targetPoolRes.Primary.Attributes["health_checks.0"], hcLink) } return nil diff --git a/third_party/terraform/tests/resource_compute_target_ssl_proxy_test.go b/third_party/terraform/tests/resource_compute_target_ssl_proxy_test.go index 55c55dbebb8c..b2e8c5f53039 100644 --- a/third_party/terraform/tests/resource_compute_target_ssl_proxy_test.go +++ b/third_party/terraform/tests/resource_compute_target_ssl_proxy_test.go @@ -53,14 +53,15 @@ func testAccCheckComputeTargetSslProxy(n, proxyHeader, sslCert string) resource. } config := testAccProvider.Meta().(*Config) + name := rs.Primary.Attributes["name"] found, err := config.clientCompute.TargetSslProxies.Get( - config.Project, rs.Primary.ID).Do() + config.Project, name).Do() if err != nil { return err } - if found.Name != rs.Primary.ID { + if found.Name != name { return fmt.Errorf("TargetSslProxy not found") } diff --git a/third_party/terraform/tests/resource_compute_target_tcp_proxy_test.go b/third_party/terraform/tests/resource_compute_target_tcp_proxy_test.go index 7214981fd8f2..a9b744350ff3 100644 --- a/third_party/terraform/tests/resource_compute_target_tcp_proxy_test.go +++ b/third_party/terraform/tests/resource_compute_target_tcp_proxy_test.go @@ -51,14 +51,15 @@ func testAccCheckComputeTargetTcpProxyExists(n string) resource.TestCheckFunc { } config := testAccProvider.Meta().(*Config) + name := rs.Primary.Attributes["name"] found, err := config.clientCompute.TargetTcpProxies.Get( - config.Project, rs.Primary.ID).Do() + config.Project, name).Do() if err != nil { return err } - if found.Name != rs.Primary.ID { + if found.Name != name { return fmt.Errorf("TargetTcpProxy not found") }