Repository: GoogleCloudPlatform/terraform-validator
Pull request #156 (2020-11-07 01:18:10)

Fix overlay generation bug.
Why:
* Current comparison is based on pointer comparison.
* Result was that all policies were always considered unequal.

This change addresses the need by:
* Replicates the issue with a unit test.
* Switch to comparison with reflect.DeepEqual to fix.


Patch:
diff --git a/policy/policy.go b/policy/policy.go
index e6409a97..ce9c33b6 100644
--- a/policy/policy.go
+++ b/policy/policy.go
@@ -17,6 +17,7 @@ package policy
 
 import (
 	"context"
+	"reflect"
 
 	"github.com/GoogleCloudPlatform/terraform-validator/converters/google"
 	"github.com/GoogleCloudPlatform/terraform-validator/tfgcv"
@@ -78,7 +79,7 @@ func extractOverlay(before, after []google.Asset) Overlay {
 				// a policy deletion, even if more than the policy is being deleted.
 				overlay[name] = emptyPolicy()
 			}
-		case a.IAMPolicy != b.IAMPolicy:
+		case !reflect.DeepEqual(a.IAMPolicy, b.IAMPolicy):
 			if a.IAMPolicy != nil {
 				overlay[name] = a.IAMPolicy
 			} else {


Test patch:
diff --git a/policy/policy_test.go b/policy/policy_test.go
index d8b2510f..e64e3396 100644
--- a/policy/policy_test.go
+++ b/policy/policy_test.go
@@ -168,6 +168,21 @@ func TestOverlayWithDeletes(t *testing.T) {
 	}
 }
 
+// TestOverlayNoChanges ensures a plan with no changes results in an empty overlay.
+func TestOverlayNoChanges(t *testing.T){
+	wantOverlay := Overlay{}
+
+	file := filepath.Join(testDataDir, "tf12plan_no_change.json")
+	got, err := BuildOverlay(file, testProjectName, testAncestryName, true)
+	sortOverlay(got)
+	if err != nil {
+		t.Fatalf("BuildOverly(%s) error: %v", file, err)
+	}
+	if diff := cmp.Diff(wantOverlay, got); diff != "" {
+		t.Fatalf("BuildOverlay(%s)) diff (-want +got): %s", file, diff)
+	}
+}
+
 // sortBindings provides a deterministic sorting of all fields in the Overlay.
 // Sorting is done in place.
 func sortOverlay(overlay Overlay) {
diff --git a/policy/testdata/tf12plan_no_change.json b/policy/testdata/tf12plan_no_change.json
new file mode 100644
index 00000000..8917351d
--- /dev/null
+++ b/policy/testdata/tf12plan_no_change.json
@@ -0,0 +1,990 @@
+{
+  "format_version": "0.1",
+  "terraform_version": "0.12.25",
+  "planned_values": {
+    "root_module": {
+      "resources": [
+        {
+          "address": "google_folder.example_tf_folder",
+          "mode": "managed",
+          "type": "google_folder",
+          "name": "example_tf_folder",
+          "provider_name": "google",
+          "schema_version": 0,
+          "values": {
+            "create_time": "2020-08-01T01:04:57.985Z",
+            "display_name": "example-tf-folder",
+            "id": "folders/123456789",
+            "lifecycle_state": "ACTIVE",
+            "name": "folders/123456789",
+            "parent": "organizations/123456789",
+            "timeouts": null
+          }
+        },
+        {
+          "address": "google_folder_iam_binding.binding",
+          "mode": "managed",
+          "type": "google_folder_iam_binding",
+          "name": "binding",
+          "provider_name": "google",
+          "schema_version": 0,
+          "values": {
+            "etag": "BwWrxn+Sq/k=",
+            "folder": "folders/123456789",
+            "id": "folders/123456789/roles/editor",
+            "members": [
+              "user:user1@example.com"
+            ],
+            "role": "roles/editor"
+          }
+        },
+        {
+          "address": "google_folder_iam_member.member",
+          "mode": "managed",
+          "type": "google_folder_iam_member",
+          "name": "member",
+          "provider_name": "google",
+          "schema_version": 0,
+          "values": {
+            "etag": "BwWrxn+Sq/k=",
+            "folder": "folders/123456789",
+            "id": "folders/123456789/roles/bigquery.admin/user:user2@example.com",
+            "member": "user:user2@example.com",
+            "role": "roles/bigquery.admin"
+          }
+        },
+        {
+          "address": "google_folder_iam_policy.policy",
+          "mode": "managed",
+          "type": "google_folder_iam_policy",
+          "name": "policy",
+          "provider_name": "google",
+          "schema_version": 0,
+          "values": {
+            "etag": "BwWrxn+Sq/k=",
+            "folder": "folders/123456789",
+            "id": "folders/123456789",
+            "policy_data": "{\"bindings\":[{\"members\":[\"user:user2@example.com\"],\"role\":\"roles/bigquery.admin\"},{\"members\":[\"user:user1@example.com\"],\"role\":\"roles/editor\"}]}"
+          }
+        },
+        {
+          "address": "google_organization_iam_binding.binding",
+          "mode": "managed",
+          "type": "google_organization_iam_binding",
+          "name": "binding",
+          "provider_name": "google",
+          "schema_version": 0,
+          "values": {
+            "etag": "BwWzOcKAYYg=",
+            "id": "123456789/roles/editor",
+            "members": [
+              "user:user1@example.com"
+            ],
+            "org_id": "123456789",
+            "role": "roles/editor"
+          }
+        },
+        {
+          "address": "google_organization_iam_member.member",
+          "mode": "managed",
+          "type": "google_organization_iam_member",
+          "name": "member",
+          "provider_name": "google",
+          "schema_version": 0,
+          "values": {
+            "etag": "BwWzOcKAYYg=",
+            "id": "123456789/roles/bigquery.admin/user:user2@example.com",
+            "member": "user:user2@example.com",
+            "org_id": "123456789",
+            "role": "roles/bigquery.admin"
+          }
+        },
+        {
+          "address": "google_project.example_tf_project",
+          "mode": "managed",
+          "type": "google_project",
+          "name": "example_tf_project",
+          "provider_name": "google",
+          "schema_version": 1,
+          "values": {
+            "auto_create_network": true,
+            "billing_account": "123456-ABCDEF-987654",
+            "folder_id": "123456789",
+            "id": "example-tf-project",
+            "labels": {},
+            "name": "example-tf-project",
+            "number": "123456789",
+            "org_id": "",
+            "project_id": "example-tf-project",
+            "skip_delete": null,
+            "timeouts": null
+          }
+        },
+        {
+          "address": "google_project_iam_binding.binding",
+          "mode": "managed",
+          "type": "google_project_iam_binding",
+          "name": "binding",
+          "provider_name": "google",
+          "schema_version": 0,
+          "values": {
+            "etag": "BwWrxoAEG3A=",
+            "id": "example-tf-project/roles/editor",
+            "members": [
+              "user:user1@example.com"
+            ],
+            "project": "example-tf-project",
+            "role": "roles/editor"
+          }
+        },
+        {
+          "address": "google_project_iam_member.member",
+          "mode": "managed",
+          "type": "google_project_iam_member",
+          "name": "member",
+          "provider_name": "google",
+          "schema_version": 0,
+          "values": {
+            "etag": "BwWrxoAEG3A=",
+            "id": "example-tf-project/roles/bigquery.admin/user:user2@example.com",
+            "member": "user:user2@example.com",
+            "project": "example-tf-project",
+            "role": "roles/bigquery.admin"
+          }
+        },
+        {
+          "address": "google_project_iam_policy.policy",
+          "mode": "managed",
+          "type": "google_project_iam_policy",
+          "name": "policy",
+          "provider_name": "google",
+          "schema_version": 0,
+          "values": {
+            "etag": "BwWrxoAEG3A=",
+            "id": "example-tf-project",
+            "policy_data": "{\"bindings\":[{\"members\":[\"user:user2@example.com\"],\"role\":\"roles/bigquery.admin\"},{\"members\":[\"user:user1@example.com\"],\"role\":\"roles/editor\"}]}",
+            "project": "example-tf-project"
+          }
+        }
+      ]
+    }
+  },
+  "resource_changes": [
+    {
+      "address": "google_folder.example_tf_folder",
+      "mode": "managed",
+      "type": "google_folder",
+      "name": "example_tf_folder",
+      "provider_name": "google",
+      "change": {
+        "actions": [
+          "no-op"
+        ],
+        "before": {
+          "create_time": "2020-08-01T01:04:57.985Z",
+          "display_name": "example-tf-folder",
+          "id": "folders/123456789",
+          "lifecycle_state": "ACTIVE",
+          "name": "folders/123456789",
+          "parent": "organizations/123456789",
+          "timeouts": null
+        },
+        "after": {
+          "create_time": "2020-08-01T01:04:57.985Z",
+          "display_name": "example-tf-folder",
+          "id": "folders/123456789",
+          "lifecycle_state": "ACTIVE",
+          "name": "folders/123456789",
+          "parent": "organizations/123456789",
+          "timeouts": null
+        },
+        "after_unknown": {}
+      }
+    },
+    {
+      "address": "google_folder_iam_binding.binding",
+      "mode": "managed",
+      "type": "google_folder_iam_binding",
+      "name": "binding",
+      "provider_name": "google",
+      "change": {
+        "actions": [
+          "no-op"
+        ],
+        "before": {
+          "etag": "BwWrxn+Sq/k=",
+          "folder": "folders/123456789",
+          "id": "folders/123456789/roles/editor",
+          "members": [
+            "user:user1@example.com"
+          ],
+          "role": "roles/editor"
+        },
+        "after": {
+          "etag": "BwWrxn+Sq/k=",
+          "folder": "folders/123456789",
+          "id": "folders/123456789/roles/editor",
+          "members": [
+            "user:user1@example.com"
+          ],
+          "role": "roles/editor"
+        },
+        "after_unknown": {}
+      }
+    },
+    {
+      "address": "google_folder_iam_member.member",
+      "mode": "managed",
+      "type": "google_folder_iam_member",
+      "name": "member",
+      "provider_name": "google",
+      "change": {
+        "actions": [
+          "no-op"
+        ],
+        "before": {
+          "etag": "BwWrxn+Sq/k=",
+          "folder": "folders/123456789",
+          "id": "folders/123456789/roles/bigquery.admin/user:user2@example.com",
+          "member": "user:user2@example.com",
+          "role": "roles/bigquery.admin"
+        },
+        "after": {
+          "etag": "BwWrxn+Sq/k=",
+          "folder": "folders/123456789",
+          "id": "folders/123456789/roles/bigquery.admin/user:user2@example.com",
+          "member": "user:user2@example.com",
+          "role": "roles/bigquery.admin"
+        },
+        "after_unknown": {}
+      }
+    },
+    {
+      "address": "google_folder_iam_policy.policy",
+      "mode": "managed",
+      "type": "google_folder_iam_policy",
+      "name": "policy",
+      "provider_name": "google",
+      "change": {
+        "actions": [
+          "no-op"
+        ],
+        "before": {
+          "etag": "BwWrxn+Sq/k=",
+          "folder": "folders/123456789",
+          "id": "folders/123456789",
+          "policy_data": "{\"bindings\":[{\"members\":[\"user:user2@example.com\"],\"role\":\"roles/bigquery.admin\"},{\"members\":[\"user:user1@example.com\"],\"role\":\"roles/editor\"}]}"
+        },
+        "after": {
+          "etag": "BwWrxn+Sq/k=",
+          "folder": "folders/123456789",
+          "id": "folders/123456789",
+          "policy_data": "{\"bindings\":[{\"members\":[\"user:user2@example.com\"],\"role\":\"roles/bigquery.admin\"},{\"members\":[\"user:user1@example.com\"],\"role\":\"roles/editor\"}]}"
+        },
+        "after_unknown": {}
+      }
+    },
+    {
+      "address": "google_organization_iam_binding.binding",
+      "mode": "managed",
+      "type": "google_organization_iam_binding",
+      "name": "binding",
+      "provider_name": "google",
+      "change": {
+        "actions": [
+          "no-op"
+        ],
+        "before": {
+          "etag": "BwWzOcKAYYg=",
+          "id": "123456789/roles/editor",
+          "members": [
+            "user:user1@example.com"
+          ],
+          "org_id": "123456789",
+          "role": "roles/editor"
+        },
+        "after": {
+          "etag": "BwWzOcKAYYg=",
+          "id": "123456789/roles/editor",
+          "members": [
+            "user:user1@example.com"
+          ],
+          "org_id": "123456789",
+          "role": "roles/editor"
+        },
+        "after_unknown": {}
+      }
+    },
+    {
+      "address": "google_organization_iam_member.member",
+      "mode": "managed",
+      "type": "google_organization_iam_member",
+      "name": "member",
+      "provider_name": "google",
+      "change": {
+        "actions": [
+          "no-op"
+        ],
+        "before": {
+          "etag": "BwWzOcKAYYg=",
+          "id": "123456789/roles/bigquery.admin/user:user2@example.com",
+          "member": "user:user2@example.com",
+          "org_id": "123456789",
+          "role": "roles/bigquery.admin"
+        },
+        "after": {
+          "etag": "BwWzOcKAYYg=",
+          "id": "123456789/roles/bigquery.admin/user:user2@example.com",
+          "member": "user:user2@example.com",
+          "org_id": "123456789",
+          "role": "roles/bigquery.admin"
+        },
+        "after_unknown": {}
+      }
+    },
+    {
+      "address": "google_project.example_tf_project",
+      "mode": "managed",
+      "type": "google_project",
+      "name": "example_tf_project",
+      "provider_name": "google",
+      "change": {
+        "actions": [
+          "no-op"
+        ],
+        "before": {
+          "auto_create_network": true,
+          "billing_account": "123456-ABCDEF-987654",
+          "folder_id": "123456789",
+          "id": "example-tf-project",
+          "labels": {},
+          "name": "example-tf-project",
+          "number": "123456789",
+          "org_id": "",
+          "project_id": "example-tf-project",
+          "skip_delete": null,
+          "timeouts": null
+        },
+        "after": {
+          "auto_create_network": true,
+          "billing_account": "123456-ABCDEF-987654",
+          "folder_id": "123456789",
+          "id": "example-tf-project",
+          "labels": {},
+          "name": "example-tf-project",
+          "number": "123456789",
+          "org_id": "",
+          "project_id": "example-tf-project",
+          "skip_delete": null,
+          "timeouts": null
+        },
+        "after_unknown": {}
+      }
+    },
+    {
+      "address": "google_project_iam_binding.binding",
+      "mode": "managed",
+      "type": "google_project_iam_binding",
+      "name": "binding",
+      "provider_name": "google",
+      "change": {
+        "actions": [
+          "no-op"
+        ],
+        "before": {
+          "etag": "BwWrxoAEG3A=",
+          "id": "example-tf-project/roles/editor",
+          "members": [
+            "user:user1@example.com"
+          ],
+          "project": "example-tf-project",
+          "role": "roles/editor"
+        },
+        "after": {
+          "etag": "BwWrxoAEG3A=",
+          "id": "example-tf-project/roles/editor",
+          "members": [
+            "user:user1@example.com"
+          ],
+          "project": "example-tf-project",
+          "role": "roles/editor"
+        },
+        "after_unknown": {}
+      }
+    },
+    {
+      "address": "google_project_iam_member.member",
+      "mode": "managed",
+      "type": "google_project_iam_member",
+      "name": "member",
+      "provider_name": "google",
+      "change": {
+        "actions": [
+          "no-op"
+        ],
+        "before": {
+          "etag": "BwWrxoAEG3A=",
+          "id": "example-tf-project/roles/bigquery.admin/user:user2@example.com",
+          "member": "user:user2@example.com",
+          "project": "example-tf-project",
+          "role": "roles/bigquery.admin"
+        },
+        "after": {
+          "etag": "BwWrxoAEG3A=",
+          "id": "example-tf-project/roles/bigquery.admin/user:user2@example.com",
+          "member": "user:user2@example.com",
+          "project": "example-tf-project",
+          "role": "roles/bigquery.admin"
+        },
+        "after_unknown": {}
+      }
+    },
+    {
+      "address": "google_project_iam_policy.policy",
+      "mode": "managed",
+      "type": "google_project_iam_policy",
+      "name": "policy",
+      "provider_name": "google",
+      "change": {
+        "actions": [
+          "no-op"
+        ],
+        "before": {
+          "etag": "BwWrxoAEG3A=",
+          "id": "example-tf-project",
+          "policy_data": "{\"bindings\":[{\"members\":[\"user:user2@example.com\"],\"role\":\"roles/bigquery.admin\"},{\"members\":[\"user:user1@example.com\"],\"role\":\"roles/editor\"}]}",
+          "project": "example-tf-project"
+        },
+        "after": {
+          "etag": "BwWrxoAEG3A=",
+          "id": "example-tf-project",
+          "policy_data": "{\"bindings\":[{\"members\":[\"user:user2@example.com\"],\"role\":\"roles/bigquery.admin\"},{\"members\":[\"user:user1@example.com\"],\"role\":\"roles/editor\"}]}",
+          "project": "example-tf-project"
+        },
+        "after_unknown": {}
+      }
+    }
+  ],
+  "prior_state": {
+    "format_version": "0.1",
+    "terraform_version": "0.12.25",
+    "values": {
+      "root_module": {
+        "resources": [
+          {
+            "address": "data.google_iam_policy.example",
+            "mode": "data",
+            "type": "google_iam_policy",
+            "name": "example",
+            "provider_name": "google",
+            "schema_version": 0,
+            "values": {
+              "audit_config": null,
+              "binding": [
+                {
+                  "members": [
+                    "user:user1@example.com"
+                  ],
+                  "role": "roles/editor"
+                },
+                {
+                  "members": [
+                    "user:user2@example.com"
+                  ],
+                  "role": "roles/bigquery.admin"
+                }
+              ],
+              "id": "123456789",
+              "policy_data": "{\"bindings\":[{\"members\":[\"user:user2@example.com\"],\"role\":\"roles/bigquery.admin\"},{\"members\":[\"user:user1@example.com\"],\"role\":\"roles/editor\"}]}"
+            }
+          },
+          {
+            "address": "data.google_organization.assist",
+            "mode": "data",
+            "type": "google_organization",
+            "name": "assist",
+            "provider_name": "google",
+            "schema_version": 0,
+            "values": {
+              "create_time": "2020-01-13T17:05:56.627Z",
+              "directory_customer_id": "C04jvfuw8",
+              "domain": "iam-assist-test.joonix.net",
+              "id": "organizations/123456789",
+              "lifecycle_state": "ACTIVE",
+              "name": "organizations/123456789",
+              "org_id": "123456789",
+              "organization": null
+            }
+          },
+          {
+            "address": "google_folder.example_tf_folder",
+            "mode": "managed",
+            "type": "google_folder",
+            "name": "example_tf_folder",
+            "provider_name": "google",
+            "schema_version": 0,
+            "values": {
+              "create_time": "2020-08-01T01:04:57.985Z",
+              "display_name": "example-tf-folder",
+              "id": "folders/123456789",
+              "lifecycle_state": "ACTIVE",
+              "name": "folders/123456789",
+              "parent": "organizations/123456789",
+              "timeouts": null
+            }
+          },
+          {
+            "address": "google_folder_iam_binding.binding",
+            "mode": "managed",
+            "type": "google_folder_iam_binding",
+            "name": "binding",
+            "provider_name": "google",
+            "schema_version": 0,
+            "values": {
+              "etag": "BwWrxn+Sq/k=",
+              "folder": "folders/123456789",
+              "id": "folders/123456789/roles/editor",
+              "members": [
+                "user:user1@example.com"
+              ],
+              "role": "roles/editor"
+            },
+            "depends_on": [
+              "google_folder.example_tf_folder"
+            ]
+          },
+          {
+            "address": "google_folder_iam_member.member",
+            "mode": "managed",
+            "type": "google_folder_iam_member",
+            "name": "member",
+            "provider_name": "google",
+            "schema_version": 0,
+            "values": {
+              "etag": "BwWrxn+Sq/k=",
+              "folder": "folders/123456789",
+              "id": "folders/123456789/roles/bigquery.admin/user:user2@example.com",
+              "member": "user:user2@example.com",
+              "role": "roles/bigquery.admin"
+            },
+            "depends_on": [
+              "google_folder.example_tf_folder"
+            ]
+          },
+          {
+            "address": "google_folder_iam_policy.policy",
+            "mode": "managed",
+            "type": "google_folder_iam_policy",
+            "name": "policy",
+            "provider_name": "google",
+            "schema_version": 0,
+            "values": {
+              "etag": "BwWrxn+Sq/k=",
+              "folder": "folders/123456789",
+              "id": "folders/123456789",
+              "policy_data": "{\"bindings\":[{\"members\":[\"user:user2@example.com\"],\"role\":\"roles/bigquery.admin\"},{\"members\":[\"user:user1@example.com\"],\"role\":\"roles/editor\"}]}"
+            },
+            "depends_on": [
+              "google_folder.example_tf_folder"
+            ]
+          },
+          {
+            "address": "google_organization_iam_binding.binding",
+            "mode": "managed",
+            "type": "google_organization_iam_binding",
+            "name": "binding",
+            "provider_name": "google",
+            "schema_version": 0,
+            "values": {
+              "etag": "BwWzOcKAYYg=",
+              "id": "123456789/roles/editor",
+              "members": [
+                "user:user1@example.com"
+              ],
+              "org_id": "123456789",
+              "role": "roles/editor"
+            }
+          },
+          {
+            "address": "google_organization_iam_member.member",
+            "mode": "managed",
+            "type": "google_organization_iam_member",
+            "name": "member",
+            "provider_name": "google",
+            "schema_version": 0,
+            "values": {
+              "etag": "BwWzOcKAYYg=",
+              "id": "123456789/roles/bigquery.admin/user:user2@example.com",
+              "member": "user:user2@example.com",
+              "org_id": "123456789",
+              "role": "roles/bigquery.admin"
+            }
+          },
+          {
+            "address": "google_project.example_tf_project",
+            "mode": "managed",
+            "type": "google_project",
+            "name": "example_tf_project",
+            "provider_name": "google",
+            "schema_version": 1,
+            "values": {
+              "auto_create_network": true,
+              "billing_account": "123456-ABCDEF-987654",
+              "folder_id": "123456789",
+              "id": "example-tf-project",
+              "labels": {},
+              "name": "example-tf-project",
+              "number": "123456789",
+              "org_id": "",
+              "project_id": "example-tf-project",
+              "skip_delete": null,
+              "timeouts": null
+            },
+            "depends_on": [
+              "google_folder.example_tf_folder"
+            ]
+          },
+          {
+            "address": "google_project_iam_binding.binding",
+            "mode": "managed",
+            "type": "google_project_iam_binding",
+            "name": "binding",
+            "provider_name": "google",
+            "schema_version": 0,
+            "values": {
+              "etag": "BwWrxoAEG3A=",
+              "id": "example-tf-project/roles/editor",
+              "members": [
+                "user:user1@example.com"
+              ],
+              "project": "example-tf-project",
+              "role": "roles/editor"
+            },
+            "depends_on": [
+              "google_folder.example_tf_folder",
+              "google_project.example_tf_project"
+            ]
+          },
+          {
+            "address": "google_project_iam_member.member",
+            "mode": "managed",
+            "type": "google_project_iam_member",
+            "name": "member",
+            "provider_name": "google",
+            "schema_version": 0,
+            "values": {
+              "etag": "BwWrxoAEG3A=",
+              "id": "example-tf-project/roles/bigquery.admin/user:user2@example.com",
+              "member": "user:user2@example.com",
+              "project": "example-tf-project",
+              "role": "roles/bigquery.admin"
+            },
+            "depends_on": [
+              "google_folder.example_tf_folder",
+              "google_project.example_tf_project"
+            ]
+          },
+          {
+            "address": "google_project_iam_policy.policy",
+            "mode": "managed",
+            "type": "google_project_iam_policy",
+            "name": "policy",
+            "provider_name": "google",
+            "schema_version": 0,
+            "values": {
+              "etag": "BwWrxoAEG3A=",
+              "id": "example-tf-project",
+              "policy_data": "{\"bindings\":[{\"members\":[\"user:user2@example.com\"],\"role\":\"roles/bigquery.admin\"},{\"members\":[\"user:user1@example.com\"],\"role\":\"roles/editor\"}]}",
+              "project": "example-tf-project"
+            },
+            "depends_on": [
+              "google_folder.example_tf_folder",
+              "google_project.example_tf_project"
+            ]
+          }
+        ]
+      }
+    }
+  },
+  "configuration": {
+    "provider_config": {
+      "google": {
+        "name": "google",
+        "expressions": {
+          "project": {
+            "constant_value": "tf-validator"
+          },
+          "region": {
+            "constant_value": "us-central1"
+          },
+          "zone": {
+            "constant_value": "us-central1-a"
+          }
+        }
+      }
+    },
+    "root_module": {
+      "resources": [
+        {
+          "address": "google_folder.example_tf_folder",
+          "mode": "managed",
+          "type": "google_folder",
+          "name": "example_tf_folder",
+          "provider_config_key": "google",
+          "expressions": {
+            "display_name": {
+              "constant_value": "example-tf-folder"
+            },
+            "parent": {
+              "references": [
+                "data.google_organization.assist"
+              ]
+            }
+          },
+          "schema_version": 0
+        },
+        {
+          "address": "google_folder_iam_binding.binding",
+          "mode": "managed",
+          "type": "google_folder_iam_binding",
+          "name": "binding",
+          "provider_config_key": "google",
+          "expressions": {
+            "folder": {
+              "references": [
+                "google_folder.example_tf_folder"
+              ]
+            },
+            "members": {
+              "constant_value": [
+                "user:user1@example.com"
+              ]
+            },
+            "role": {
+              "constant_value": "roles/editor"
+            }
+          },
+          "schema_version": 0
+        },
+        {
+          "address": "google_folder_iam_member.member",
+          "mode": "managed",
+          "type": "google_folder_iam_member",
+          "name": "member",
+          "provider_config_key": "google",
+          "expressions": {
+            "folder": {
+              "references": [
+                "google_folder.example_tf_folder"
+              ]
+            },
+            "member": {
+              "constant_value": "user:user2@example.com"
+            },
+            "role": {
+              "constant_value": "roles/bigquery.admin"
+            }
+          },
+          "schema_version": 0
+        },
+        {
+          "address": "google_folder_iam_policy.policy",
+          "mode": "managed",
+          "type": "google_folder_iam_policy",
+          "name": "policy",
+          "provider_config_key": "google",
+          "expressions": {
+            "folder": {
+              "references": [
+                "google_folder.example_tf_folder"
+              ]
+            },
+            "policy_data": {
+              "references": [
+                "data.google_iam_policy.example"
+              ]
+            }
+          },
+          "schema_version": 0
+        },
+        {
+          "address": "google_organization_iam_binding.binding",
+          "mode": "managed",
+          "type": "google_organization_iam_binding",
+          "name": "binding",
+          "provider_config_key": "google",
+          "expressions": {
+            "members": {
+              "constant_value": [
+                "user:user1@example.com"
+              ]
+            },
+            "org_id": {
+              "references": [
+                "data.google_organization.assist"
+              ]
+            },
+            "role": {
+              "constant_value": "roles/editor"
+            }
+          },
+          "schema_version": 0
+        },
+        {
+          "address": "google_organization_iam_member.member",
+          "mode": "managed",
+          "type": "google_organization_iam_member",
+          "name": "member",
+          "provider_config_key": "google",
+          "expressions": {
+            "member": {
+              "constant_value": "user:user2@example.com"
+            },
+            "org_id": {
+              "references": [
+                "data.google_organization.assist"
+              ]
+            },
+            "role": {
+              "constant_value": "roles/bigquery.admin"
+            }
+          },
+          "schema_version": 0
+        },
+        {
+          "address": "google_project.example_tf_project",
+          "mode": "managed",
+          "type": "google_project",
+          "name": "example_tf_project",
+          "provider_config_key": "google",
+          "expressions": {
+            "billing_account": {
+              "constant_value": "123456-ABCDEF-987654"
+            },
+            "folder_id": {
+              "references": [
+                "google_folder.example_tf_folder"
+              ]
+            },
+            "name": {
+              "constant_value": "example-tf-project"
+            },
+            "project_id": {
+              "constant_value": "example-tf-project"
+            }
+          },
+          "schema_version": 1
+        },
+        {
+          "address": "google_project_iam_binding.binding",
+          "mode": "managed",
+          "type": "google_project_iam_binding",
+          "name": "binding",
+          "provider_config_key": "google",
+          "expressions": {
+            "members": {
+              "constant_value": [
+                "user:user1@example.com"
+              ]
+            },
+            "project": {
+              "references": [
+                "google_project.example_tf_project"
+              ]
+            },
+            "role": {
+              "constant_value": "roles/editor"
+            }
+          },
+          "schema_version": 0
+        },
+        {
+          "address": "google_project_iam_member.member",
+          "mode": "managed",
+          "type": "google_project_iam_member",
+          "name": "member",
+          "provider_config_key": "google",
+          "expressions": {
+            "member": {
+              "constant_value": "user:user2@example.com"
+            },
+            "project": {
+              "references": [
+                "google_project.example_tf_project"
+              ]
+            },
+            "role": {
+              "constant_value": "roles/bigquery.admin"
+            }
+          },
+          "schema_version": 0
+        },
+        {
+          "address": "google_project_iam_policy.policy",
+          "mode": "managed",
+          "type": "google_project_iam_policy",
+          "name": "policy",
+          "provider_config_key": "google",
+          "expressions": {
+            "policy_data": {
+              "references": [
+                "data.google_iam_policy.example"
+              ]
+            },
+            "project": {
+              "references": [
+                "google_project.example_tf_project"
+              ]
+            }
+          },
+          "schema_version": 0
+        },
+        {
+          "address": "data.google_iam_policy.example",
+          "mode": "data",
+          "type": "google_iam_policy",
+          "name": "example",
+          "provider_config_key": "google",
+          "expressions": {
+            "binding": [
+              {
+                "members": {
+                  "constant_value": [
+                    "user:user1@example.com"
+                  ]
+                },
+                "role": {
+                  "constant_value": "roles/editor"
+                }
+              },
+              {
+                "members": {
+                  "constant_value": [
+                    "user:user2@example.com"
+                  ]
+                },
+                "role": {
+                  "constant_value": "roles/bigquery.admin"
+                }
+              }
+            ]
+          },
+          "schema_version": 0
+        },
+        {
+          "address": "data.google_organization.assist",
+          "mode": "data",
+          "type": "google_organization",
+          "name": "assist",
+          "provider_config_key": "google",
+          "expressions": {
+            "domain": {
+              "constant_value": "iam-assist-test.joonix.net"
+            }
+          },
+          "schema_version": 0
+        }
+      ]
+    }
+  }
+}