Repository: GoogleCloudPlatform/terraform-validator
Pull request #905 (2022-08-09 20:40:25)

Fix compute instance iam asset name
<!-- Put a description of what this PR is for here, along with any references to issues that this resolves or contributes to -->
Fix compute instance iam asset name

Asset name was expecting `instance`, but compute instance iam uses instance_name as attribute name. 



<!--
Replace each [ ] with [X] to check it. Switch to the preview view to make it easier to click on links.
These steps will speed up the review process, and we appreciate you spending time on them before sending
your code to be reviewed.
-->
If this PR is for Terraform, I acknowledge that I have:

- [X] Searched through the [issue tracker](https://github.com/hashicorp/terraform-provider-google/issues) for an open issue that this either resolves or contributes to, commented on it to claim it, and written "fixes {url}" or "part of {url}" in this PR description. If there were no relevant open issues, I opened one and commented that I would like to work on it (not necessary for very small changes).
- [ ] [Generated Terraform](https://github.com/GoogleCloudPlatform/magic-modules#generating-the-terraform-providers), and ran `make test` and `make lint` to ensure it passes unit and linter tests.
- [ ] Ensured that all new fields I added that can be set by a user appear in at least one [example](https://github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/templates/terraform/examples) (for generated resources) or [third_party test](https://github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/third_party/terraform/tests) (for handwritten resources or update tests).
- [ ] [Ran](https://github.com/hashicorp/terraform-provider-google/blob/main/.github/CONTRIBUTING.md#tests) relevant acceptance tests (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
- [X] Read the [Release Notes Guide](https://github.com/GoogleCloudPlatform/magic-modules/blob/main/.ci/RELEASE_NOTES_GUIDE.md) before writing my release note below.

<!-- AUTOCHANGELOG for Downstream PRs.

Please select one of the following "release-note:" headings:
    - release-note:enhancement
    - release-note:bug
    - release-note:note
    - release-note:new-resource
    - release-note:new-datasource
    - release-note:deprecation
    - release-note:breaking-change
    - release-note:none
    
Unless you choose release-note:none, please add a release note.

See .ci/RELEASE_NOTES_GUIDE.md for writing good release notes.

You can add more release note blocks if you want more than one CHANGELOG
entry for this PR.
-->
**Release Note Template for Downstream PRs (will be copied)**

```release-note:none

```

Derived from https://github.com/GoogleCloudPlatform/magic-modules/pull/6390


Patch:
diff --git a/converters/google/resources/compute_backend_service_iam.go b/converters/google/resources/compute_backend_service_iam.go
index 40644aab..be854e41 100644
--- a/converters/google/resources/compute_backend_service_iam.go
+++ b/converters/google/resources/compute_backend_service_iam.go
@@ -90,7 +90,7 @@ func newComputeBackendServiceIamAsset(
 		return []Asset{}, fmt.Errorf("expanding bindings: %v", err)
 	}
 
-	name, err := assetName(d, config, "//compute.googleapis.com/projects/{{project}}/global/backendServices/{{backendservice}}")
+	name, err := assetName(d, config, "//compute.googleapis.com/projects/{{project}}/global/backendServices/{{name}}")
 	if err != nil {
 		return []Asset{}, err
 	}
@@ -114,7 +114,7 @@ func FetchComputeBackendServiceIamPolicy(d TerraformResourceData, config *Config
 		ComputeBackendServiceIamUpdaterProducer,
 		d,
 		config,
-		"//compute.googleapis.com/projects/{{project}}/global/backendServices/{{backendservice}}",
+		"//compute.googleapis.com/projects/{{project}}/global/backendServices/{{name}}",
 		ComputeBackendServiceIAMAssetType,
 	)
 }
diff --git a/converters/google/resources/compute_instance_iam.go b/converters/google/resources/compute_instance_iam.go
index ef621fa2..2adc83bf 100644
--- a/converters/google/resources/compute_instance_iam.go
+++ b/converters/google/resources/compute_instance_iam.go
@@ -90,7 +90,7 @@ func newComputeInstanceIamAsset(
 		return []Asset{}, fmt.Errorf("expanding bindings: %v", err)
 	}
 
-	name, err := assetName(d, config, "//compute.googleapis.com/projects/{{project}}/zones/{{zone}}/instances/{{instance}}")
+	name, err := assetName(d, config, "//compute.googleapis.com/projects/{{project}}/zones/{{zone}}/instances/{{instance_name}}")
 	if err != nil {
 		return []Asset{}, err
 	}
@@ -117,7 +117,7 @@ func FetchComputeInstanceIamPolicy(d TerraformResourceData, config *Config) (Ass
 		ComputeInstanceIamUpdaterProducer,
 		d,
 		config,
-		"//compute.googleapis.com/projects/{{project}}/zones/{{zone}}/instances/{{instance}}",
+		"//compute.googleapis.com/projects/{{project}}/zones/{{zone}}/instances/{{instance_name}}",
 		ComputeInstanceIAMAssetType,
 	)
 }
diff --git a/converters/google/resources/compute_region_backend_service_iam.go b/converters/google/resources/compute_region_backend_service_iam.go
index 053022e2..ee1ca008 100644
--- a/converters/google/resources/compute_region_backend_service_iam.go
+++ b/converters/google/resources/compute_region_backend_service_iam.go
@@ -90,7 +90,7 @@ func newComputeRegionBackendServiceIamAsset(
 		return []Asset{}, fmt.Errorf("expanding bindings: %v", err)
 	}
 
-	name, err := assetName(d, config, "//compute.googleapis.com/projects/{{project}}/regions/{{region}}/backendServices/{{regionbackendservice}}")
+	name, err := assetName(d, config, "//compute.googleapis.com/projects/{{project}}/regions/{{region}}/backendServices/{{name}}")
 	if err != nil {
 		return []Asset{}, err
 	}
@@ -117,7 +117,7 @@ func FetchComputeRegionBackendServiceIamPolicy(d TerraformResourceData, config *
 		ComputeRegionBackendServiceIamUpdaterProducer,
 		d,
 		config,
-		"//compute.googleapis.com/projects/{{project}}/regions/{{region}}/backendServices/{{regionbackendservice}}",
+		"//compute.googleapis.com/projects/{{project}}/regions/{{region}}/backendServices/{{name}}",
 		ComputeRegionBackendServiceIAMAssetType,
 	)
 }
diff --git a/converters/google/resources/privateca_certificate_template_iam.go b/converters/google/resources/privateca_certificate_template_iam.go
index 48a03d98..34ac4008 100644
--- a/converters/google/resources/privateca_certificate_template_iam.go
+++ b/converters/google/resources/privateca_certificate_template_iam.go
@@ -90,7 +90,7 @@ func newPrivatecaCertificateTemplateIamAsset(
 		return []Asset{}, fmt.Errorf("expanding bindings: %v", err)
 	}
 
-	name, err := assetName(d, config, "//privateca.googleapis.com/projects/{{project}}/locations/{{location}}/certificateTemplates/{{name}}/{{certificatetemplate}}")
+	name, err := assetName(d, config, "//privateca.googleapis.com/projects/{{project}}/locations/{{location}}/certificateTemplates/{{name}}/{{certificate_template}}")
 	if err != nil {
 		return []Asset{}, err
 	}
@@ -117,7 +117,7 @@ func FetchPrivatecaCertificateTemplateIamPolicy(d TerraformResourceData, config
 		PrivatecaCertificateTemplateIamUpdaterProducer,
 		d,
 		config,
-		"//privateca.googleapis.com/projects/{{project}}/locations/{{location}}/certificateTemplates/{{name}}/{{certificatetemplate}}",
+		"//privateca.googleapis.com/projects/{{project}}/locations/{{location}}/certificateTemplates/{{name}}/{{certificate_template}}",
 		PrivatecaCertificateTemplateIAMAssetType,
 	)
 }


Test patch:
diff --git a/test/cli_test.go b/test/cli_test.go
index 7c5bc713..404ac71c 100644
--- a/test/cli_test.go
+++ b/test/cli_test.go
@@ -90,6 +90,9 @@ func TestCLI(t *testing.T) {
 		{name: "example_compute_firewall"},
 		{name: "example_compute_global_address"},
 		{name: "example_compute_global_forwarding_rule"},
+		{name: "example_compute_instance_iam_binding"},
+		{name: "example_compute_instance_iam_member"},
+		{name: "example_compute_instance_iam_policy"},
 		{name: "example_compute_network"},
 		{name: "example_compute_security_policy"},
 		{name: "example_compute_snapshot"},
diff --git a/test/read_test.go b/test/read_test.go
index 0a0be135..981abe4c 100644
--- a/test/read_test.go
+++ b/test/read_test.go
@@ -52,6 +52,9 @@ func TestReadPlannedAssetsCoverage(t *testing.T) {
 		{name: "example_compute_firewall"},
 		{name: "example_compute_global_address"},
 		{name: "example_compute_global_forwarding_rule"},
+		{name: "example_compute_instance_iam_binding"},
+		{name: "example_compute_instance_iam_member"},
+		{name: "example_compute_instance_iam_policy"},
 		{name: "example_compute_network"},
 		{name: "example_compute_security_policy"},
 		{name: "example_compute_snapshot"},
diff --git a/testdata/templates/example_compute_instance_iam_binding.json b/testdata/templates/example_compute_instance_iam_binding.json
new file mode 100644
index 00000000..10804711
--- /dev/null
+++ b/testdata/templates/example_compute_instance_iam_binding.json
@@ -0,0 +1,75 @@
+[
+  {
+    "name": "//compute.googleapis.com/projects/{{.Provider.project}}/zones/us-central1-a/instances/test",
+    "asset_type": "compute.googleapis.com/Instance",
+    "ancestry_path": "{{.Ancestry}}/project/{{.Provider.project}}",
+    "resource": {
+      "version": "v1",
+      "discovery_document_uri": "https://www.googleapis.com/discovery/v1/apis/compute/v1/rest",
+      "discovery_name": "Instance",
+      "parent": "//cloudresourcemanager.googleapis.com/projects/{{.Provider.project}}",
+      "data": {
+        "canIpForward": false,
+        "deletionProtection": false,
+        "disks": [
+          {
+            "autoDelete": true,
+            "boot": true,
+            "initializeParams": {
+              "sourceImage": "projects/debian-cloud/global/images/debian-11"
+            },
+            "mode": "READ_WRITE"
+          },
+          {
+            "autoDelete": true,
+            "initializeParams": {
+              "diskType": "projects/{{.Provider.project}}/zones/us-central1-a/diskTypes/local-ssd"
+            },
+            "interface": "SCSI",
+            "type": "SCRATCH"
+          }
+        ],
+        "machineType": "projects/{{.Provider.project}}/zones/us-central1-a/machineTypes/n1-standard-1",
+        "metadata": {
+          "items": [
+            {
+              "key": "foo",
+              "value": "bar"
+            }
+          ]
+        },
+        "name": "test",
+        "networkInterfaces": [
+          {
+            "accessConfigs": [
+              {
+                "type": "ONE_TO_ONE_NAT"
+              }
+            ],
+            "network": "projects/{{.Provider.project}}/global/networks/default"
+          }
+        ],
+        "scheduling": {
+          "automaticRestart": true
+        },
+        "tags": {
+          "items": [
+            "bar",
+            "foo"
+          ]
+        }
+      }
+    },
+    "iam_policy": {
+      "bindings": [
+        {
+          "role": "roles/compute.osLogin",
+          "members": [
+            "user:example-b@google.com",
+            "user:example-a@google.com"
+          ]
+        }
+      ]
+    }
+  }
+]
diff --git a/testdata/templates/example_compute_instance_iam_binding.tf b/testdata/templates/example_compute_instance_iam_binding.tf
new file mode 100644
index 00000000..7fb6248d
--- /dev/null
+++ b/testdata/templates/example_compute_instance_iam_binding.tf
@@ -0,0 +1,72 @@
+/**
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+terraform {
+  required_providers {
+    google = {
+      source = "hashicorp/google"
+      version = "~> {{.Provider.version}}"
+    }
+  }
+}
+
+provider "google" {
+  {{if .Provider.credentials }}credentials = "{{.Provider.credentials}}"{{end}}
+}
+
+resource "google_compute_instance" "default" {
+  name         = "test"
+  machine_type = "n1-standard-1"
+  zone         = "us-central1-a"
+
+  tags = ["foo", "bar"]
+
+  boot_disk {
+    initialize_params {
+      image = "projects/debian-cloud/global/images/debian-11"
+    }
+  }
+
+  // Local SSD disk
+  scratch_disk {
+    interface = "SCSI"
+  }
+
+  network_interface {
+    network = "default"
+
+    access_config {
+      // Ephemeral IP
+    }
+  }
+
+  metadata = {
+    foo = "bar"
+  }
+}
+
+resource "google_compute_instance_iam_binding" "editor" {
+  project = google_compute_instance.default.project
+  zone = google_compute_instance.default.zone
+  instance_name = google_compute_instance.default.name
+  role    = "roles/compute.osLogin"
+  members  = [
+    "user:example-a@google.com",
+    "user:example-b@google.com"
+  ]
+}
+
+
diff --git a/testdata/templates/example_compute_instance_iam_binding.tfplan.json b/testdata/templates/example_compute_instance_iam_binding.tfplan.json
new file mode 100644
index 00000000..ceaf763b
--- /dev/null
+++ b/testdata/templates/example_compute_instance_iam_binding.tfplan.json
@@ -0,0 +1,451 @@
+{
+  "format_version": "0.2",
+  "terraform_version": "1.0.10",
+  "planned_values": {
+    "root_module": {
+      "resources": [
+        {
+          "address": "google_compute_instance.default",
+          "mode": "managed",
+          "type": "google_compute_instance",
+          "name": "default",
+          "provider_name": "registry.terraform.io/hashicorp/google",
+          "schema_version": 6,
+          "values": {
+            "advanced_machine_features": [],
+            "allow_stopping_for_update": null,
+            "attached_disk": [],
+            "boot_disk": [
+              {
+                "auto_delete": true,
+                "disk_encryption_key_raw": null,
+                "initialize_params": [
+                  {
+                    "image": "projects/debian-cloud/global/images/debian-11"
+                  }
+                ],
+                "mode": "READ_WRITE"
+              }
+            ],
+            "can_ip_forward": false,
+            "deletion_protection": false,
+            "description": null,
+            "desired_status": null,
+            "enable_display": null,
+            "hostname": null,
+            "labels": null,
+            "machine_type": "n1-standard-1",
+            "metadata": {
+              "foo": "bar"
+            },
+            "metadata_startup_script": null,
+            "name": "test",
+            "network_interface": [
+              {
+                "access_config": [
+                  {
+                    "public_ptr_domain_name": null
+                  }
+                ],
+                "alias_ip_range": [],
+                "ipv6_access_config": [],
+                "network": "default",
+                "nic_type": null,
+                "queue_count": null
+              }
+            ],
+            "resource_policies": null,
+            "scratch_disk": [
+              {
+                "interface": "SCSI"
+              }
+            ],
+            "service_account": [],
+            "shielded_instance_config": [],
+            "tags": [
+              "bar",
+              "foo"
+            ],
+            "timeouts": null,
+            "zone": "us-central1-a"
+          },
+          "sensitive_values": {
+            "advanced_machine_features": [],
+            "attached_disk": [],
+            "boot_disk": [
+              {
+                "initialize_params": [
+                  {
+                    "labels": {}
+                  }
+                ]
+              }
+            ],
+            "confidential_instance_config": [],
+            "guest_accelerator": [],
+            "metadata": {},
+            "network_interface": [
+              {
+                "access_config": [
+                  {}
+                ],
+                "alias_ip_range": [],
+                "ipv6_access_config": []
+              }
+            ],
+            "reservation_affinity": [],
+            "scheduling": [],
+            "scratch_disk": [
+              {}
+            ],
+            "service_account": [],
+            "shielded_instance_config": [],
+            "tags": [
+              false,
+              false
+            ]
+          }
+        },
+        {
+          "address": "google_compute_instance_iam_binding.editor",
+          "mode": "managed",
+          "type": "google_compute_instance_iam_binding",
+          "name": "editor",
+          "provider_name": "registry.terraform.io/hashicorp/google",
+          "schema_version": 0,
+          "values": {
+            "condition": [],
+            "instance_name": "test",
+            "members": [
+              "user:example-a@google.com",
+              "user:example-b@google.com"
+            ],
+            "role": "roles/compute.osLogin",
+            "zone": "us-central1-a"
+          },
+          "sensitive_values": {
+            "condition": [],
+            "members": [
+              false,
+              false
+            ]
+          }
+        }
+      ]
+    }
+  },
+  "resource_changes": [
+    {
+      "address": "google_compute_instance.default",
+      "mode": "managed",
+      "type": "google_compute_instance",
+      "name": "default",
+      "provider_name": "registry.terraform.io/hashicorp/google",
+      "change": {
+        "actions": [
+          "create"
+        ],
+        "before": null,
+        "after": {
+          "advanced_machine_features": [],
+          "allow_stopping_for_update": null,
+          "attached_disk": [],
+          "boot_disk": [
+            {
+              "auto_delete": true,
+              "disk_encryption_key_raw": null,
+              "initialize_params": [
+                {
+                  "image": "projects/debian-cloud/global/images/debian-11"
+                }
+              ],
+              "mode": "READ_WRITE"
+            }
+          ],
+          "can_ip_forward": false,
+          "deletion_protection": false,
+          "description": null,
+          "desired_status": null,
+          "enable_display": null,
+          "hostname": null,
+          "labels": null,
+          "machine_type": "n1-standard-1",
+          "metadata": {
+            "foo": "bar"
+          },
+          "metadata_startup_script": null,
+          "name": "test",
+          "network_interface": [
+            {
+              "access_config": [
+                {
+                  "public_ptr_domain_name": null
+                }
+              ],
+              "alias_ip_range": [],
+              "ipv6_access_config": [],
+              "network": "default",
+              "nic_type": null,
+              "queue_count": null
+            }
+          ],
+          "resource_policies": null,
+          "scratch_disk": [
+            {
+              "interface": "SCSI"
+            }
+          ],
+          "service_account": [],
+          "shielded_instance_config": [],
+          "tags": [
+            "bar",
+            "foo"
+          ],
+          "timeouts": null,
+          "zone": "us-central1-a"
+        },
+        "after_unknown": {
+          "advanced_machine_features": [],
+          "attached_disk": [],
+          "boot_disk": [
+            {
+              "device_name": true,
+              "disk_encryption_key_sha256": true,
+              "initialize_params": [
+                {
+                  "labels": true,
+                  "size": true,
+                  "type": true
+                }
+              ],
+              "kms_key_self_link": true,
+              "source": true
+            }
+          ],
+          "confidential_instance_config": true,
+          "cpu_platform": true,
+          "current_status": true,
+          "guest_accelerator": true,
+          "id": true,
+          "instance_id": true,
+          "label_fingerprint": true,
+          "metadata": {},
+          "metadata_fingerprint": true,
+          "min_cpu_platform": true,
+          "network_interface": [
+            {
+              "access_config": [
+                {
+                  "nat_ip": true,
+                  "network_tier": true
+                }
+              ],
+              "alias_ip_range": [],
+              "ipv6_access_config": [],
+              "ipv6_access_type": true,
+              "name": true,
+              "network_ip": true,
+              "stack_type": true,
+              "subnetwork": true,
+              "subnetwork_project": true
+            }
+          ],
+          "project": true,
+          "reservation_affinity": true,
+          "scheduling": true,
+          "scratch_disk": [
+            {}
+          ],
+          "self_link": true,
+          "service_account": [],
+          "shielded_instance_config": [],
+          "tags": [
+            false,
+            false
+          ],
+          "tags_fingerprint": true
+        },
+        "before_sensitive": false,
+        "after_sensitive": {
+          "advanced_machine_features": [],
+          "attached_disk": [],
+          "boot_disk": [
+            {
+              "disk_encryption_key_raw": true,
+              "initialize_params": [
+                {
+                  "labels": {}
+                }
+              ]
+            }
+          ],
+          "confidential_instance_config": [],
+          "guest_accelerator": [],
+          "metadata": {},
+          "network_interface": [
+            {
+              "access_config": [
+                {}
+              ],
+              "alias_ip_range": [],
+              "ipv6_access_config": []
+            }
+          ],
+          "reservation_affinity": [],
+          "scheduling": [],
+          "scratch_disk": [
+            {}
+          ],
+          "service_account": [],
+          "shielded_instance_config": [],
+          "tags": [
+            false,
+            false
+          ]
+        }
+      }
+    },
+    {
+      "address": "google_compute_instance_iam_binding.editor",
+      "mode": "managed",
+      "type": "google_compute_instance_iam_binding",
+      "name": "editor",
+      "provider_name": "registry.terraform.io/hashicorp/google",
+      "change": {
+        "actions": [
+          "create"
+        ],
+        "before": null,
+        "after": {
+          "condition": [],
+          "instance_name": "test",
+          "members": [
+            "user:example-a@google.com",
+            "user:example-b@google.com"
+          ],
+          "role": "roles/compute.osLogin",
+          "zone": "us-central1-a"
+        },
+        "after_unknown": {
+          "condition": [],
+          "etag": true,
+          "id": true,
+          "members": [
+            false,
+            false
+          ],
+          "project": true
+        },
+        "before_sensitive": false,
+        "after_sensitive": {
+          "condition": [],
+          "members": [
+            false,
+            false
+          ]
+        }
+      }
+    }
+  ],
+  "configuration": {
+    "root_module": {
+      "resources": [
+        {
+          "address": "google_compute_instance.default",
+          "mode": "managed",
+          "type": "google_compute_instance",
+          "name": "default",
+          "provider_config_key": "google",
+          "expressions": {
+            "boot_disk": [
+              {
+                "initialize_params": [
+                  {
+                    "image": {
+                      "constant_value": "projects/debian-cloud/global/images/debian-11"
+                    }
+                  }
+                ]
+              }
+            ],
+            "machine_type": {
+              "constant_value": "n1-standard-1"
+            },
+            "metadata": {
+              "constant_value": {
+                "foo": "bar"
+              }
+            },
+            "name": {
+              "constant_value": "test"
+            },
+            "network_interface": [
+              {
+                "access_config": [
+                  {}
+                ],
+                "network": {
+                  "constant_value": "default"
+                }
+              }
+            ],
+            "scratch_disk": [
+              {
+                "interface": {
+                  "constant_value": "SCSI"
+                }
+              }
+            ],
+            "tags": {
+              "constant_value": [
+                "foo",
+                "bar"
+              ]
+            },
+            "zone": {
+              "constant_value": "us-central1-a"
+            }
+          },
+          "schema_version": 6
+        },
+        {
+          "address": "google_compute_instance_iam_binding.editor",
+          "mode": "managed",
+          "type": "google_compute_instance_iam_binding",
+          "name": "editor",
+          "provider_config_key": "google",
+          "expressions": {
+            "instance_name": {
+              "references": [
+                "google_compute_instance.default.name",
+                "google_compute_instance.default"
+              ]
+            },
+            "members": {
+              "constant_value": [
+                "user:example-a@google.com",
+                "user:example-b@google.com"
+              ]
+            },
+            "project": {
+              "references": [
+                "google_compute_instance.default.project",
+                "google_compute_instance.default"
+              ]
+            },
+            "role": {
+              "constant_value": "roles/compute.osLogin"
+            },
+            "zone": {
+              "references": [
+                "google_compute_instance.default.zone",
+                "google_compute_instance.default"
+              ]
+            }
+          },
+          "schema_version": 0
+        }
+      ]
+    }
+  }
+}
diff --git a/testdata/templates/example_compute_instance_iam_member.json b/testdata/templates/example_compute_instance_iam_member.json
new file mode 100644
index 00000000..40cbd296
--- /dev/null
+++ b/testdata/templates/example_compute_instance_iam_member.json
@@ -0,0 +1,74 @@
+[
+  {
+    "name": "//compute.googleapis.com/projects/{{.Provider.project}}/zones/us-central1-a/instances/test",
+    "asset_type": "compute.googleapis.com/Instance",
+    "ancestry_path": "{{.Ancestry}}/project/{{.Provider.project}}",
+    "resource": {
+      "version": "v1",
+      "discovery_document_uri": "https://www.googleapis.com/discovery/v1/apis/compute/v1/rest",
+      "discovery_name": "Instance",
+      "parent": "//cloudresourcemanager.googleapis.com/projects/{{.Provider.project}}",
+      "data": {
+        "canIpForward": false,
+        "deletionProtection": false,
+        "disks": [
+          {
+            "autoDelete": true,
+            "boot": true,
+            "initializeParams": {
+              "sourceImage": "projects/debian-cloud/global/images/debian-11"
+            },
+            "mode": "READ_WRITE"
+          },
+          {
+            "autoDelete": true,
+            "initializeParams": {
+              "diskType": "projects/{{.Provider.project}}/zones/us-central1-a/diskTypes/local-ssd"
+            },
+            "interface": "SCSI",
+            "type": "SCRATCH"
+          }
+        ],
+        "machineType": "projects/{{.Provider.project}}/zones/us-central1-a/machineTypes/n1-standard-1",
+        "metadata": {
+          "items": [
+            {
+              "key": "foo",
+              "value": "bar"
+            }
+          ]
+        },
+        "name": "test",
+        "networkInterfaces": [
+          {
+            "accessConfigs": [
+              {
+                "type": "ONE_TO_ONE_NAT"
+              }
+            ],
+            "network": "projects/{{.Provider.project}}/global/networks/default"
+          }
+        ],
+        "scheduling": {
+          "automaticRestart": true
+        },
+        "tags": {
+          "items": [
+            "bar",
+            "foo"
+          ]
+        }
+      }
+    },
+    "iam_policy": {
+      "bindings": [
+        {
+          "role": "roles/compute.osLogin",
+          "members": [
+            "user:example-a@google.com"
+          ]
+        }
+      ]
+    }
+  }
+]
diff --git a/testdata/templates/example_compute_instance_iam_member.tf b/testdata/templates/example_compute_instance_iam_member.tf
new file mode 100644
index 00000000..0da674be
--- /dev/null
+++ b/testdata/templates/example_compute_instance_iam_member.tf
@@ -0,0 +1,69 @@
+/**
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+terraform {
+  required_providers {
+    google = {
+      source = "hashicorp/google"
+      version = "~> {{.Provider.version}}"
+    }
+  }
+}
+
+provider "google" {
+  {{if .Provider.credentials }}credentials = "{{.Provider.credentials}}"{{end}}
+}
+
+resource "google_compute_instance" "default" {
+  name         = "test"
+  machine_type = "n1-standard-1"
+  zone         = "us-central1-a"
+
+  tags = ["foo", "bar"]
+
+  boot_disk {
+    initialize_params {
+      image = "projects/debian-cloud/global/images/debian-11"
+    }
+  }
+
+  // Local SSD disk
+  scratch_disk {
+    interface = "SCSI"
+  }
+
+  network_interface {
+    network = "default"
+
+    access_config {
+      // Ephemeral IP
+    }
+  }
+
+  metadata = {
+    foo = "bar"
+  }
+}
+
+resource "google_compute_instance_iam_member" "viewer" {
+  project = google_compute_instance.default.project
+  zone = google_compute_instance.default.zone
+  instance_name = google_compute_instance.default.name
+  role    = "roles/compute.osLogin"
+  member  = "user:example-a@google.com"
+}
+
+
diff --git a/testdata/templates/example_compute_instance_iam_member.tfplan.json b/testdata/templates/example_compute_instance_iam_member.tfplan.json
new file mode 100644
index 00000000..a49081af
--- /dev/null
+++ b/testdata/templates/example_compute_instance_iam_member.tfplan.json
@@ -0,0 +1,430 @@
+{
+  "format_version": "0.2",
+  "terraform_version": "1.0.10",
+  "planned_values": {
+    "root_module": {
+      "resources": [
+        {
+          "address": "google_compute_instance.default",
+          "mode": "managed",
+          "type": "google_compute_instance",
+          "name": "default",
+          "provider_name": "registry.terraform.io/hashicorp/google",
+          "schema_version": 6,
+          "values": {
+            "advanced_machine_features": [],
+            "allow_stopping_for_update": null,
+            "attached_disk": [],
+            "boot_disk": [
+              {
+                "auto_delete": true,
+                "disk_encryption_key_raw": null,
+                "initialize_params": [
+                  {
+                    "image": "projects/debian-cloud/global/images/debian-11"
+                  }
+                ],
+                "mode": "READ_WRITE"
+              }
+            ],
+            "can_ip_forward": false,
+            "deletion_protection": false,
+            "description": null,
+            "desired_status": null,
+            "enable_display": null,
+            "hostname": null,
+            "labels": null,
+            "machine_type": "n1-standard-1",
+            "metadata": {
+              "foo": "bar"
+            },
+            "metadata_startup_script": null,
+            "name": "test",
+            "network_interface": [
+              {
+                "access_config": [
+                  {
+                    "public_ptr_domain_name": null
+                  }
+                ],
+                "alias_ip_range": [],
+                "ipv6_access_config": [],
+                "network": "default",
+                "nic_type": null,
+                "queue_count": null
+              }
+            ],
+            "resource_policies": null,
+            "scratch_disk": [
+              {
+                "interface": "SCSI"
+              }
+            ],
+            "service_account": [],
+            "shielded_instance_config": [],
+            "tags": [
+              "bar",
+              "foo"
+            ],
+            "timeouts": null,
+            "zone": "us-central1-a"
+          },
+          "sensitive_values": {
+            "advanced_machine_features": [],
+            "attached_disk": [],
+            "boot_disk": [
+              {
+                "initialize_params": [
+                  {
+                    "labels": {}
+                  }
+                ]
+              }
+            ],
+            "confidential_instance_config": [],
+            "guest_accelerator": [],
+            "metadata": {},
+            "network_interface": [
+              {
+                "access_config": [
+                  {}
+                ],
+                "alias_ip_range": [],
+                "ipv6_access_config": []
+              }
+            ],
+            "reservation_affinity": [],
+            "scheduling": [],
+            "scratch_disk": [
+              {}
+            ],
+            "service_account": [],
+            "shielded_instance_config": [],
+            "tags": [
+              false,
+              false
+            ]
+          }
+        },
+        {
+          "address": "google_compute_instance_iam_member.viewer",
+          "mode": "managed",
+          "type": "google_compute_instance_iam_member",
+          "name": "viewer",
+          "provider_name": "registry.terraform.io/hashicorp/google",
+          "schema_version": 0,
+          "values": {
+            "condition": [],
+            "instance_name": "test",
+            "member": "user:example-a@google.com",
+            "role": "roles/compute.osLogin",
+            "zone": "us-central1-a"
+          },
+          "sensitive_values": {
+            "condition": []
+          }
+        }
+      ]
+    }
+  },
+  "resource_changes": [
+    {
+      "address": "google_compute_instance.default",
+      "mode": "managed",
+      "type": "google_compute_instance",
+      "name": "default",
+      "provider_name": "registry.terraform.io/hashicorp/google",
+      "change": {
+        "actions": [
+          "create"
+        ],
+        "before": null,
+        "after": {
+          "advanced_machine_features": [],
+          "allow_stopping_for_update": null,
+          "attached_disk": [],
+          "boot_disk": [
+            {
+              "auto_delete": true,
+              "disk_encryption_key_raw": null,
+              "initialize_params": [
+                {
+                  "image": "projects/debian-cloud/global/images/debian-11"
+                }
+              ],
+              "mode": "READ_WRITE"
+            }
+          ],
+          "can_ip_forward": false,
+          "deletion_protection": false,
+          "description": null,
+          "desired_status": null,
+          "enable_display": null,
+          "hostname": null,
+          "labels": null,
+          "machine_type": "n1-standard-1",
+          "metadata": {
+            "foo": "bar"
+          },
+          "metadata_startup_script": null,
+          "name": "test",
+          "network_interface": [
+            {
+              "access_config": [
+                {
+                  "public_ptr_domain_name": null
+                }
+              ],
+              "alias_ip_range": [],
+              "ipv6_access_config": [],
+              "network": "default",
+              "nic_type": null,
+              "queue_count": null
+            }
+          ],
+          "resource_policies": null,
+          "scratch_disk": [
+            {
+              "interface": "SCSI"
+            }
+          ],
+          "service_account": [],
+          "shielded_instance_config": [],
+          "tags": [
+            "bar",
+            "foo"
+          ],
+          "timeouts": null,
+          "zone": "us-central1-a"
+        },
+        "after_unknown": {
+          "advanced_machine_features": [],
+          "attached_disk": [],
+          "boot_disk": [
+            {
+              "device_name": true,
+              "disk_encryption_key_sha256": true,
+              "initialize_params": [
+                {
+                  "labels": true,
+                  "size": true,
+                  "type": true
+                }
+              ],
+              "kms_key_self_link": true,
+              "source": true
+            }
+          ],
+          "confidential_instance_config": true,
+          "cpu_platform": true,
+          "current_status": true,
+          "guest_accelerator": true,
+          "id": true,
+          "instance_id": true,
+          "label_fingerprint": true,
+          "metadata": {},
+          "metadata_fingerprint": true,
+          "min_cpu_platform": true,
+          "network_interface": [
+            {
+              "access_config": [
+                {
+                  "nat_ip": true,
+                  "network_tier": true
+                }
+              ],
+              "alias_ip_range": [],
+              "ipv6_access_config": [],
+              "ipv6_access_type": true,
+              "name": true,
+              "network_ip": true,
+              "stack_type": true,
+              "subnetwork": true,
+              "subnetwork_project": true
+            }
+          ],
+          "project": true,
+          "reservation_affinity": true,
+          "scheduling": true,
+          "scratch_disk": [
+            {}
+          ],
+          "self_link": true,
+          "service_account": [],
+          "shielded_instance_config": [],
+          "tags": [
+            false,
+            false
+          ],
+          "tags_fingerprint": true
+        },
+        "before_sensitive": false,
+        "after_sensitive": {
+          "advanced_machine_features": [],
+          "attached_disk": [],
+          "boot_disk": [
+            {
+              "disk_encryption_key_raw": true,
+              "initialize_params": [
+                {
+                  "labels": {}
+                }
+              ]
+            }
+          ],
+          "confidential_instance_config": [],
+          "guest_accelerator": [],
+          "metadata": {},
+          "network_interface": [
+            {
+              "access_config": [
+                {}
+              ],
+              "alias_ip_range": [],
+              "ipv6_access_config": []
+            }
+          ],
+          "reservation_affinity": [],
+          "scheduling": [],
+          "scratch_disk": [
+            {}
+          ],
+          "service_account": [],
+          "shielded_instance_config": [],
+          "tags": [
+            false,
+            false
+          ]
+        }
+      }
+    },
+    {
+      "address": "google_compute_instance_iam_member.viewer",
+      "mode": "managed",
+      "type": "google_compute_instance_iam_member",
+      "name": "viewer",
+      "provider_name": "registry.terraform.io/hashicorp/google",
+      "change": {
+        "actions": [
+          "create"
+        ],
+        "before": null,
+        "after": {
+          "condition": [],
+          "instance_name": "test",
+          "member": "user:example-a@google.com",
+          "role": "roles/compute.osLogin",
+          "zone": "us-central1-a"
+        },
+        "after_unknown": {
+          "condition": [],
+          "etag": true,
+          "id": true,
+          "project": true
+        },
+        "before_sensitive": false,
+        "after_sensitive": {
+          "condition": []
+        }
+      }
+    }
+  ],
+  "configuration": {
+    "root_module": {
+      "resources": [
+        {
+          "address": "google_compute_instance.default",
+          "mode": "managed",
+          "type": "google_compute_instance",
+          "name": "default",
+          "provider_config_key": "google",
+          "expressions": {
+            "boot_disk": [
+              {
+                "initialize_params": [
+                  {
+                    "image": {
+                      "constant_value": "projects/debian-cloud/global/images/debian-11"
+                    }
+                  }
+                ]
+              }
+            ],
+            "machine_type": {
+              "constant_value": "n1-standard-1"
+            },
+            "metadata": {
+              "constant_value": {
+                "foo": "bar"
+              }
+            },
+            "name": {
+              "constant_value": "test"
+            },
+            "network_interface": [
+              {
+                "access_config": [
+                  {}
+                ],
+                "network": {
+                  "constant_value": "default"
+                }
+              }
+            ],
+            "scratch_disk": [
+              {
+                "interface": {
+                  "constant_value": "SCSI"
+                }
+              }
+            ],
+            "tags": {
+              "constant_value": [
+                "foo",
+                "bar"
+              ]
+            },
+            "zone": {
+              "constant_value": "us-central1-a"
+            }
+          },
+          "schema_version": 6
+        },
+        {
+          "address": "google_compute_instance_iam_member.viewer",
+          "mode": "managed",
+          "type": "google_compute_instance_iam_member",
+          "name": "viewer",
+          "provider_config_key": "google",
+          "expressions": {
+            "instance_name": {
+              "references": [
+                "google_compute_instance.default.name",
+                "google_compute_instance.default"
+              ]
+            },
+            "member": {
+              "constant_value": "user:example-a@google.com"
+            },
+            "project": {
+              "references": [
+                "google_compute_instance.default.project",
+                "google_compute_instance.default"
+              ]
+            },
+            "role": {
+              "constant_value": "roles/compute.osLogin"
+            },
+            "zone": {
+              "references": [
+                "google_compute_instance.default.zone",
+                "google_compute_instance.default"
+              ]
+            }
+          },
+          "schema_version": 0
+        }
+      ]
+    }
+  }
+}
diff --git a/testdata/templates/example_compute_instance_iam_policy.json b/testdata/templates/example_compute_instance_iam_policy.json
new file mode 100644
index 00000000..4b009a2f
--- /dev/null
+++ b/testdata/templates/example_compute_instance_iam_policy.json
@@ -0,0 +1,74 @@
+[
+  {
+    "name": "//compute.googleapis.com/projects/{{.Provider.project}}/zones/us-central1-a/instances/test",
+    "asset_type": "compute.googleapis.com/Instance",
+    "ancestry_path": "{{.Ancestry}}/project/{{.Provider.project}}",
+    "resource": {
+      "version": "v1",
+      "discovery_document_uri": "https://www.googleapis.com/discovery/v1/apis/compute/v1/rest",
+      "discovery_name": "Instance",
+      "parent": "//cloudresourcemanager.googleapis.com/projects/{{.Provider.project}}",
+      "data": {
+        "canIpForward": false,
+        "deletionProtection": false,
+        "disks": [
+          {
+            "autoDelete": true,
+            "boot": true,
+            "initializeParams": {
+              "sourceImage": "projects/debian-cloud/global/images/debian-11"
+            },
+            "mode": "READ_WRITE"
+          },
+          {
+            "autoDelete": true,
+            "initializeParams": {
+              "diskType": "projects/{{.Provider.project}}/zones/us-central1-a/diskTypes/local-ssd"
+            },
+            "interface": "SCSI",
+            "type": "SCRATCH"
+          }
+        ],
+        "machineType": "projects/{{.Provider.project}}/zones/us-central1-a/machineTypes/n1-standard-1",
+        "metadata": {
+          "items": [
+            {
+              "key": "foo",
+              "value": "bar"
+            }
+          ]
+        },
+        "name": "test",
+        "networkInterfaces": [
+          {
+            "accessConfigs": [
+              {
+                "type": "ONE_TO_ONE_NAT"
+              }
+            ],
+            "network": "projects/{{.Provider.project}}/global/networks/default"
+          }
+        ],
+        "scheduling": {
+          "automaticRestart": true
+        },
+        "tags": {
+          "items": [
+            "bar",
+            "foo"
+          ]
+        }
+      }
+    },
+    "iam_policy": {
+      "bindings": [
+        {
+          "role": "roles/compute.osLogin",
+          "members": [
+            "user:jane@example.com"
+          ]
+        }
+      ]
+    }
+  }
+]
diff --git a/testdata/templates/example_compute_instance_iam_policy.tf b/testdata/templates/example_compute_instance_iam_policy.tf
new file mode 100644
index 00000000..c6db287a
--- /dev/null
+++ b/testdata/templates/example_compute_instance_iam_policy.tf
@@ -0,0 +1,77 @@
+/**
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+terraform {
+  required_providers {
+    google = {
+      source = "hashicorp/google"
+      version = "~> {{.Provider.version}}"
+    }
+  }
+}
+
+provider "google" {
+  {{if .Provider.credentials }}credentials = "{{.Provider.credentials}}"{{end}}
+}
+
+resource "google_compute_instance" "default" {
+  name         = "test"
+  machine_type = "n1-standard-1"
+  zone         = "us-central1-a"
+
+  tags = ["foo", "bar"]
+
+  boot_disk {
+    initialize_params {
+      image = "projects/debian-cloud/global/images/debian-11"
+    }
+  }
+
+  // Local SSD disk
+  scratch_disk {
+    interface = "SCSI"
+  }
+
+  network_interface {
+    network = "default"
+
+    access_config {
+      // Ephemeral IP
+    }
+  }
+
+  metadata = {
+    foo = "bar"
+  }
+}
+
+resource "google_compute_instance_iam_policy" "policy" {
+  project = google_compute_instance.default.project
+  zone = google_compute_instance.default.zone
+  instance_name = google_compute_instance.default.name
+  policy_data = jsonencode(
+    {
+      bindings = [
+        {
+          members = [
+            "user:jane@example.com",
+          ]
+          role = "roles/compute.osLogin"
+        }
+      ]
+    }
+  )
+}
diff --git a/testdata/templates/example_compute_instance_iam_policy.tfplan.json b/testdata/templates/example_compute_instance_iam_policy.tfplan.json
new file mode 100644
index 00000000..e729046e
--- /dev/null
+++ b/testdata/templates/example_compute_instance_iam_policy.tfplan.json
@@ -0,0 +1,416 @@
+{
+  "format_version": "0.2",
+  "terraform_version": "1.0.10",
+  "planned_values": {
+    "root_module": {
+      "resources": [
+        {
+          "address": "google_compute_instance.default",
+          "mode": "managed",
+          "type": "google_compute_instance",
+          "name": "default",
+          "provider_name": "registry.terraform.io/hashicorp/google",
+          "schema_version": 6,
+          "values": {
+            "advanced_machine_features": [],
+            "allow_stopping_for_update": null,
+            "attached_disk": [],
+            "boot_disk": [
+              {
+                "auto_delete": true,
+                "disk_encryption_key_raw": null,
+                "initialize_params": [
+                  {
+                    "image": "projects/debian-cloud/global/images/debian-11"
+                  }
+                ],
+                "mode": "READ_WRITE"
+              }
+            ],
+            "can_ip_forward": false,
+            "deletion_protection": false,
+            "description": null,
+            "desired_status": null,
+            "enable_display": null,
+            "hostname": null,
+            "labels": null,
+            "machine_type": "n1-standard-1",
+            "metadata": {
+              "foo": "bar"
+            },
+            "metadata_startup_script": null,
+            "name": "test",
+            "network_interface": [
+              {
+                "access_config": [
+                  {
+                    "public_ptr_domain_name": null
+                  }
+                ],
+                "alias_ip_range": [],
+                "ipv6_access_config": [],
+                "network": "default",
+                "nic_type": null,
+                "queue_count": null
+              }
+            ],
+            "resource_policies": null,
+            "scratch_disk": [
+              {
+                "interface": "SCSI"
+              }
+            ],
+            "service_account": [],
+            "shielded_instance_config": [],
+            "tags": [
+              "bar",
+              "foo"
+            ],
+            "timeouts": null,
+            "zone": "us-central1-a"
+          },
+          "sensitive_values": {
+            "advanced_machine_features": [],
+            "attached_disk": [],
+            "boot_disk": [
+              {
+                "initialize_params": [
+                  {
+                    "labels": {}
+                  }
+                ]
+              }
+            ],
+            "confidential_instance_config": [],
+            "guest_accelerator": [],
+            "metadata": {},
+            "network_interface": [
+              {
+                "access_config": [
+                  {}
+                ],
+                "alias_ip_range": [],
+                "ipv6_access_config": []
+              }
+            ],
+            "reservation_affinity": [],
+            "scheduling": [],
+            "scratch_disk": [
+              {}
+            ],
+            "service_account": [],
+            "shielded_instance_config": [],
+            "tags": [
+              false,
+              false
+            ]
+          }
+        },
+        {
+          "address": "google_compute_instance_iam_policy.policy",
+          "mode": "managed",
+          "type": "google_compute_instance_iam_policy",
+          "name": "policy",
+          "provider_name": "registry.terraform.io/hashicorp/google",
+          "schema_version": 0,
+          "values": {
+            "instance_name": "test",
+            "policy_data": "{\"bindings\":[{\"members\":[\"user:jane@example.com\"],\"role\":\"roles/compute.osLogin\"}]}",
+            "zone": "us-central1-a"
+          },
+          "sensitive_values": {}
+        }
+      ]
+    }
+  },
+  "resource_changes": [
+    {
+      "address": "google_compute_instance.default",
+      "mode": "managed",
+      "type": "google_compute_instance",
+      "name": "default",
+      "provider_name": "registry.terraform.io/hashicorp/google",
+      "change": {
+        "actions": [
+          "create"
+        ],
+        "before": null,
+        "after": {
+          "advanced_machine_features": [],
+          "allow_stopping_for_update": null,
+          "attached_disk": [],
+          "boot_disk": [
+            {
+              "auto_delete": true,
+              "disk_encryption_key_raw": null,
+              "initialize_params": [
+                {
+                  "image": "projects/debian-cloud/global/images/debian-11"
+                }
+              ],
+              "mode": "READ_WRITE"
+            }
+          ],
+          "can_ip_forward": false,
+          "deletion_protection": false,
+          "description": null,
+          "desired_status": null,
+          "enable_display": null,
+          "hostname": null,
+          "labels": null,
+          "machine_type": "n1-standard-1",
+          "metadata": {
+            "foo": "bar"
+          },
+          "metadata_startup_script": null,
+          "name": "test",
+          "network_interface": [
+            {
+              "access_config": [
+                {
+                  "public_ptr_domain_name": null
+                }
+              ],
+              "alias_ip_range": [],
+              "ipv6_access_config": [],
+              "network": "default",
+              "nic_type": null,
+              "queue_count": null
+            }
+          ],
+          "resource_policies": null,
+          "scratch_disk": [
+            {
+              "interface": "SCSI"
+            }
+          ],
+          "service_account": [],
+          "shielded_instance_config": [],
+          "tags": [
+            "bar",
+            "foo"
+          ],
+          "timeouts": null,
+          "zone": "us-central1-a"
+        },
+        "after_unknown": {
+          "advanced_machine_features": [],
+          "attached_disk": [],
+          "boot_disk": [
+            {
+              "device_name": true,
+              "disk_encryption_key_sha256": true,
+              "initialize_params": [
+                {
+                  "labels": true,
+                  "size": true,
+                  "type": true
+                }
+              ],
+              "kms_key_self_link": true,
+              "source": true
+            }
+          ],
+          "confidential_instance_config": true,
+          "cpu_platform": true,
+          "current_status": true,
+          "guest_accelerator": true,
+          "id": true,
+          "instance_id": true,
+          "label_fingerprint": true,
+          "metadata": {},
+          "metadata_fingerprint": true,
+          "min_cpu_platform": true,
+          "network_interface": [
+            {
+              "access_config": [
+                {
+                  "nat_ip": true,
+                  "network_tier": true
+                }
+              ],
+              "alias_ip_range": [],
+              "ipv6_access_config": [],
+              "ipv6_access_type": true,
+              "name": true,
+              "network_ip": true,
+              "stack_type": true,
+              "subnetwork": true,
+              "subnetwork_project": true
+            }
+          ],
+          "project": true,
+          "reservation_affinity": true,
+          "scheduling": true,
+          "scratch_disk": [
+            {}
+          ],
+          "self_link": true,
+          "service_account": [],
+          "shielded_instance_config": [],
+          "tags": [
+            false,
+            false
+          ],
+          "tags_fingerprint": true
+        },
+        "before_sensitive": false,
+        "after_sensitive": {
+          "advanced_machine_features": [],
+          "attached_disk": [],
+          "boot_disk": [
+            {
+              "disk_encryption_key_raw": true,
+              "initialize_params": [
+                {
+                  "labels": {}
+                }
+              ]
+            }
+          ],
+          "confidential_instance_config": [],
+          "guest_accelerator": [],
+          "metadata": {},
+          "network_interface": [
+            {
+              "access_config": [
+                {}
+              ],
+              "alias_ip_range": [],
+              "ipv6_access_config": []
+            }
+          ],
+          "reservation_affinity": [],
+          "scheduling": [],
+          "scratch_disk": [
+            {}
+          ],
+          "service_account": [],
+          "shielded_instance_config": [],
+          "tags": [
+            false,
+            false
+          ]
+        }
+      }
+    },
+    {
+      "address": "google_compute_instance_iam_policy.policy",
+      "mode": "managed",
+      "type": "google_compute_instance_iam_policy",
+      "name": "policy",
+      "provider_name": "registry.terraform.io/hashicorp/google",
+      "change": {
+        "actions": [
+          "create"
+        ],
+        "before": null,
+        "after": {
+          "instance_name": "test",
+          "policy_data": "{\"bindings\":[{\"members\":[\"user:jane@example.com\"],\"role\":\"roles/compute.osLogin\"}]}",
+          "zone": "us-central1-a"
+        },
+        "after_unknown": {
+          "etag": true,
+          "id": true,
+          "project": true
+        },
+        "before_sensitive": false,
+        "after_sensitive": {}
+      }
+    }
+  ],
+  "configuration": {
+    "root_module": {
+      "resources": [
+        {
+          "address": "google_compute_instance.default",
+          "mode": "managed",
+          "type": "google_compute_instance",
+          "name": "default",
+          "provider_config_key": "google",
+          "expressions": {
+            "boot_disk": [
+              {
+                "initialize_params": [
+                  {
+                    "image": {
+                      "constant_value": "projects/debian-cloud/global/images/debian-11"
+                    }
+                  }
+                ]
+              }
+            ],
+            "machine_type": {
+              "constant_value": "n1-standard-1"
+            },
+            "metadata": {
+              "constant_value": {
+                "foo": "bar"
+              }
+            },
+            "name": {
+              "constant_value": "test"
+            },
+            "network_interface": [
+              {
+                "access_config": [
+                  {}
+                ],
+                "network": {
+                  "constant_value": "default"
+                }
+              }
+            ],
+            "scratch_disk": [
+              {
+                "interface": {
+                  "constant_value": "SCSI"
+                }
+              }
+            ],
+            "tags": {
+              "constant_value": [
+                "foo",
+                "bar"
+              ]
+            },
+            "zone": {
+              "constant_value": "us-central1-a"
+            }
+          },
+          "schema_version": 6
+        },
+        {
+          "address": "google_compute_instance_iam_policy.policy",
+          "mode": "managed",
+          "type": "google_compute_instance_iam_policy",
+          "name": "policy",
+          "provider_config_key": "google",
+          "expressions": {
+            "instance_name": {
+              "references": [
+                "google_compute_instance.default.name",
+                "google_compute_instance.default"
+              ]
+            },
+            "policy_data": {},
+            "project": {
+              "references": [
+                "google_compute_instance.default.project",
+                "google_compute_instance.default"
+              ]
+            },
+            "zone": {
+              "references": [
+                "google_compute_instance.default.zone",
+                "google_compute_instance.default"
+              ]
+            }
+          },
+          "schema_version": 0
+        }
+      ]
+    }
+  }
+}