From 2130b066811cda9ceba94b7b69c1668e940279c6 Mon Sep 17 00:00:00 2001 From: Scott Suarez Date: Tue, 11 Jan 2022 14:21:04 -0800 Subject: [PATCH] Manage tfv test source code in magic-modules (#5599) --- mmv1/provider/terraform_validator.rb | 44 +- .../{manifest => source}/cli_test.go.erb | 0 .../validator/tests/source/init_test.go | 172 ++ .../tf0_12plan.allcoverage.json | 1738 ++++++++++++++++ .../tf0_12plan.applied.json | 1367 +++++++++++++ .../read_planned_assets/tf0_12plan.json | 390 ++++ .../tf1_0plan.allcoverage.json | 1738 ++++++++++++++++ .../tf1_0plan.applied.json | 1803 +++++++++++++++++ .../source/read_planned_assets/tf1_0plan.json | 390 ++++ .../{manifest => source}/read_test.go.erb | 0 .../validator/tests/{ => source}/utils.go | 0 11 files changed, 7632 insertions(+), 10 deletions(-) rename mmv1/third_party/validator/tests/{manifest => source}/cli_test.go.erb (100%) create mode 100644 mmv1/third_party/validator/tests/source/init_test.go create mode 100644 mmv1/third_party/validator/tests/source/read_planned_assets/tf0_12plan.allcoverage.json create mode 100644 mmv1/third_party/validator/tests/source/read_planned_assets/tf0_12plan.applied.json create mode 100644 mmv1/third_party/validator/tests/source/read_planned_assets/tf0_12plan.json create mode 100644 mmv1/third_party/validator/tests/source/read_planned_assets/tf1_0plan.allcoverage.json create mode 100644 mmv1/third_party/validator/tests/source/read_planned_assets/tf1_0plan.applied.json create mode 100644 mmv1/third_party/validator/tests/source/read_planned_assets/tf1_0plan.json rename mmv1/third_party/validator/tests/{manifest => source}/read_test.go.erb (100%) rename mmv1/third_party/validator/tests/{ => source}/utils.go (100%) diff --git a/mmv1/provider/terraform_validator.rb b/mmv1/provider/terraform_validator.rb index a74182adddba..27797d90f9f9 100644 --- a/mmv1/provider/terraform_validator.rb +++ b/mmv1/provider/terraform_validator.rb @@ -62,11 +62,11 @@ def retrieve_list_of_manually_defined_tests_from_file(file) def retrieve_list_of_manually_defined_tests m1 = retrieve_list_of_manually_defined_tests_from_file( - 'third_party/validator/tests/manifest/cli_test.go.erb' + 'third_party/validator/tests/source/cli_test.go.erb' ) m2 = retrieve_list_of_manually_defined_tests_from_file( - 'third_party/validator/tests/manifest/read_test.go.erb' + 'third_party/validator/tests/source/read_test.go.erb' ) m1 | m2 # union of manually defined tests end @@ -106,6 +106,20 @@ def retrieve_full_manifest_of_non_defined_tests non_defined_tests end + def retrieve_test_source_files(path, suffix) + files = Dir[path + '**' + suffix] + files = files.map { |file| file.split(path)[-1] } + files.sort + end + + def retrieve_test_source_code_with_location(suffix) + path = 'third_party/validator/tests/source/' + files = retrieve_test_source_files(path, suffix) + files.map do |file| + ['test/' + file, path + file] + end + end + def compile_common_files(output_folder, products, _common_compile_file) Google::LOGGER.info 'Compiling common files.' file_template = ProviderFileTemplate.new( @@ -116,6 +130,17 @@ def compile_common_files(output_folder, products, _common_compile_file) ) @non_defined_tests = retrieve_full_manifest_of_non_defined_tests + + test_source = retrieve_test_source_code_with_location('[b]').map do |location| + [location[0].sub('go.erb', 'go'), location[1]] + end + + compile_file_list( + output_folder, + test_source, + file_template + ) + compile_file_list(output_folder, [ ['converters/google/resources/compute_operation.go', 'third_party/terraform/utils/compute_operation.go.erb'], @@ -140,11 +165,7 @@ def compile_common_files(output_folder, products, _common_compile_file) ['converters/google/resources/metadata.go', 'third_party/terraform/utils/metadata.go.erb'], ['converters/google/resources/compute_instance.go', - 'third_party/validator/compute_instance.go.erb'], - ['test/cli_test.go', - 'third_party/validator/tests/manifest/cli_test.go.erb'], - ['test/read_test.go', - 'third_party/validator/tests/manifest/read_test.go.erb'] + 'third_party/validator/compute_instance.go.erb'] ], file_template) end @@ -158,6 +179,11 @@ def copy_common_files(output_folder, generate_code, _generate_docs) retrieve_full_list_of_test_files_with_location ) + copy_file_list( + output_folder, + retrieve_test_source_code_with_location('[^b]') + ) + copy_file_list(output_folder, [ ['converters/google/resources/constants.go', 'third_party/validator/constants.go'], @@ -284,9 +310,7 @@ def copy_common_files(output_folder, generate_code, _generate_docs) ['converters/google/resources/spanner_instance_iam.go', 'third_party/validator/spanner_instance_iam.go'], ['converters/google/resources/storage_bucket_iam.go', - 'third_party/validator/storage_bucket_iam.go'], - ['test/utils.go', - 'third_party/validator/tests/utils.go'] + 'third_party/validator/storage_bucket_iam.go'] ]) end diff --git a/mmv1/third_party/validator/tests/manifest/cli_test.go.erb b/mmv1/third_party/validator/tests/source/cli_test.go.erb similarity index 100% rename from mmv1/third_party/validator/tests/manifest/cli_test.go.erb rename to mmv1/third_party/validator/tests/source/cli_test.go.erb diff --git a/mmv1/third_party/validator/tests/source/init_test.go b/mmv1/third_party/validator/tests/source/init_test.go new file mode 100644 index 000000000000..c74ed8709e09 --- /dev/null +++ b/mmv1/third_party/validator/tests/source/init_test.go @@ -0,0 +1,172 @@ +package test + +import ( + "encoding/json" + "fmt" + "log" + "os" + "path/filepath" + "regexp" + "strings" + "testing" + "text/template" + "time" + + "github.com/GoogleCloudPlatform/terraform-validator/converters/google" +) + +const ( + samplePolicyPath = "../testdata/sample_policies" + defaultAncestry = "organization/12345/folder/67890" + defaultOrganization = "12345" + defaultFolder = "67890" + defaultProject = "foobar" + defaultProviderVersion = "4.4.0" +) + +var ( + data *testData + tfvBinary string + tmpDir = os.TempDir() +) + +// testData represents the full dataset that is used for templating terraform +// configs. It contains Google API resources that are expected to be returned +// after converting the terraform plan. +type testData struct { + // is not nil - Terraform 12 version used + TFVersion string + // provider "google" + Provider map[string]string + Project map[string]string + Time map[string]string + OrgID string + FolderID string + Ancestry string +} + +// init initializes the variables used for testing. As tests rely on +// environment variables, the parsing of those are only done once. +func init() { + // don't raise errors in glog + + cwd, err := os.Getwd() + if err != nil { + log.Fatalf("cannot get current directory: %v", err) + } + tfvBinary = filepath.Join(cwd, "..", "bin", "terraform-validator") + project, ok := os.LookupEnv("TEST_PROJECT") + if !ok { + log.Printf("Missing required env var TEST_PROJECT. Default (%s) will be used.", defaultProject) + project = defaultProject + } + org, ok := os.LookupEnv("TEST_ORG_ID") + if !ok { + log.Printf("Missing required env var TEST_ORG_ID. Default (%s) will be used.", defaultOrganization) + org = defaultOrganization + } + folder, ok := os.LookupEnv("TEST_FOLDER_ID") + if !ok { + log.Printf("Missing required env var TEST_FOLDER_ID. Default (%s) will be used.", defaultFolder) + folder = defaultFolder + } + credentials, ok := os.LookupEnv("TEST_CREDENTIALS") + if ok { + // Make credentials path relative to repo root rather than + // test/ dir if it is a relative path. + if !filepath.IsAbs(credentials) { + credentials = filepath.Join(cwd, "..", credentials) + } + } else { + log.Printf("missing env var TEST_CREDENTIALS, will try to use Application Default Credentials") + } + ancestry, ok := os.LookupEnv("TEST_ANCESTRY") + if !ok { + log.Printf("Missing required env var TEST_ANCESTRY. Default (%s) will be used.", defaultAncestry) + ancestry = defaultAncestry + } + providerVersion := defaultProviderVersion + //As time is not information in terraform resource data, time is fixed for testing purposes + fixedTime := time.Date(2021, time.April, 14, 15, 16, 17, 0, time.UTC) + data = &testData{ + TFVersion: "0.12", + Provider: map[string]string{ + "version": providerVersion, + "project": project, + "credentials": credentials, + }, + Time: map[string]string{ + "RFC3339Nano": fixedTime.Format(time.RFC3339Nano), + }, + Project: map[string]string{ + "Name": "My Project Name", + "ProjectId": "my-project-id", + "BillingAccountName": "012345-567890-ABCDEF", + "Number": "1234567890", + }, + OrgID: org, + FolderID: folder, + Ancestry: ancestry, + } +} + +func generateTestFiles(t *testing.T, sourceDir string, targetDir string, selector string) { + funcMap := template.FuncMap{ + "pastLastSlash": func(s string) string { + split := strings.Split(s, "/") + return split[len(split)-1] + }, + } + tmpls, err := template.New("").Funcs(funcMap). + ParseGlob(filepath.Join(sourceDir, selector)) + if err != nil { + t.Fatalf("generateTestFiles: %v", err) + } + for _, tmpl := range tmpls.Templates() { + if tmpl.Name() == "" { + continue // Skip base template. + } + path := filepath.Join(targetDir, tmpl.Name()) + f, err := os.Create(path) + if err != nil { + t.Fatalf("creating terraform file %v: %v", path, err) + } + if err := tmpl.Execute(f, data); err != nil { + t.Fatalf("templating terraform file %v: %v", path, err) + } + if err := f.Close(); err != nil { + t.Fatalf("closing file %v: %v", path, err) + } + t.Logf("Successfully created file %v", path) + } +} + +func normalizeAssets(t *testing.T, assets []google.Asset, offline bool) []google.Asset { + t.Helper() + ret := make([]google.Asset, len(assets)) + re := regexp.MustCompile(`/placeholder-[^/]+`) + for i := range assets { + // Get conformity by converting to/from json. + bytes, err := json.Marshal(assets[i]) + if err != nil { + t.Fatalf("marshaling: %v", err) + } + + var asset google.Asset + err = json.Unmarshal(bytes, &asset) + if err != nil { + t.Fatalf("marshaling: %v", err) + } + if !offline { + // remove the ancestry as the value of that is dependent on project, + // and is not important for the test. + asset.Ancestry = "" + } + // Replace placeholder in names. This allows us to compare generated placeholders + // (for example due to "unknown after apply") with the values in the expected + // output files. + asset.Name = re.ReplaceAllString(asset.Name, fmt.Sprintf("/placeholder-foobar")) + ret[i] = asset + } + return ret +} diff --git a/mmv1/third_party/validator/tests/source/read_planned_assets/tf0_12plan.allcoverage.json b/mmv1/third_party/validator/tests/source/read_planned_assets/tf0_12plan.allcoverage.json new file mode 100644 index 000000000000..1be6d2c1220f --- /dev/null +++ b/mmv1/third_party/validator/tests/source/read_planned_assets/tf0_12plan.allcoverage.json @@ -0,0 +1,1738 @@ +{ + "format_version": "0.1", + "terraform_version": "0.12.6", + "planned_values": { + "root_module": { + "resources": [ + { + "address": "google_compute_disk.my-disk-resource", + "mode": "managed", + "type": "google_compute_disk", + "name": "my-disk-resource", + "provider_name": "google", + "schema_version": 0, + "values": { + "description": null, + "disk_encryption_key": [ + + ], + "disk_encryption_key_raw": null, + "image": "projects/debian-cloud/global/images/debian-8-jessie-v20170523", + "labels": { + "disk-label-key-a": "disk-label-val-a" + }, + "name": "my-disk", + "project": "foobar", + "snapshot": null, + "source_image_encryption_key": [ + + ], + "source_snapshot_encryption_key": [ + + ], + "timeouts": null, + "type": "pd-ssd", + "zone": "projects/foobar/global/zones/us-central1-a" + } + }, + { + "address": "google_compute_firewall.my-test-firewall", + "mode": "managed", + "type": "google_compute_firewall", + "name": "my-test-firewall", + "provider_name": "google", + "schema_version": 1, + "values": { + "allow": [ + { + "ports": [ + "80", + "8080", + "1000-2000" + ], + "protocol": "tcp" + }, + { + "ports": [ + + ], + "protocol": "icmp" + } + ], + "deny": [ + + ], + "description": null, + "disabled": null, + "name": "my-test-firewall", + "network": "default", + "priority": 1000, + "source_service_accounts": null, + "source_tags": [ + "web" + ], + "target_service_accounts": null, + "target_tags": null, + "timeouts": null + } + }, + { + "address": "google_compute_instance.my-test-instance", + "mode": "managed", + "type": "google_compute_instance", + "name": "my-test-instance", + "provider_name": "google", + "schema_version": 6, + "values": { + "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-8-jessie-v20170523" + } + ] + } + ], + "can_ip_forward": false, + "deletion_protection": false, + "description": null, + "disk": [ + + ], + "hostname": null, + "labels": null, + "machine_type": "n1-standard-1", + "metadata": { + "foo": "bar" + }, + "metadata_startup_script": "echo hi > /test.txt", + "min_cpu_platform": null, + "name": "my-instance", + "network_interface": [ + { + "access_config": [ + { + "public_ptr_domain_name": null + } + ], + "alias_ip_range": [ + + ], + "network": "default" + } + ], + "project": "foobar", + "scratch_disk": [ + { + "interface": "SCSI" + } + ], + "service_account": [ + { + "scopes": [ + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/userinfo.email" + ] + } + ], + "shielded_instance_config": [ + + ], + "tags": [ + "bar", + "foo" + ], + "timeouts": null, + "zone": "projects/foobar/global/zones/us-central1-a" + } + }, + { + "address": "google_folder_iam_binding.my-test-folder-binding", + "mode": "managed", + "type": "google_folder_iam_binding", + "name": "my-test-folder-binding", + "provider_name": "google", + "schema_version": 0, + "values": { + "folder": "my-folder", + "members": [ + "user:alice@example.com" + ], + "role": "roles/browser" + } + }, + { + "address": "google_folder_iam_member.my-test-folder-member", + "mode": "managed", + "type": "google_folder_iam_member", + "name": "my-test-folder-member", + "provider_name": "google", + "schema_version": 0, + "values": { + "folder": "my-folder", + "member": "user:jane@example.com", + "role": "roles/viewer" + } + }, + { + "address": "google_folder_iam_policy.my-test-folder-policy", + "mode": "managed", + "type": "google_folder_iam_policy", + "name": "my-test-folder-policy", + "provider_name": "google", + "schema_version": 0, + "values": { + "folder": "my-folder", + "policy_data": "{\"bindings\":[{\"members\":[\"user:bob@example.com\"],\"role\":\"roles/editor\"}]}" + } + }, + { + "address": "google_organization_iam_binding.my-test-org-binding", + "mode": "managed", + "type": "google_organization_iam_binding", + "name": "my-test-org-binding", + "provider_name": "google", + "schema_version": 0, + "values": { + "members": [ + "user:alice@example.com" + ], + "org_id": "123456789", + "role": "roles/browser" + } + }, + { + "address": "google_organization_iam_member.my-test-org-member", + "mode": "managed", + "type": "google_organization_iam_member", + "name": "my-test-org-member", + "provider_name": "google", + "schema_version": 0, + "values": { + "member": "user:jane@example.com", + "org_id": "123456789", + "role": "roles/viewer" + } + }, + { + "address": "google_organization_iam_policy.my-test-org-policy", + "mode": "managed", + "type": "google_organization_iam_policy", + "name": "my-test-org-policy", + "provider_name": "google", + "schema_version": 0, + "values": { + "org_id": "123456789", + "policy_data": "{\"bindings\":[{\"members\":[\"user:bob@example.com\"],\"role\":\"roles/editor\"}]}" + } + }, + { + "address": "google_project.my-project-resource", + "mode": "managed", + "type": "google_project", + "name": "my-project-resource", + "provider_name": "google", + "schema_version": 1, + "values": { + "auto_create_network": true, + "billing_account": "012345-567890-ABCDEF", + "labels": { + "project-label-key-a": "project-label-val-a" + }, + "name": "My Project Name", + "org_id": "my-org", + "project_id": "foobar", + "timeouts": null + } + }, + { + "address": "google_project_iam_binding.my-test-project-binding", + "mode": "managed", + "type": "google_project_iam_binding", + "name": "my-test-project-binding", + "provider_name": "google", + "schema_version": 0, + "values": { + "members": [ + "user:alice@example.com" + ], + "project": "foobar", + "role": "roles/browser" + } + }, + { + "address": "google_project_iam_member.my-test-project-member", + "mode": "managed", + "type": "google_project_iam_member", + "name": "my-test-project-member", + "provider_name": "google", + "schema_version": 0, + "values": { + "member": "user:jane@example.com", + "project": "foobar", + "role": "roles/viewer" + } + }, + { + "address": "google_project_iam_policy.my-test-project-policy", + "mode": "managed", + "type": "google_project_iam_policy", + "name": "my-test-project-policy", + "provider_name": "google", + "schema_version": 0, + "values": { + "authoritative": null, + "disable_project": null, + "policy_data": "{\"bindings\":[{\"members\":[\"user:bob@example.com\"],\"role\":\"roles/editor\"}]}", + "project": "foobar" + } + }, + { + "address": "google_sql_database_instance.my-test-sql", + "mode": "managed", + "type": "google_sql_database_instance", + "name": "my-test-sql", + "provider_name": "google", + "schema_version": 0, + "values": { + "database_version": "POSTGRES_9_6", + "name": "master-instance", + "region": "us-central1", + "settings": [ + { + "database_flags": [ + + ], + "disk_autoresize": true, + "maintenance_window": [ + + ], + "pricing_plan": "PER_USE", + "tier": "db-f1-micro", + "user_labels": null + } + ], + "timeouts": null + } + }, + { + "address": "google_storage_bucket.my-test-bucket", + "mode": "managed", + "type": "google_storage_bucket", + "name": "my-test-bucket", + "provider_name": "google", + "schema_version": 0, + "values": { + "cors": [ + + ], + "encryption": [ + + ], + "force_destroy": false, + "labels": null, + "lifecycle_rule": [ + + ], + "location": "EU", + "logging": [ + + ], + "name": "test-bucket", + "predefined_acl": null, + "requester_pays": null, + "retention_policy": [ + + ], + "storage_class": "STANDARD", + "versioning": [ + + ], + "website": [ + { + "main_page_suffix": "index.html", + "not_found_page": "404.html" + } + ] + } + } + ] + } + }, + "resource_changes": [ + { + "address": "google_compute_disk.my-disk-resource", + "mode": "managed", + "type": "google_compute_disk", + "name": "my-disk-resource", + "provider_name": "google", + "change": { + "actions": [ + "create" + ], + "before": { + "description": null, + "disk_encryption_key": [ + + ], + "disk_encryption_key_raw": null, + "image": "projects/debian-cloud/global/images/debian-8-jessie-v20170523", + "labels": { + "disk-label-key-a": "disk-label-val-a" + }, + "name": "my-disk", + "project": "foobar", + "snapshot": null, + "source_image_encryption_key": [ + + ], + "source_snapshot_encryption_key": [ + + ], + "timeouts": null, + "type": "pd-ssd", + "zone": "projects/foobar/global/zones/us-central1-a" + }, + "after": { + "description": null, + "disk_encryption_key": [ + + ], + "disk_encryption_key_raw": null, + "image": "projects/debian-cloud/global/images/debian-8-jessie-v20170523", + "labels": { + "disk-label-key-a": "disk-label-val-a" + }, + "name": "my-disk", + "project": "foobar", + "snapshot": null, + "source_image_encryption_key": [ + + ], + "source_snapshot_encryption_key": [ + + ], + "timeouts": null, + "type": "pd-ssd", + "zone": "projects/foobar/global/zones/us-central1-a" + }, + "after_unknown": { + "creation_timestamp": true, + "disk_encryption_key": [ + + ], + "disk_encryption_key_sha256": true, + "id": true, + "label_fingerprint": true, + "labels": { + }, + "last_attach_timestamp": true, + "last_detach_timestamp": true, + "physical_block_size_bytes": true, + "self_link": true, + "size": true, + "source_image_encryption_key": [ + + ], + "source_image_id": true, + "source_snapshot_encryption_key": [ + + ], + "source_snapshot_id": true, + "users": true + } + } + }, + { + "address": "google_compute_firewall.my-test-firewall", + "mode": "managed", + "type": "google_compute_firewall", + "name": "my-test-firewall", + "provider_name": "google", + "change": { + "actions": [ + "create" + ], + "before": { + "allow": [ + { + "ports": [ + "80", + "8080", + "1000-2000" + ], + "protocol": "tcp" + }, + { + "ports": [ + + ], + "protocol": "icmp" + } + ], + "deny": [ + + ], + "description": null, + "disabled": null, + "name": "my-test-firewall", + "network": "default", + "priority": 1000, + "source_service_accounts": null, + "source_tags": [ + "web" + ], + "target_service_accounts": null, + "target_tags": null, + "timeouts": null + }, + "after": { + "allow": [ + { + "ports": [ + "80", + "8080", + "1000-2000" + ], + "protocol": "tcp" + }, + { + "ports": [ + + ], + "protocol": "icmp" + } + ], + "deny": [ + + ], + "description": null, + "disabled": null, + "name": "my-test-firewall", + "network": "default", + "priority": 1000, + "source_service_accounts": null, + "source_tags": [ + "web" + ], + "target_service_accounts": null, + "target_tags": null, + "timeouts": null + }, + "after_unknown": { + "allow": [ + { + "ports": [ + false, + false, + false + ] + }, + { + "ports": [ + + ] + } + ], + "creation_timestamp": true, + "deny": [ + + ], + "destination_ranges": true, + "direction": true, + "id": true, + "project": true, + "self_link": true, + "source_ranges": true, + "source_tags": [ + false + ] + } + } + }, + { + "address": "google_compute_instance.my-test-instance", + "mode": "managed", + "type": "google_compute_instance", + "name": "my-test-instance", + "provider_name": "google", + "change": { + "actions": [ + "create" + ], + "before": { + "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-8-jessie-v20170523" + } + ] + } + ], + "can_ip_forward": false, + "deletion_protection": false, + "description": null, + "disk": [ + + ], + "hostname": null, + "labels": null, + "machine_type": "n1-standard-1", + "metadata": { + "foo": "bar" + }, + "metadata_startup_script": "echo hi > /test.txt", + "min_cpu_platform": null, + "name": "my-instance", + "network_interface": [ + { + "access_config": [ + { + "public_ptr_domain_name": null + } + ], + "alias_ip_range": [ + + ], + "network": "default" + } + ], + "project": "foobar", + "scratch_disk": [ + { + "interface": "SCSI" + } + ], + "service_account": [ + { + "scopes": [ + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/userinfo.email" + ] + } + ], + "shielded_instance_config": [ + + ], + "tags": [ + "bar", + "foo" + ], + "timeouts": null, + "zone": "projects/foobar/global/zones/us-central1-a" + }, + "after": { + "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-8-jessie-v20170523" + } + ] + } + ], + "can_ip_forward": false, + "deletion_protection": false, + "description": null, + "disk": [ + + ], + "hostname": null, + "labels": null, + "machine_type": "n1-standard-1", + "metadata": { + "foo": "bar" + }, + "metadata_startup_script": "echo hi > /test.txt", + "min_cpu_platform": null, + "name": "my-instance", + "network_interface": [ + { + "access_config": [ + { + "public_ptr_domain_name": null + } + ], + "alias_ip_range": [ + + ], + "network": "default" + } + ], + "project": "foobar", + "scratch_disk": [ + { + "interface": "SCSI" + } + ], + "service_account": [ + { + "scopes": [ + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/userinfo.email" + ] + } + ], + "shielded_instance_config": [ + + ], + "tags": [ + "bar", + "foo" + ], + "timeouts": null, + "zone": "projects/foobar/global/zones/us-central1-a" + }, + "after_unknown": { + "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 + } + ], + "cpu_platform": true, + "disk": [ + + ], + "guest_accelerator": true, + "id": true, + "instance_id": true, + "label_fingerprint": true, + "metadata": { + }, + "metadata_fingerprint": true, + "network_interface": [ + { + "access_config": [ + { + "assigned_nat_ip": true, + "nat_ip": true, + "network_tier": true + } + ], + "address": true, + "alias_ip_range": [ + + ], + "name": true, + "network_ip": true, + "subnetwork": true, + "subnetwork_project": true + } + ], + "scheduling": true, + "scratch_disk": [ + { + } + ], + "self_link": true, + "service_account": [ + { + "email": true, + "scopes": [ + false, + false, + false + ] + } + ], + "shielded_instance_config": [ + + ], + "tags": [ + false, + false + ], + "tags_fingerprint": true + } + } + }, + { + "address": "google_folder_iam_binding.my-test-folder-binding", + "mode": "managed", + "type": "google_folder_iam_binding", + "name": "my-test-folder-binding", + "provider_name": "google", + "change": { + "actions": [ + "create" + ], + "before": { + "folder": "my-folder", + "members": [ + "user:alice@example.com" + ], + "role": "roles/browser" + }, + "after": { + "folder": "my-folder", + "members": [ + "user:alice@example.com" + ], + "role": "roles/browser" + }, + "after_unknown": { + "etag": true, + "id": true, + "members": [ + false + ] + } + } + }, + { + "address": "google_folder_iam_member.my-test-folder-member", + "mode": "managed", + "type": "google_folder_iam_member", + "name": "my-test-folder-member", + "provider_name": "google", + "change": { + "actions": [ + "create" + ], + "before": { + "folder": "my-folder", + "member": "user:jane@example.com", + "role": "roles/viewer" + }, + "after": { + "folder": "my-folder", + "member": "user:jane@example.com", + "role": "roles/viewer" + }, + "after_unknown": { + "etag": true, + "id": true + } + } + }, + { + "address": "google_folder_iam_policy.my-test-folder-policy", + "mode": "managed", + "type": "google_folder_iam_policy", + "name": "my-test-folder-policy", + "provider_name": "google", + "change": { + "actions": [ + "create" + ], + "before": { + "folder": "my-folder", + "policy_data": "{\"bindings\":[{\"members\":[\"user:bob@example.com\"],\"role\":\"roles/editor\"}]}" + }, + "after": { + "folder": "my-folder", + "policy_data": "{\"bindings\":[{\"members\":[\"user:bob@example.com\"],\"role\":\"roles/editor\"}]}" + }, + "after_unknown": { + "etag": true, + "id": true + } + } + }, + { + "address": "google_organization_iam_binding.my-test-org-binding", + "mode": "managed", + "type": "google_organization_iam_binding", + "name": "my-test-org-binding", + "provider_name": "google", + "change": { + "actions": [ + "create" + ], + "before": { + "members": [ + "user:alice@example.com" + ], + "org_id": "123456789", + "role": "roles/browser" + }, + "after": { + "members": [ + "user:alice@example.com" + ], + "org_id": "123456789", + "role": "roles/browser" + }, + "after_unknown": { + "etag": true, + "id": true, + "members": [ + false + ] + } + } + }, + { + "address": "google_organization_iam_member.my-test-org-member", + "mode": "managed", + "type": "google_organization_iam_member", + "name": "my-test-org-member", + "provider_name": "google", + "change": { + "actions": [ + "create" + ], + "before": { + "member": "user:jane@example.com", + "org_id": "123456789", + "role": "roles/viewer" + }, + "after": { + "member": "user:jane@example.com", + "org_id": "123456789", + "role": "roles/viewer" + }, + "after_unknown": { + "etag": true, + "id": true + } + } + }, + { + "address": "google_organization_iam_policy.my-test-org-policy", + "mode": "managed", + "type": "google_organization_iam_policy", + "name": "my-test-org-policy", + "provider_name": "google", + "change": { + "actions": [ + "create" + ], + "before": { + "org_id": "123456789", + "policy_data": "{\"bindings\":[{\"members\":[\"user:bob@example.com\"],\"role\":\"roles/editor\"}]}" + }, + "after": { + "org_id": "123456789", + "policy_data": "{\"bindings\":[{\"members\":[\"user:bob@example.com\"],\"role\":\"roles/editor\"}]}" + }, + "after_unknown": { + "etag": true, + "id": true + } + } + }, + { + "address": "google_project.my-project-resource", + "mode": "managed", + "type": "google_project", + "name": "my-project-resource", + "provider_name": "google", + "change": { + "actions": [ + "create" + ], + "before": { + "auto_create_network": true, + "billing_account": "012345-567890-ABCDEF", + "labels": { + "project-label-key-a": "project-label-val-a" + }, + "name": "My Project Name", + "org_id": "my-org", + "project_id": "foobar", + "timeouts": null + }, + "after": { + "auto_create_network": true, + "billing_account": "012345-567890-ABCDEF", + "labels": { + "project-label-key-a": "project-label-val-a" + }, + "name": "My Project Name", + "org_id": "my-org", + "project_id": "foobar", + "timeouts": null + }, + "after_unknown": { + "app_engine": true, + "folder_id": true, + "id": true, + "labels": { + }, + "number": true, + "policy_data": true, + "policy_etag": true, + "skip_delete": true + } + } + }, + { + "address": "google_project_iam_binding.my-test-project-binding", + "mode": "managed", + "type": "google_project_iam_binding", + "name": "my-test-project-binding", + "provider_name": "google", + "change": { + "actions": [ + "create" + ], + "before": { + "members": [ + "user:alice@example.com" + ], + "project": "foobar", + "role": "roles/browser" + }, + "after": { + "members": [ + "user:alice@example.com" + ], + "project": "foobar", + "role": "roles/browser" + }, + "after_unknown": { + "etag": true, + "id": true, + "members": [ + false + ] + } + } + }, + { + "address": "google_project_iam_member.my-test-project-member", + "mode": "managed", + "type": "google_project_iam_member", + "name": "my-test-project-member", + "provider_name": "google", + "change": { + "actions": [ + "create" + ], + "before": { + "member": "user:jane@example.com", + "project": "foobar", + "role": "roles/viewer" + }, + "after": { + "member": "user:jane@example.com", + "project": "foobar", + "role": "roles/viewer" + }, + "after_unknown": { + "etag": true, + "id": true + } + } + }, + { + "address": "google_project_iam_policy.my-test-project-policy", + "mode": "managed", + "type": "google_project_iam_policy", + "name": "my-test-project-policy", + "provider_name": "google", + "change": { + "actions": [ + "create" + ], + "before": { + "authoritative": null, + "disable_project": null, + "policy_data": "{\"bindings\":[{\"members\":[\"user:bob@example.com\"],\"role\":\"roles/editor\"}]}", + "project": "foobar" + }, + "after": { + "authoritative": null, + "disable_project": null, + "policy_data": "{\"bindings\":[{\"members\":[\"user:bob@example.com\"],\"role\":\"roles/editor\"}]}", + "project": "foobar" + }, + "after_unknown": { + "etag": true, + "id": true, + "restore_policy": true + } + } + }, + { + "address": "google_sql_database_instance.my-test-sql", + "mode": "managed", + "type": "google_sql_database_instance", + "name": "my-test-sql", + "provider_name": "google", + "change": { + "actions": [ + "create" + ], + "before": { + "database_version": "POSTGRES_9_6", + "name": "master-instance", + "region": "us-central1", + "settings": [ + { + "database_flags": [ + + ], + "disk_autoresize": true, + "maintenance_window": [ + + ], + "pricing_plan": "PER_USE", + "tier": "db-f1-micro", + "user_labels": null + } + ], + "timeouts": null + }, + "after": { + "database_version": "POSTGRES_9_6", + "name": "master-instance", + "region": "us-central1", + "settings": [ + { + "database_flags": [ + + ], + "disk_autoresize": true, + "maintenance_window": [ + + ], + "pricing_plan": "PER_USE", + "tier": "db-f1-micro", + "user_labels": null + } + ], + "timeouts": null + }, + "after_unknown": { + "connection_name": true, + "first_ip_address": true, + "id": true, + "ip_address": true, + "master_instance_name": true, + "private_ip_address": true, + "project": true, + "public_ip_address": true, + "replica_configuration": true, + "self_link": true, + "server_ca_cert": true, + "service_account_email_address": true, + "settings": [ + { + "activation_policy": true, + "availability_type": true, + "backup_configuration": true, + "database_flags": [ + + ], + "disk_size": true, + "disk_type": true, + "ip_configuration": true, + "location_preference": true, + "maintenance_window": [ + + ], + "version": true + } + ] + } + } + }, + { + "address": "google_storage_bucket.my-test-bucket", + "mode": "managed", + "type": "google_storage_bucket", + "name": "my-test-bucket", + "provider_name": "google", + "change": { + "actions": [ + "create" + ], + "before": { + "cors": [ + + ], + "encryption": [ + + ], + "force_destroy": false, + "labels": null, + "lifecycle_rule": [ + + ], + "location": "EU", + "logging": [ + + ], + "name": "test-bucket", + "predefined_acl": null, + "requester_pays": null, + "retention_policy": [ + + ], + "storage_class": "STANDARD", + "versioning": [ + + ], + "website": [ + { + "main_page_suffix": "index.html", + "not_found_page": "404.html" + } + ] + }, + "after": { + "cors": [ + + ], + "encryption": [ + + ], + "force_destroy": false, + "labels": null, + "lifecycle_rule": [ + + ], + "location": "EU", + "logging": [ + + ], + "name": "test-bucket", + "predefined_acl": null, + "requester_pays": null, + "retention_policy": [ + + ], + "storage_class": "STANDARD", + "versioning": [ + + ], + "website": [ + { + "main_page_suffix": "index.html", + "not_found_page": "404.html" + } + ] + }, + "after_unknown": { + "uniform_bucket_level_access": true, + "cors": [ + + ], + "encryption": [ + + ], + "id": true, + "lifecycle_rule": [ + + ], + "logging": [ + + ], + "project": true, + "retention_policy": [ + + ], + "self_link": true, + "url": true, + "versioning": [ + + ], + "website": [ + { + } + ] + } + } + } + ], + "prior_state": { + "format_version": "0.1", + "terraform_version": "0.12.6", + "values": { + "root_module": { + "resources": [ + { + "address": "data.google_iam_policy.admin", + "mode": "data", + "type": "google_iam_policy", + "name": "admin", + "provider_name": "google", + "schema_version": 0, + "values": { + "audit_config": null, + "binding": [ + { + "members": [ + "user:bob@example.com" + ], + "role": "roles/editor" + } + ], + "id": "2315450596", + "policy_data": "{\"bindings\":[{\"members\":[\"user:bob@example.com\"],\"role\":\"roles/editor\"}]}" + } + } + ] + } + } + }, + "configuration": { + "provider_config": { + "google": { + "name": "google", + "version_constraint": "~> 2.5", + "expressions": { + } + } + }, + "root_module": { + "resources": [ + { + "address": "google_compute_disk.my-disk-resource", + "mode": "managed", + "type": "google_compute_disk", + "name": "my-disk-resource", + "provider_config_key": "google", + "expressions": { + "image": { + "constant_value": "projects/debian-cloud/global/images/debian-8-jessie-v20170523" + }, + "labels": { + "constant_value": { + "disk-label-key-a": "disk-label-val-a" + } + }, + "name": { + "constant_value": "my-disk" + }, + "project": { + "constant_value": "foobar" + }, + "type": { + "constant_value": "pd-ssd" + }, + "zone": { + "constant_value": "projects/foobar/global/zones/us-central1-a" + } + }, + "schema_version": 0 + }, + { + "address": "google_compute_firewall.my-test-firewall", + "mode": "managed", + "type": "google_compute_firewall", + "name": "my-test-firewall", + "provider_config_key": "google", + "expressions": { + "allow": [ + { + "protocol": { + "constant_value": "icmp" + } + }, + { + "ports": { + "constant_value": [ + "80", + "8080", + "1000-2000" + ] + }, + "protocol": { + "constant_value": "tcp" + } + } + ], + "name": { + "constant_value": "my-test-firewall" + }, + "network": { + "constant_value": "default" + }, + "source_tags": { + "constant_value": [ + "web" + ] + } + }, + "schema_version": 1 + }, + { + "address": "google_compute_instance.my-test-instance", + "mode": "managed", + "type": "google_compute_instance", + "name": "my-test-instance", + "provider_config_key": "google", + "expressions": { + "boot_disk": [ + { + "initialize_params": [ + { + "image": { + "constant_value": "projects/debian-cloud/global/images/debian-8-jessie-v20170523" + } + } + ] + } + ], + "machine_type": { + "constant_value": "n1-standard-1" + }, + "metadata": { + "constant_value": { + "foo": "bar" + } + }, + "metadata_startup_script": { + "constant_value": "echo hi > /test.txt" + }, + "name": { + "constant_value": "my-instance" + }, + "network_interface": [ + { + "access_config": [ + { + } + ], + "network": { + "constant_value": "default" + } + } + ], + "project": { + "constant_value": "foobar" + }, + "scratch_disk": [ + { + } + ], + "service_account": [ + { + "scopes": { + "constant_value": [ + "userinfo-email", + "compute-ro", + "storage-ro" + ] + } + } + ], + "tags": { + "constant_value": [ + "foo", + "bar" + ] + }, + "zone": { + "constant_value": "projects/foobar/global/zones/us-central1-a" + } + }, + "schema_version": 6 + }, + { + "address": "google_folder_iam_binding.my-test-folder-binding", + "mode": "managed", + "type": "google_folder_iam_binding", + "name": "my-test-folder-binding", + "provider_config_key": "google", + "expressions": { + "folder": { + "constant_value": "my-folder" + }, + "members": { + "constant_value": [ + "user:alice@example.com" + ] + }, + "role": { + "constant_value": "roles/browser" + } + }, + "schema_version": 0 + }, + { + "address": "google_folder_iam_member.my-test-folder-member", + "mode": "managed", + "type": "google_folder_iam_member", + "name": "my-test-folder-member", + "provider_config_key": "google", + "expressions": { + "folder": { + "constant_value": "my-folder" + }, + "member": { + "constant_value": "user:jane@example.com" + }, + "role": { + "constant_value": "roles/viewer" + } + }, + "schema_version": 0 + }, + { + "address": "google_folder_iam_policy.my-test-folder-policy", + "mode": "managed", + "type": "google_folder_iam_policy", + "name": "my-test-folder-policy", + "provider_config_key": "google", + "expressions": { + "folder": { + "constant_value": "my-folder" + }, + "policy_data": { + "references": [ + "data.google_iam_policy.admin" + ] + } + }, + "schema_version": 0 + }, + { + "address": "google_organization_iam_binding.my-test-org-binding", + "mode": "managed", + "type": "google_organization_iam_binding", + "name": "my-test-org-binding", + "provider_config_key": "google", + "expressions": { + "members": { + "constant_value": [ + "user:alice@example.com" + ] + }, + "org_id": { + "constant_value": "123456789" + }, + "role": { + "constant_value": "roles/browser" + } + }, + "schema_version": 0 + }, + { + "address": "google_organization_iam_member.my-test-org-member", + "mode": "managed", + "type": "google_organization_iam_member", + "name": "my-test-org-member", + "provider_config_key": "google", + "expressions": { + "member": { + "constant_value": "user:jane@example.com" + }, + "org_id": { + "constant_value": "123456789" + }, + "role": { + "constant_value": "roles/viewer" + } + }, + "schema_version": 0 + }, + { + "address": "google_organization_iam_policy.my-test-org-policy", + "mode": "managed", + "type": "google_organization_iam_policy", + "name": "my-test-org-policy", + "provider_config_key": "google", + "expressions": { + "org_id": { + "constant_value": "123456789" + }, + "policy_data": { + "references": [ + "data.google_iam_policy.admin" + ] + } + }, + "schema_version": 0 + }, + { + "address": "google_project.my-project-resource", + "mode": "managed", + "type": "google_project", + "name": "my-project-resource", + "provider_config_key": "google", + "expressions": { + "billing_account": { + "constant_value": "012345-567890-ABCDEF" + }, + "labels": { + "constant_value": { + "project-label-key-a": "project-label-val-a" + } + }, + "name": { + "constant_value": "My Project Name" + }, + "org_id": { + "constant_value": "my-org" + }, + "project_id": { + "constant_value": "foobar" + } + }, + "schema_version": 1 + }, + { + "address": "google_project_iam_binding.my-test-project-binding", + "mode": "managed", + "type": "google_project_iam_binding", + "name": "my-test-project-binding", + "provider_config_key": "google", + "expressions": { + "members": { + "constant_value": [ + "user:alice@example.com" + ] + }, + "project": { + "constant_value": "foobar" + }, + "role": { + "constant_value": "roles/browser" + } + }, + "schema_version": 0 + }, + { + "address": "google_project_iam_member.my-test-project-member", + "mode": "managed", + "type": "google_project_iam_member", + "name": "my-test-project-member", + "provider_config_key": "google", + "expressions": { + "member": { + "constant_value": "user:jane@example.com" + }, + "project": { + "constant_value": "foobar" + }, + "role": { + "constant_value": "roles/viewer" + } + }, + "schema_version": 0 + }, + { + "address": "google_project_iam_policy.my-test-project-policy", + "mode": "managed", + "type": "google_project_iam_policy", + "name": "my-test-project-policy", + "provider_config_key": "google", + "expressions": { + "policy_data": { + "references": [ + "data.google_iam_policy.admin" + ] + }, + "project": { + "constant_value": "foobar" + } + }, + "schema_version": 0 + }, + { + "address": "google_sql_database_instance.my-test-sql", + "mode": "managed", + "type": "google_sql_database_instance", + "name": "my-test-sql", + "provider_config_key": "google", + "expressions": { + "database_version": { + "constant_value": "POSTGRES_9_6" + }, + "name": { + "constant_value": "master-instance" + }, + "region": { + "constant_value": "us-central1" + }, + "settings": [ + { + "tier": { + "constant_value": "db-f1-micro" + } + } + ] + }, + "schema_version": 0 + }, + { + "address": "google_storage_bucket.my-test-bucket", + "mode": "managed", + "type": "google_storage_bucket", + "name": "my-test-bucket", + "provider_config_key": "google", + "expressions": { + "location": { + "constant_value": "EU" + }, + "name": { + "constant_value": "test-bucket" + }, + "website": [ + { + "main_page_suffix": { + "constant_value": "index.html" + }, + "not_found_page": { + "constant_value": "404.html" + } + } + ] + }, + "schema_version": 0 + }, + { + "address": "data.google_iam_policy.admin", + "mode": "data", + "type": "google_iam_policy", + "name": "admin", + "provider_config_key": "google", + "expressions": { + "binding": [ + { + "members": { + "constant_value": [ + "user:bob@example.com" + ] + }, + "role": { + "constant_value": "roles/editor" + } + } + ] + }, + "schema_version": 0 + } + ] + } + } +} diff --git a/mmv1/third_party/validator/tests/source/read_planned_assets/tf0_12plan.applied.json b/mmv1/third_party/validator/tests/source/read_planned_assets/tf0_12plan.applied.json new file mode 100644 index 000000000000..af5380a1e079 --- /dev/null +++ b/mmv1/third_party/validator/tests/source/read_planned_assets/tf0_12plan.applied.json @@ -0,0 +1,1367 @@ +{ + "format_version": "0.1", + "terraform_version": "0.12.6", + "planned_values": { + "root_module": { + "resources": [ + { + "address": "google_compute_disk.my-disk", + "mode": "managed", + "type": "google_compute_disk", + "name": "my-disk", + "provider_name": "google", + "schema_version": 0, + "values": { + "creation_timestamp": "2021-08-02T06:07:23.718-07:00", + "description": "", + "disk_encryption_key": [], + "id": "projects/foobar/zones/us-central1-a/disks/my-disk", + "image": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-8-jessie-v20170523", + "label_fingerprint": "1TQLkowq0ZY=", + "labels": { + "foo": "bar" + }, + "last_attach_timestamp": "", + "last_detach_timestamp": "", + "name": "my-disk", + "physical_block_size_bytes": 4096, + "project": "foobar", + "self_link": "https://www.googleapis.com/compute/v1/projects/foobar/zones/us-central1-a/disks/my-disk", + "size": 10, + "snapshot": "", + "source_image_encryption_key": [], + "source_image_id": "2405673006522696145", + "source_snapshot_encryption_key": [], + "source_snapshot_id": "", + "timeouts": null, + "type": "pd-ssd", + "users": [], + "zone": "us-central1-a" + } + }, + { + "address": "google_compute_firewall.my-test-firewall", + "mode": "managed", + "type": "google_compute_firewall", + "name": "my-test-firewall", + "provider_name": "google", + "schema_version": 1, + "values": { + "allow": [ + { + "ports": [ + "80", + "8080", + "1000-2000" + ], + "protocol": "tcp" + }, + { + "ports": [], + "protocol": "icmp" + } + ], + "creation_timestamp": "2021-08-02T06:07:23.051-07:00", + "deny": [], + "description": "", + "destination_ranges": [], + "direction": "INGRESS", + "disabled": false, + "enable_logging": null, + "id": "projects/foobar/global/firewalls/my-test-firewall", + "log_config": [], + "name": "my-test-firewall", + "network": "https://www.googleapis.com/compute/v1/projects/foobar/global/networks/default", + "priority": 1000, + "project": "foobar", + "self_link": "https://www.googleapis.com/compute/v1/projects/foobar/global/firewalls/my-test-firewall", + "source_ranges": [], + "source_service_accounts": [], + "source_tags": [ + "web" + ], + "target_service_accounts": [], + "target_tags": [], + "timeouts": null + } + }, + { + "address": "google_folder.test", + "mode": "managed", + "type": "google_folder", + "name": "test", + "provider_name": "google", + "schema_version": 0, + "values": { + "create_time": "2021-08-02T13:01:04.329Z", + "display_name": "test-folder", + "folder_id": "567", + "id": "folders/567", + "lifecycle_state": "ACTIVE", + "name": "folders/567", + "parent": "organizations/123", + "timeouts": null + } + }, + { + "address": "google_project.my_project", + "mode": "managed", + "type": "google_project", + "name": "my_project", + "provider_name": "google", + "schema_version": 1, + "values": { + "auto_create_network": true, + "billing_account": "ABCDEF-GHIJKL-MNOPQR", + "folder_id": "567", + "id": "projects/foobar", + "labels": { + "project-label-key-a": "project-label-val-a" + }, + "name": "test-project", + "number": "345", + "org_id": "", + "project_id": "foobar", + "skip_delete": null, + "timeouts": null + } + }, + { + "address": "google_project_iam_binding.editors", + "mode": "managed", + "type": "google_project_iam_binding", + "name": "editors", + "provider_name": "google", + "schema_version": 0, + "values": { + "condition": [], + "etag": "BwXIk0AyogI=", + "id": "foobar/roles/editor", + "members": [ + "user:example-a@google.com" + ], + "project": "foobar", + "role": "roles/editor" + } + }, + { + "address": "google_project_iam_member.owner-a", + "mode": "managed", + "type": "google_project_iam_member", + "name": "owner-a", + "provider_name": "google", + "schema_version": 0, + "values": { + "condition": [], + "etag": "BwXIk0AyogI=", + "id": "foobar/roles/owner/user:example-a@google.com", + "member": "user:example-a@google.com", + "project": "foobar", + "role": "roles/owner" + } + }, + { + "address": "google_project_iam_member.viewer-a", + "mode": "managed", + "type": "google_project_iam_member", + "name": "viewer-a", + "provider_name": "google", + "schema_version": 0, + "values": { + "condition": [], + "etag": "BwXIk0AyogI=", + "id": "foobar/roles/viewer/user:example-a@google.com", + "member": "user:example-a@google.com", + "project": "foobar", + "role": "roles/viewer" + } + }, + { + "address": "google_project_iam_member.viewer-b", + "mode": "managed", + "type": "google_project_iam_member", + "name": "viewer-b", + "provider_name": "google", + "schema_version": 0, + "values": { + "condition": [], + "etag": "BwXIk0AyogI=", + "id": "foobar/roles/viewer/user:example-b@google.com", + "member": "user:example-b@google.com", + "project": "foobar", + "role": "roles/viewer" + } + }, + { + "address": "google_storage_bucket.my-bucket", + "mode": "managed", + "type": "google_storage_bucket", + "name": "my-bucket", + "provider_name": "google", + "schema_version": 0, + "values": { + "uniform_bucket_level_access": true, + "cors": [ + { + "max_age_seconds": 0, + "method": [ + "POST" + ], + "origin": [ + "*" + ], + "response_header": [] + } + ], + "default_event_based_hold": false, + "encryption": [], + "force_destroy": false, + "id": "my-bucket-99ab756ebb965442", + "labels": { + "foo": "bar" + }, + "lifecycle_rule": [], + "location": "US", + "logging": [], + "name": "my-bucket-99ab756ebb965442", + "project": "foobar", + "requester_pays": false, + "retention_policy": [], + "self_link": "https://www.googleapis.com/storage/v1/b/my-bucket-99ab756ebb965442", + "storage_class": "STANDARD", + "uniform_bucket_level_access": true, + "url": "gs://my-bucket-99ab756ebb965442", + "versioning": [], + "website": [ + { + "main_page_suffix": "index.html", + "not_found_page": "404.html" + } + ] + } + }, + { + "address": "random_id.bucket", + "mode": "managed", + "type": "random_id", + "name": "bucket", + "provider_name": "random", + "schema_version": 0, + "values": { + "b64_std": "mat1bruWVEI=", + "b64_url": "mat1bruWVEI", + "byte_length": 8, + "dec": "11073073227274540098", + "hex": "99ab756ebb965442", + "id": "mat1bruWVEI", + "keepers": null, + "prefix": null + } + } + ] + } + }, + "resource_changes": [ + { + "address": "google_compute_disk.my-disk", + "mode": "managed", + "type": "google_compute_disk", + "name": "my-disk", + "provider_name": "google", + "change": { + "actions": [ + "no-op" + ], + "before": { + "creation_timestamp": "2021-08-02T06:07:23.718-07:00", + "description": "", + "disk_encryption_key": [], + "id": "projects/foobar/zones/us-central1-a/disks/my-disk", + "image": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-8-jessie-v20170523", + "label_fingerprint": "1TQLkowq0ZY=", + "labels": { + "foo": "bar" + }, + "last_attach_timestamp": "", + "last_detach_timestamp": "", + "name": "my-disk", + "physical_block_size_bytes": 4096, + "project": "foobar", + "self_link": "https://www.googleapis.com/compute/v1/projects/foobar/zones/us-central1-a/disks/my-disk", + "size": 10, + "snapshot": "", + "source_image_encryption_key": [], + "source_image_id": "2405673006522696145", + "source_snapshot_encryption_key": [], + "source_snapshot_id": "", + "timeouts": null, + "type": "pd-ssd", + "users": [], + "zone": "us-central1-a" + }, + "after": { + "creation_timestamp": "2021-08-02T06:07:23.718-07:00", + "description": "", + "disk_encryption_key": [], + "id": "projects/foobar/zones/us-central1-a/disks/my-disk", + "image": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-8-jessie-v20170523", + "label_fingerprint": "1TQLkowq0ZY=", + "labels": { + "foo": "bar" + }, + "last_attach_timestamp": "", + "last_detach_timestamp": "", + "name": "my-disk", + "physical_block_size_bytes": 4096, + "project": "foobar", + "self_link": "https://www.googleapis.com/compute/v1/projects/foobar/zones/us-central1-a/disks/my-disk", + "size": 10, + "snapshot": "", + "source_image_encryption_key": [], + "source_image_id": "2405673006522696145", + "source_snapshot_encryption_key": [], + "source_snapshot_id": "", + "timeouts": null, + "type": "pd-ssd", + "users": [], + "zone": "us-central1-a" + }, + "after_unknown": {} + } + }, + { + "address": "google_compute_firewall.my-test-firewall", + "mode": "managed", + "type": "google_compute_firewall", + "name": "my-test-firewall", + "provider_name": "google", + "change": { + "actions": [ + "no-op" + ], + "before": { + "allow": [ + { + "ports": [ + "80", + "8080", + "1000-2000" + ], + "protocol": "tcp" + }, + { + "ports": [], + "protocol": "icmp" + } + ], + "creation_timestamp": "2021-08-02T06:07:23.051-07:00", + "deny": [], + "description": "", + "destination_ranges": [], + "direction": "INGRESS", + "disabled": false, + "enable_logging": null, + "id": "projects/foobar/global/firewalls/my-test-firewall", + "log_config": [], + "name": "my-test-firewall", + "network": "https://www.googleapis.com/compute/v1/projects/foobar/global/networks/default", + "priority": 1000, + "project": "foobar", + "self_link": "https://www.googleapis.com/compute/v1/projects/foobar/global/firewalls/my-test-firewall", + "source_ranges": [], + "source_service_accounts": [], + "source_tags": [ + "web" + ], + "target_service_accounts": [], + "target_tags": [], + "timeouts": null + }, + "after": { + "allow": [ + { + "ports": [ + "80", + "8080", + "1000-2000" + ], + "protocol": "tcp" + }, + { + "ports": [], + "protocol": "icmp" + } + ], + "creation_timestamp": "2021-08-02T06:07:23.051-07:00", + "deny": [], + "description": "", + "destination_ranges": [], + "direction": "INGRESS", + "disabled": false, + "enable_logging": null, + "id": "projects/foobar/global/firewalls/my-test-firewall", + "log_config": [], + "name": "my-test-firewall", + "network": "https://www.googleapis.com/compute/v1/projects/foobar/global/networks/default", + "priority": 1000, + "project": "foobar", + "self_link": "https://www.googleapis.com/compute/v1/projects/foobar/global/firewalls/my-test-firewall", + "source_ranges": [], + "source_service_accounts": [], + "source_tags": [ + "web" + ], + "target_service_accounts": [], + "target_tags": [], + "timeouts": null + }, + "after_unknown": {} + } + }, + { + "address": "google_folder.test", + "mode": "managed", + "type": "google_folder", + "name": "test", + "provider_name": "google", + "change": { + "actions": [ + "no-op" + ], + "before": { + "create_time": "2021-08-02T13:01:04.329Z", + "display_name": "test-folder", + "folder_id": "567", + "id": "folders/567", + "lifecycle_state": "ACTIVE", + "name": "folders/567", + "parent": "organizations/123", + "timeouts": null + }, + "after": { + "create_time": "2021-08-02T13:01:04.329Z", + "display_name": "test-folder", + "folder_id": "567", + "id": "folders/567", + "lifecycle_state": "ACTIVE", + "name": "folders/567", + "parent": "organizations/123", + "timeouts": null + }, + "after_unknown": {} + } + }, + { + "address": "google_project.my_project", + "mode": "managed", + "type": "google_project", + "name": "my_project", + "provider_name": "google", + "change": { + "actions": [ + "no-op" + ], + "before": { + "auto_create_network": true, + "billing_account": "ABCDEF-GHIJKL-MNOPQR", + "folder_id": "567", + "id": "projects/foobar", + "labels": { + "project-label-key-a": "project-label-val-a" + }, + "name": "test-project", + "number": "345", + "org_id": "", + "project_id": "foobar", + "skip_delete": null, + "timeouts": null + }, + "after": { + "auto_create_network": true, + "billing_account": "ABCDEF-GHIJKL-MNOPQR", + "folder_id": "567", + "id": "projects/foobar", + "labels": { + "project-label-key-a": "project-label-val-a" + }, + "name": "test-project", + "number": "345", + "org_id": "", + "project_id": "foobar", + "skip_delete": null, + "timeouts": null + }, + "after_unknown": {} + } + }, + { + "address": "google_project_iam_binding.editors", + "mode": "managed", + "type": "google_project_iam_binding", + "name": "editors", + "provider_name": "google", + "change": { + "actions": [ + "no-op" + ], + "before": { + "condition": [], + "etag": "BwXIk0AyogI=", + "id": "foobar/roles/editor", + "members": [ + "user:example-a@google.com" + ], + "project": "foobar", + "role": "roles/editor" + }, + "after": { + "condition": [], + "etag": "BwXIk0AyogI=", + "id": "foobar/roles/editor", + "members": [ + "user:example-a@google.com" + ], + "project": "foobar", + "role": "roles/editor" + }, + "after_unknown": {} + } + }, + { + "address": "google_project_iam_member.owner-a", + "mode": "managed", + "type": "google_project_iam_member", + "name": "owner-a", + "provider_name": "google", + "change": { + "actions": [ + "no-op" + ], + "before": { + "condition": [], + "etag": "BwXIk0AyogI=", + "id": "foobar/roles/owner/user:example-a@google.com", + "member": "user:example-a@google.com", + "project": "foobar", + "role": "roles/owner" + }, + "after": { + "condition": [], + "etag": "BwXIk0AyogI=", + "id": "foobar/roles/owner/user:example-a@google.com", + "member": "user:example-a@google.com", + "project": "foobar", + "role": "roles/owner" + }, + "after_unknown": {} + } + }, + { + "address": "google_project_iam_member.viewer-a", + "mode": "managed", + "type": "google_project_iam_member", + "name": "viewer-a", + "provider_name": "google", + "change": { + "actions": [ + "no-op" + ], + "before": { + "condition": [], + "etag": "BwXIk0AyogI=", + "id": "foobar/roles/viewer/user:example-a@google.com", + "member": "user:example-a@google.com", + "project": "foobar", + "role": "roles/viewer" + }, + "after": { + "condition": [], + "etag": "BwXIk0AyogI=", + "id": "foobar/roles/viewer/user:example-a@google.com", + "member": "user:example-a@google.com", + "project": "foobar", + "role": "roles/viewer" + }, + "after_unknown": {} + } + }, + { + "address": "google_project_iam_member.viewer-b", + "mode": "managed", + "type": "google_project_iam_member", + "name": "viewer-b", + "provider_name": "google", + "change": { + "actions": [ + "no-op" + ], + "before": { + "condition": [], + "etag": "BwXIk0AyogI=", + "id": "foobar/roles/viewer/user:example-b@google.com", + "member": "user:example-b@google.com", + "project": "foobar", + "role": "roles/viewer" + }, + "after": { + "condition": [], + "etag": "BwXIk0AyogI=", + "id": "foobar/roles/viewer/user:example-b@google.com", + "member": "user:example-b@google.com", + "project": "foobar", + "role": "roles/viewer" + }, + "after_unknown": {} + } + }, + { + "address": "google_storage_bucket.my-bucket", + "mode": "managed", + "type": "google_storage_bucket", + "name": "my-bucket", + "provider_name": "google", + "change": { + "actions": [ + "no-op" + ], + "before": { + "uniform_bucket_level_access": true, + "cors": [ + { + "max_age_seconds": 0, + "method": [ + "POST" + ], + "origin": [ + "*" + ], + "response_header": [] + } + ], + "default_event_based_hold": false, + "encryption": [], + "force_destroy": false, + "id": "my-bucket-99ab756ebb965442", + "labels": { + "foo": "bar" + }, + "lifecycle_rule": [], + "location": "US", + "logging": [], + "name": "my-bucket-99ab756ebb965442", + "project": "foobar", + "requester_pays": false, + "retention_policy": [], + "self_link": "https://www.googleapis.com/storage/v1/b/my-bucket-99ab756ebb965442", + "storage_class": "STANDARD", + "uniform_bucket_level_access": true, + "url": "gs://my-bucket-99ab756ebb965442", + "versioning": [], + "website": [ + { + "main_page_suffix": "index.html", + "not_found_page": "404.html" + } + ] + }, + "after": { + "uniform_bucket_level_access": true, + "cors": [ + { + "max_age_seconds": 0, + "method": [ + "POST" + ], + "origin": [ + "*" + ], + "response_header": [] + } + ], + "default_event_based_hold": false, + "encryption": [], + "force_destroy": false, + "id": "my-bucket-99ab756ebb965442", + "labels": { + "foo": "bar" + }, + "lifecycle_rule": [], + "location": "US", + "logging": [], + "name": "my-bucket-99ab756ebb965442", + "project": "foobar", + "requester_pays": false, + "retention_policy": [], + "self_link": "https://www.googleapis.com/storage/v1/b/my-bucket-99ab756ebb965442", + "storage_class": "STANDARD", + "uniform_bucket_level_access": true, + "url": "gs://my-bucket-99ab756ebb965442", + "versioning": [], + "website": [ + { + "main_page_suffix": "index.html", + "not_found_page": "404.html" + } + ] + }, + "after_unknown": {} + } + }, + { + "address": "random_id.bucket", + "mode": "managed", + "type": "random_id", + "name": "bucket", + "provider_name": "random", + "change": { + "actions": [ + "no-op" + ], + "before": { + "b64_std": "mat1bruWVEI=", + "b64_url": "mat1bruWVEI", + "byte_length": 8, + "dec": "11073073227274540098", + "hex": "99ab756ebb965442", + "id": "mat1bruWVEI", + "keepers": null, + "prefix": null + }, + "after": { + "b64_std": "mat1bruWVEI=", + "b64_url": "mat1bruWVEI", + "byte_length": 8, + "dec": "11073073227274540098", + "hex": "99ab756ebb965442", + "id": "mat1bruWVEI", + "keepers": null, + "prefix": null + }, + "after_unknown": {} + } + } + ], + "output_changes": { + "org_id": { + "actions": [ + "create" + ], + "before": null, + "after": "123", + "after_unknown": false + }, + "project_id": { + "actions": [ + "create" + ], + "before": null, + "after": "foobar", + "after_unknown": false + } + }, + "prior_state": { + "format_version": "0.1", + "terraform_version": "0.12.6", + "values": { + "outputs": { + "org_id": { + "sensitive": false, + "value": "123" + }, + "project_id": { + "sensitive": false, + "value": "foobar" + } + }, + "root_module": { + "resources": [ + { + "address": "google_compute_disk.my-disk", + "mode": "managed", + "type": "google_compute_disk", + "name": "my-disk", + "provider_name": "google", + "schema_version": 0, + "values": { + "creation_timestamp": "2021-08-02T06:07:23.718-07:00", + "description": "", + "disk_encryption_key": [], + "id": "projects/foobar/zones/us-central1-a/disks/my-disk", + "image": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-8-jessie-v20170523", + "label_fingerprint": "1TQLkowq0ZY=", + "labels": { + "foo": "bar" + }, + "last_attach_timestamp": "", + "last_detach_timestamp": "", + "name": "my-disk", + "physical_block_size_bytes": 4096, + "project": "foobar", + "self_link": "https://www.googleapis.com/compute/v1/projects/foobar/zones/us-central1-a/disks/my-disk", + "size": 10, + "snapshot": "", + "source_image_encryption_key": [], + "source_image_id": "2405673006522696145", + "source_snapshot_encryption_key": [], + "source_snapshot_id": "", + "timeouts": null, + "type": "pd-ssd", + "users": [], + "zone": "us-central1-a" + } + }, + { + "address": "google_compute_firewall.my-test-firewall", + "mode": "managed", + "type": "google_compute_firewall", + "name": "my-test-firewall", + "provider_name": "google", + "schema_version": 1, + "values": { + "allow": [ + { + "ports": [ + "80", + "8080", + "1000-2000" + ], + "protocol": "tcp" + }, + { + "ports": [], + "protocol": "icmp" + } + ], + "creation_timestamp": "2021-08-02T06:07:23.051-07:00", + "deny": [], + "description": "", + "destination_ranges": [], + "direction": "INGRESS", + "disabled": false, + "enable_logging": null, + "id": "projects/foobar/global/firewalls/my-test-firewall", + "log_config": [], + "name": "my-test-firewall", + "network": "https://www.googleapis.com/compute/v1/projects/foobar/global/networks/default", + "priority": 1000, + "project": "foobar", + "self_link": "https://www.googleapis.com/compute/v1/projects/foobar/global/firewalls/my-test-firewall", + "source_ranges": [], + "source_service_accounts": [], + "source_tags": [ + "web" + ], + "target_service_accounts": [], + "target_tags": [], + "timeouts": null + } + }, + { + "address": "google_folder.test", + "mode": "managed", + "type": "google_folder", + "name": "test", + "provider_name": "google", + "schema_version": 0, + "values": { + "create_time": "2021-08-02T13:01:04.329Z", + "display_name": "test-folder", + "folder_id": "567", + "id": "folders/567", + "lifecycle_state": "ACTIVE", + "name": "folders/567", + "parent": "organizations/123", + "timeouts": null + } + }, + { + "address": "google_project.my_project", + "mode": "managed", + "type": "google_project", + "name": "my_project", + "provider_name": "google", + "schema_version": 1, + "values": { + "auto_create_network": true, + "billing_account": "ABCDEF-GHIJKL-MNOPQR", + "folder_id": "567", + "id": "projects/foobar", + "labels": { + "project-label-key-a": "project-label-val-a" + }, + "name": "test-project", + "number": "345", + "org_id": "", + "project_id": "foobar", + "skip_delete": null, + "timeouts": null + }, + "depends_on": [ + "google_folder.test" + ] + }, + { + "address": "google_project_iam_binding.editors", + "mode": "managed", + "type": "google_project_iam_binding", + "name": "editors", + "provider_name": "google", + "schema_version": 0, + "values": { + "condition": [], + "etag": "BwXIk0AyogI=", + "id": "foobar/roles/editor", + "members": [ + "user:example-a@google.com" + ], + "project": "foobar", + "role": "roles/editor" + } + }, + { + "address": "google_project_iam_member.owner-a", + "mode": "managed", + "type": "google_project_iam_member", + "name": "owner-a", + "provider_name": "google", + "schema_version": 0, + "values": { + "condition": [], + "etag": "BwXIk0AyogI=", + "id": "foobar/roles/owner/user:example-a@google.com", + "member": "user:example-a@google.com", + "project": "foobar", + "role": "roles/owner" + } + }, + { + "address": "google_project_iam_member.viewer-a", + "mode": "managed", + "type": "google_project_iam_member", + "name": "viewer-a", + "provider_name": "google", + "schema_version": 0, + "values": { + "condition": [], + "etag": "BwXIk0AyogI=", + "id": "foobar/roles/viewer/user:example-a@google.com", + "member": "user:example-a@google.com", + "project": "foobar", + "role": "roles/viewer" + } + }, + { + "address": "google_project_iam_member.viewer-b", + "mode": "managed", + "type": "google_project_iam_member", + "name": "viewer-b", + "provider_name": "google", + "schema_version": 0, + "values": { + "condition": [], + "etag": "BwXIk0AyogI=", + "id": "foobar/roles/viewer/user:example-b@google.com", + "member": "user:example-a@google.com", + "project": "foobar", + "role": "roles/viewer" + } + }, + { + "address": "google_storage_bucket.my-bucket", + "mode": "managed", + "type": "google_storage_bucket", + "name": "my-bucket", + "provider_name": "google", + "schema_version": 0, + "values": { + "uniform_bucket_level_access": true, + "cors": [ + { + "max_age_seconds": 0, + "method": [ + "POST" + ], + "origin": [ + "*" + ], + "response_header": [] + } + ], + "default_event_based_hold": false, + "encryption": [], + "force_destroy": false, + "id": "my-bucket-99ab756ebb965442", + "labels": { + "foo": "bar" + }, + "lifecycle_rule": [], + "location": "US", + "logging": [], + "name": "my-bucket-99ab756ebb965442", + "project": "foobar", + "requester_pays": false, + "retention_policy": [], + "self_link": "https://www.googleapis.com/storage/v1/b/my-bucket-99ab756ebb965442", + "storage_class": "STANDARD", + "uniform_bucket_level_access": true, + "url": "gs://my-bucket-99ab756ebb965442", + "versioning": [], + "website": [ + { + "main_page_suffix": "index.html", + "not_found_page": "404.html" + } + ] + }, + "depends_on": [ + "random_id.bucket" + ] + }, + { + "address": "random_id.bucket", + "mode": "managed", + "type": "random_id", + "name": "bucket", + "provider_name": "random", + "schema_version": 0, + "values": { + "b64_std": "mat1bruWVEI=", + "b64_url": "mat1bruWVEI", + "byte_length": 8, + "dec": "11073073227274540098", + "hex": "99ab756ebb965442", + "id": "mat1bruWVEI", + "keepers": null, + "prefix": null + } + } + ] + } + } + }, + "configuration": { + "provider_config": { + "google": { + "name": "google", + "expressions": { + "project": { + "references": [ + "var.project_id" + ] + } + } + } + }, + "root_module": { + "outputs": { + "org_id": { + "expression": { + "references": [ + "var.org_id" + ] + } + }, + "project_id": { + "expression": { + "references": [ + "var.project_id" + ] + } + } + }, + "resources": [ + { + "address": "google_compute_disk.my-disk", + "mode": "managed", + "type": "google_compute_disk", + "name": "my-disk", + "provider_config_key": "google", + "expressions": { + "image": { + "constant_value": "debian-8-jessie-v20170523" + }, + "labels": { + "constant_value": { + "foo": "bar" + } + }, + "name": { + "constant_value": "my-disk" + }, + "project": { + "references": [ + "var.project_id" + ] + }, + "type": { + "constant_value": "pd-ssd" + }, + "zone": { + "constant_value": "us-central1-a" + } + }, + "schema_version": 0 + }, + { + "address": "google_compute_firewall.my-test-firewall", + "mode": "managed", + "type": "google_compute_firewall", + "name": "my-test-firewall", + "provider_config_key": "google", + "expressions": { + "allow": [ + { + "protocol": { + "constant_value": "icmp" + } + }, + { + "ports": { + "constant_value": [ + "80", + "8080", + "1000-2000" + ] + }, + "protocol": { + "constant_value": "tcp" + } + } + ], + "name": { + "constant_value": "my-test-firewall" + }, + "network": { + "constant_value": "default" + }, + "project": { + "references": [ + "var.project_id" + ] + }, + "source_tags": { + "constant_value": [ + "web" + ] + } + }, + "schema_version": 1 + }, + { + "address": "google_folder.test", + "mode": "managed", + "type": "google_folder", + "name": "test", + "provider_config_key": "google", + "expressions": { + "display_name": { + "constant_value": "test-folder" + }, + "parent": { + "references": [ + "var.org_id" + ] + } + }, + "schema_version": 0 + }, + { + "address": "google_project.my_project", + "mode": "managed", + "type": "google_project", + "name": "my_project", + "provider_config_key": "google", + "expressions": { + "billing_account": { + "constant_value": "ABCDEF-GHIJKL-MNOPQR" + }, + "folder_id": { + "references": [ + "google_folder.test" + ] + }, + "labels": { + "constant_value": { + "project-label-key-a": "project-label-val-a" + } + }, + "name": { + "constant_value": "test-project" + }, + "project_id": { + "references": [ + "var.project_id" + ] + } + }, + "schema_version": 1 + }, + { + "address": "google_project_iam_binding.editors", + "mode": "managed", + "type": "google_project_iam_binding", + "name": "editors", + "provider_config_key": "google", + "expressions": { + "members": { + "constant_value": [ + "user:example-a@google.com", + "user:example-b@google.com" + ] + }, + "project": { + "references": [ + "var.project_id" + ] + }, + "role": { + "constant_value": "roles/editor" + } + }, + "schema_version": 0 + }, + { + "address": "google_project_iam_member.owner-a", + "mode": "managed", + "type": "google_project_iam_member", + "name": "owner-a", + "provider_config_key": "google", + "expressions": { + "member": { + "constant_value": "user:example-a@google.com" + }, + "project": { + "references": [ + "var.project_id" + ] + }, + "role": { + "constant_value": "roles/owner" + } + }, + "schema_version": 0 + }, + { + "address": "google_project_iam_member.viewer-a", + "mode": "managed", + "type": "google_project_iam_member", + "name": "viewer-a", + "provider_config_key": "google", + "expressions": { + "member": { + "constant_value": "user:example-a@google.com" + }, + "project": { + "references": [ + "var.project_id" + ] + }, + "role": { + "constant_value": "roles/viewer" + } + }, + "schema_version": 0 + }, + { + "address": "google_project_iam_member.viewer-b", + "mode": "managed", + "type": "google_project_iam_member", + "name": "viewer-b", + "provider_config_key": "google", + "expressions": { + "member": { + "constant_value": "user:example-b@google.com" + }, + "project": { + "references": [ + "var.project_id" + ] + }, + "role": { + "constant_value": "roles/viewer" + } + }, + "schema_version": 0 + }, + { + "address": "google_storage_bucket.my-bucket", + "mode": "managed", + "type": "google_storage_bucket", + "name": "my-bucket", + "provider_config_key": "google", + "expressions": { + "cors": [ + { + "method": { + "constant_value": [ + "POST" + ] + }, + "origin": { + "constant_value": [ + "*" + ] + } + } + ], + "labels": { + "constant_value": { + "foo": "bar" + } + }, + "location": { + "constant_value": "US" + }, + "name": { + "references": [ + "random_id.bucket" + ] + }, + "project": { + "references": [ + "var.project_id" + ] + }, + "uniform_bucket_level_access": { + "constant_value": true + }, + "website": [ + { + "main_page_suffix": { + "constant_value": "index.html" + }, + "not_found_page": { + "constant_value": "404.html" + } + } + ] + }, + "schema_version": 0 + }, + { + "address": "random_id.bucket", + "mode": "managed", + "type": "random_id", + "name": "bucket", + "provider_config_key": "random", + "expressions": { + "byte_length": { + "constant_value": 8 + } + }, + "schema_version": 0 + } + ], + "variables": { + "org_id": { + "default": "123", + "description": "The organization ID use for creating resources." + }, + "project_id": { + "default": "foobar", + "description": "The project to create resources inside of." + } + } + } + } +} \ No newline at end of file diff --git a/mmv1/third_party/validator/tests/source/read_planned_assets/tf0_12plan.json b/mmv1/third_party/validator/tests/source/read_planned_assets/tf0_12plan.json new file mode 100644 index 000000000000..2b8b10a373bf --- /dev/null +++ b/mmv1/third_party/validator/tests/source/read_planned_assets/tf0_12plan.json @@ -0,0 +1,390 @@ +{ + "format_version": "0.1", + "terraform_version": "0.12.4", + "planned_values": { + "root_module": { + "resources": [ + { + "address": "google_compute_firewall.default", + "mode": "managed", + "type": "google_compute_firewall", + "name": "default", + "provider_name": "google", + "schema_version": 1, + "values": { + "allow": [ + { + "ports": [ + "82", + "8080", + "1000-2000" + ], + "protocol": "tcp" + } + ], + "creation_timestamp": "2019-07-23T04:06:22.114-07:00", + "deny": [], + "description": "", + "destination_ranges": [], + "direction": "INGRESS", + "disabled": false, + "id": "test-firewall", + "name": "test-firewall", + "network": "https://www.googleapis.com/compute/v1/projects/gl-akopachevskyy-sql-db/global/networks/default", + "priority": 1000, + "project": "gl-akopachevskyy-sql-db", + "self_link": "https://www.googleapis.com/compute/v1/projects/gl-akopachevskyy-sql-db/global/firewalls/test-firewall", + "source_ranges": [], + "source_service_accounts": [], + "source_tags": [ + "web" + ], + "target_service_accounts": [], + "target_tags": [], + "timeouts": null + } + } + ], + "child_modules": [ + { + "resources": [ + { + "address": "module.mymodule.google_compute_firewall.http", + "mode": "managed", + "type": "google_compute_firewall", + "name": "http", + "provider_name": "google", + "schema_version": 1, + "values": { + "allow": [ + { + "ports": [ + "8181" + ], + "protocol": "udp" + } + ], + "deny": [], + "description": null, + "disabled": null, + "name": "server-fiewall", + "network": "default", + "priority": 1000, + "source_service_accounts": null, + "source_tags": [ + "server" + ], + "target_service_accounts": null, + "target_tags": null, + "timeouts": null + } + } + ], + "address": "module.mymodule" + } + ] + } + }, + "resource_changes": [ + { + "address": "google_compute_firewall.default", + "mode": "managed", + "type": "google_compute_firewall", + "name": "default", + "provider_name": "google", + "change": { + "actions": [ + "create" + ], + "before": { + "allow": [ + { + "ports": [ + "82", + "8080", + "1000-2000" + ], + "protocol": "tcp" + } + ], + "creation_timestamp": "2019-07-23T04:06:22.114-07:00", + "deny": [], + "description": "", + "destination_ranges": [], + "direction": "INGRESS", + "disabled": false, + "id": "test-firewall", + "name": "test-firewall", + "network": "https://www.googleapis.com/compute/v1/projects/gl-akopachevskyy-sql-db/global/networks/default", + "priority": 1000, + "project": "gl-akopachevskyy-sql-db", + "self_link": "https://www.googleapis.com/compute/v1/projects/gl-akopachevskyy-sql-db/global/firewalls/test-firewall", + "source_ranges": [], + "source_service_accounts": [], + "source_tags": [ + "web" + ], + "target_service_accounts": [], + "target_tags": [], + "timeouts": null + }, + "after": { + "allow": [ + { + "ports": [ + "82", + "8080", + "1000-2000" + ], + "protocol": "tcp" + } + ], + "creation_timestamp": "2019-07-23T04:06:22.114-07:00", + "deny": [], + "description": "", + "destination_ranges": [], + "direction": "INGRESS", + "disabled": false, + "id": "test-firewall", + "name": "test-firewall", + "network": "https://www.googleapis.com/compute/v1/projects/gl-akopachevskyy-sql-db/global/networks/default", + "priority": 1000, + "project": "gl-akopachevskyy-sql-db", + "self_link": "https://www.googleapis.com/compute/v1/projects/gl-akopachevskyy-sql-db/global/firewalls/test-firewall", + "source_ranges": [], + "source_service_accounts": [], + "source_tags": [ + "web" + ], + "target_service_accounts": [], + "target_tags": [], + "timeouts": null + }, + "after_unknown": {} + } + }, + { + "address": "module.mymodule.google_compute_firewall.http", + "module_address": "module.mymodule", + "mode": "managed", + "type": "google_compute_firewall", + "name": "http", + "provider_name": "google", + "change": { + "actions": [ + "create" + ], + "before": { + "allow": [ + { + "ports": [ + "8181" + ], + "protocol": "udp" + } + ], + "deny": [], + "description": null, + "disabled": null, + "name": "server-fiewall", + "network": "default", + "priority": 1000, + "source_service_accounts": null, + "source_tags": [ + "server" + ], + "target_service_accounts": null, + "target_tags": null, + "timeouts": null + }, + "after": { + "allow": [ + { + "ports": [ + "8181" + ], + "protocol": "udp" + } + ], + "deny": [], + "description": null, + "disabled": null, + "name": "server-fiewall", + "network": "default", + "priority": 1000, + "source_service_accounts": null, + "source_tags": [ + "server" + ], + "target_service_accounts": null, + "target_tags": null, + "timeouts": null + }, + "after_unknown": { + "allow": [ + { + "ports": [ + false + ] + } + ], + "creation_timestamp": true, + "deny": [], + "destination_ranges": true, + "direction": true, + "id": true, + "project": true, + "self_link": true, + "source_ranges": true, + "source_tags": [ + false + ] + } + } + } + ], + "prior_state": { + "format_version": "0.1", + "terraform_version": "0.12.4", + "values": { + "root_module": { + "resources": [ + { + "address": "google_compute_firewall.default", + "mode": "managed", + "type": "google_compute_firewall", + "name": "default", + "provider_name": "google", + "schema_version": 1, + "values": { + "allow": [ + { + "ports": [ + "82", + "8080", + "1000-2000" + ], + "protocol": "tcp" + } + ], + "creation_timestamp": "2019-07-23T04:06:22.114-07:00", + "deny": [], + "description": "", + "destination_ranges": [], + "direction": "INGRESS", + "disabled": false, + "id": "test-firewall", + "name": "test-firewall", + "network": "https://www.googleapis.com/compute/v1/projects/gl-akopachevskyy-sql-db/global/networks/default", + "priority": 1000, + "project": "gl-akopachevskyy-sql-db", + "self_link": "https://www.googleapis.com/compute/v1/projects/gl-akopachevskyy-sql-db/global/firewalls/test-firewall", + "source_ranges": [], + "source_service_accounts": [], + "source_tags": [ + "web" + ], + "target_service_accounts": [], + "target_tags": [], + "timeouts": null + } + } + ] + } + } + }, + "configuration": { + "provider_config": { + "google": { + "name": "google", + "version_constraint": "~\u003e 2.5", + "expressions": { + "project": { + "constant_value": "gl-akopachevskyy-sql-db" + } + } + } + }, + "root_module": { + "resources": [ + { + "address": "google_compute_firewall.default", + "mode": "managed", + "type": "google_compute_firewall", + "name": "default", + "provider_config_key": "google", + "expressions": { + "allow": [ + { + "ports": { + "constant_value": [ + "82", + "8080", + "1000-2000" + ] + }, + "protocol": { + "constant_value": "tcp" + } + } + ], + "name": { + "constant_value": "test-firewall" + }, + "network": { + "constant_value": "default" + }, + "source_tags": { + "constant_value": [ + "web" + ] + } + }, + "schema_version": 1 + } + ], + "module_calls": { + "mymodule": { + "source": "./module", + "module": { + "resources": [ + { + "address": "google_compute_firewall.http", + "mode": "managed", + "type": "google_compute_firewall", + "name": "http", + "provider_config_key": "mymodule:google", + "expressions": { + "allow": [ + { + "ports": { + "constant_value": [ + "8181" + ] + }, + "protocol": { + "constant_value": "udp" + } + } + ], + "name": { + "constant_value": "server-fiewall" + }, + "network": { + "constant_value": "default" + }, + "source_tags": { + "constant_value": [ + "server" + ] + } + }, + "schema_version": 1 + } + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/mmv1/third_party/validator/tests/source/read_planned_assets/tf1_0plan.allcoverage.json b/mmv1/third_party/validator/tests/source/read_planned_assets/tf1_0plan.allcoverage.json new file mode 100644 index 000000000000..72a04a6dd156 --- /dev/null +++ b/mmv1/third_party/validator/tests/source/read_planned_assets/tf1_0plan.allcoverage.json @@ -0,0 +1,1738 @@ +{ + "format_version": "0.2", + "terraform_version": "1.0.1", + "planned_values": { + "root_module": { + "resources": [ + { + "address": "google_compute_disk.my-disk-resource", + "mode": "managed", + "type": "google_compute_disk", + "name": "my-disk-resource", + "provider_name": "google", + "schema_version": 0, + "values": { + "description": null, + "disk_encryption_key": [ + + ], + "disk_encryption_key_raw": null, + "image": "projects/debian-cloud/global/images/debian-8-jessie-v20170523", + "labels": { + "disk-label-key-a": "disk-label-val-a" + }, + "name": "my-disk", + "project": "foobar", + "snapshot": null, + "source_image_encryption_key": [ + + ], + "source_snapshot_encryption_key": [ + + ], + "timeouts": null, + "type": "pd-ssd", + "zone": "projects/foobar/global/zones/us-central1-a" + } + }, + { + "address": "google_compute_firewall.my-test-firewall", + "mode": "managed", + "type": "google_compute_firewall", + "name": "my-test-firewall", + "provider_name": "google", + "schema_version": 1, + "values": { + "allow": [ + { + "ports": [ + "80", + "8080", + "1000-2000" + ], + "protocol": "tcp" + }, + { + "ports": [ + + ], + "protocol": "icmp" + } + ], + "deny": [ + + ], + "description": null, + "disabled": null, + "name": "my-test-firewall", + "network": "default", + "priority": 1000, + "source_service_accounts": null, + "source_tags": [ + "web" + ], + "target_service_accounts": null, + "target_tags": null, + "timeouts": null + } + }, + { + "address": "google_compute_instance.my-test-instance", + "mode": "managed", + "type": "google_compute_instance", + "name": "my-test-instance", + "provider_name": "google", + "schema_version": 6, + "values": { + "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-8-jessie-v20170523" + } + ] + } + ], + "can_ip_forward": false, + "deletion_protection": false, + "description": null, + "disk": [ + + ], + "hostname": null, + "labels": null, + "machine_type": "n1-standard-1", + "metadata": { + "foo": "bar" + }, + "metadata_startup_script": "echo hi > /test.txt", + "min_cpu_platform": null, + "name": "my-instance", + "network_interface": [ + { + "access_config": [ + { + "public_ptr_domain_name": null + } + ], + "alias_ip_range": [ + + ], + "network": "default" + } + ], + "project": "foobar", + "scratch_disk": [ + { + "interface": "SCSI" + } + ], + "service_account": [ + { + "scopes": [ + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/userinfo.email" + ] + } + ], + "shielded_instance_config": [ + + ], + "tags": [ + "bar", + "foo" + ], + "timeouts": null, + "zone": "projects/foobar/global/zones/us-central1-a" + } + }, + { + "address": "google_folder_iam_binding.my-test-folder-binding", + "mode": "managed", + "type": "google_folder_iam_binding", + "name": "my-test-folder-binding", + "provider_name": "google", + "schema_version": 0, + "values": { + "folder": "my-folder", + "members": [ + "user:alice@example.com" + ], + "role": "roles/browser" + } + }, + { + "address": "google_folder_iam_member.my-test-folder-member", + "mode": "managed", + "type": "google_folder_iam_member", + "name": "my-test-folder-member", + "provider_name": "google", + "schema_version": 0, + "values": { + "folder": "my-folder", + "member": "user:jane@example.com", + "role": "roles/viewer" + } + }, + { + "address": "google_folder_iam_policy.my-test-folder-policy", + "mode": "managed", + "type": "google_folder_iam_policy", + "name": "my-test-folder-policy", + "provider_name": "google", + "schema_version": 0, + "values": { + "folder": "my-folder", + "policy_data": "{\"bindings\":[{\"members\":[\"user:bob@example.com\"],\"role\":\"roles/editor\"}]}" + } + }, + { + "address": "google_organization_iam_binding.my-test-org-binding", + "mode": "managed", + "type": "google_organization_iam_binding", + "name": "my-test-org-binding", + "provider_name": "google", + "schema_version": 0, + "values": { + "members": [ + "user:alice@example.com" + ], + "org_id": "123456789", + "role": "roles/browser" + } + }, + { + "address": "google_organization_iam_member.my-test-org-member", + "mode": "managed", + "type": "google_organization_iam_member", + "name": "my-test-org-member", + "provider_name": "google", + "schema_version": 0, + "values": { + "member": "user:jane@example.com", + "org_id": "123456789", + "role": "roles/viewer" + } + }, + { + "address": "google_organization_iam_policy.my-test-org-policy", + "mode": "managed", + "type": "google_organization_iam_policy", + "name": "my-test-org-policy", + "provider_name": "google", + "schema_version": 0, + "values": { + "org_id": "123456789", + "policy_data": "{\"bindings\":[{\"members\":[\"user:bob@example.com\"],\"role\":\"roles/editor\"}]}" + } + }, + { + "address": "google_project.my-project-resource", + "mode": "managed", + "type": "google_project", + "name": "my-project-resource", + "provider_name": "google", + "schema_version": 1, + "values": { + "auto_create_network": true, + "billing_account": "012345-567890-ABCDEF", + "labels": { + "project-label-key-a": "project-label-val-a" + }, + "name": "My Project Name", + "org_id": "my-org", + "project_id": "foobar", + "timeouts": null + } + }, + { + "address": "google_project_iam_binding.my-test-project-binding", + "mode": "managed", + "type": "google_project_iam_binding", + "name": "my-test-project-binding", + "provider_name": "google", + "schema_version": 0, + "values": { + "members": [ + "user:alice@example.com" + ], + "project": "foobar", + "role": "roles/browser" + } + }, + { + "address": "google_project_iam_member.my-test-project-member", + "mode": "managed", + "type": "google_project_iam_member", + "name": "my-test-project-member", + "provider_name": "google", + "schema_version": 0, + "values": { + "member": "user:jane@example.com", + "project": "foobar", + "role": "roles/viewer" + } + }, + { + "address": "google_project_iam_policy.my-test-project-policy", + "mode": "managed", + "type": "google_project_iam_policy", + "name": "my-test-project-policy", + "provider_name": "google", + "schema_version": 0, + "values": { + "authoritative": null, + "disable_project": null, + "policy_data": "{\"bindings\":[{\"members\":[\"user:bob@example.com\"],\"role\":\"roles/editor\"}]}", + "project": "foobar" + } + }, + { + "address": "google_sql_database_instance.my-test-sql", + "mode": "managed", + "type": "google_sql_database_instance", + "name": "my-test-sql", + "provider_name": "google", + "schema_version": 0, + "values": { + "database_version": "POSTGRES_9_6", + "name": "master-instance", + "region": "us-central1", + "settings": [ + { + "database_flags": [ + + ], + "disk_autoresize": true, + "maintenance_window": [ + + ], + "pricing_plan": "PER_USE", + "tier": "db-f1-micro", + "user_labels": null + } + ], + "timeouts": null + } + }, + { + "address": "google_storage_bucket.my-test-bucket", + "mode": "managed", + "type": "google_storage_bucket", + "name": "my-test-bucket", + "provider_name": "google", + "schema_version": 0, + "values": { + "cors": [ + + ], + "encryption": [ + + ], + "force_destroy": false, + "labels": null, + "lifecycle_rule": [ + + ], + "location": "EU", + "logging": [ + + ], + "name": "test-bucket", + "predefined_acl": null, + "requester_pays": null, + "retention_policy": [ + + ], + "storage_class": "STANDARD", + "versioning": [ + + ], + "website": [ + { + "main_page_suffix": "index.html", + "not_found_page": "404.html" + } + ] + } + } + ] + } + }, + "resource_changes": [ + { + "address": "google_compute_disk.my-disk-resource", + "mode": "managed", + "type": "google_compute_disk", + "name": "my-disk-resource", + "provider_name": "google", + "change": { + "actions": [ + "create" + ], + "before": { + "description": null, + "disk_encryption_key": [ + + ], + "disk_encryption_key_raw": null, + "image": "projects/debian-cloud/global/images/debian-8-jessie-v20170523", + "labels": { + "disk-label-key-a": "disk-label-val-a" + }, + "name": "my-disk", + "project": "foobar", + "snapshot": null, + "source_image_encryption_key": [ + + ], + "source_snapshot_encryption_key": [ + + ], + "timeouts": null, + "type": "pd-ssd", + "zone": "projects/foobar/global/zones/us-central1-a" + }, + "after": { + "description": null, + "disk_encryption_key": [ + + ], + "disk_encryption_key_raw": null, + "image": "projects/debian-cloud/global/images/debian-8-jessie-v20170523", + "labels": { + "disk-label-key-a": "disk-label-val-a" + }, + "name": "my-disk", + "project": "foobar", + "snapshot": null, + "source_image_encryption_key": [ + + ], + "source_snapshot_encryption_key": [ + + ], + "timeouts": null, + "type": "pd-ssd", + "zone": "projects/foobar/global/zones/us-central1-a" + }, + "after_unknown": { + "creation_timestamp": true, + "disk_encryption_key": [ + + ], + "disk_encryption_key_sha256": true, + "id": true, + "label_fingerprint": true, + "labels": { + }, + "last_attach_timestamp": true, + "last_detach_timestamp": true, + "physical_block_size_bytes": true, + "self_link": true, + "size": true, + "source_image_encryption_key": [ + + ], + "source_image_id": true, + "source_snapshot_encryption_key": [ + + ], + "source_snapshot_id": true, + "users": true + } + } + }, + { + "address": "google_compute_firewall.my-test-firewall", + "mode": "managed", + "type": "google_compute_firewall", + "name": "my-test-firewall", + "provider_name": "google", + "change": { + "actions": [ + "create" + ], + "before": { + "allow": [ + { + "ports": [ + "80", + "8080", + "1000-2000" + ], + "protocol": "tcp" + }, + { + "ports": [ + + ], + "protocol": "icmp" + } + ], + "deny": [ + + ], + "description": null, + "disabled": null, + "name": "my-test-firewall", + "network": "default", + "priority": 1000, + "source_service_accounts": null, + "source_tags": [ + "web" + ], + "target_service_accounts": null, + "target_tags": null, + "timeouts": null + }, + "after": { + "allow": [ + { + "ports": [ + "80", + "8080", + "1000-2000" + ], + "protocol": "tcp" + }, + { + "ports": [ + + ], + "protocol": "icmp" + } + ], + "deny": [ + + ], + "description": null, + "disabled": null, + "name": "my-test-firewall", + "network": "default", + "priority": 1000, + "source_service_accounts": null, + "source_tags": [ + "web" + ], + "target_service_accounts": null, + "target_tags": null, + "timeouts": null + }, + "after_unknown": { + "allow": [ + { + "ports": [ + false, + false, + false + ] + }, + { + "ports": [ + + ] + } + ], + "creation_timestamp": true, + "deny": [ + + ], + "destination_ranges": true, + "direction": true, + "id": true, + "project": true, + "self_link": true, + "source_ranges": true, + "source_tags": [ + false + ] + } + } + }, + { + "address": "google_compute_instance.my-test-instance", + "mode": "managed", + "type": "google_compute_instance", + "name": "my-test-instance", + "provider_name": "google", + "change": { + "actions": [ + "create" + ], + "before": { + "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-8-jessie-v20170523" + } + ] + } + ], + "can_ip_forward": false, + "deletion_protection": false, + "description": null, + "disk": [ + + ], + "hostname": null, + "labels": null, + "machine_type": "n1-standard-1", + "metadata": { + "foo": "bar" + }, + "metadata_startup_script": "echo hi > /test.txt", + "min_cpu_platform": null, + "name": "my-instance", + "network_interface": [ + { + "access_config": [ + { + "public_ptr_domain_name": null + } + ], + "alias_ip_range": [ + + ], + "network": "default" + } + ], + "project": "foobar", + "scratch_disk": [ + { + "interface": "SCSI" + } + ], + "service_account": [ + { + "scopes": [ + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/userinfo.email" + ] + } + ], + "shielded_instance_config": [ + + ], + "tags": [ + "bar", + "foo" + ], + "timeouts": null, + "zone": "projects/foobar/global/zones/us-central1-a" + }, + "after": { + "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-8-jessie-v20170523" + } + ] + } + ], + "can_ip_forward": false, + "deletion_protection": false, + "description": null, + "disk": [ + + ], + "hostname": null, + "labels": null, + "machine_type": "n1-standard-1", + "metadata": { + "foo": "bar" + }, + "metadata_startup_script": "echo hi > /test.txt", + "min_cpu_platform": null, + "name": "my-instance", + "network_interface": [ + { + "access_config": [ + { + "public_ptr_domain_name": null + } + ], + "alias_ip_range": [ + + ], + "network": "default" + } + ], + "project": "foobar", + "scratch_disk": [ + { + "interface": "SCSI" + } + ], + "service_account": [ + { + "scopes": [ + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/userinfo.email" + ] + } + ], + "shielded_instance_config": [ + + ], + "tags": [ + "bar", + "foo" + ], + "timeouts": null, + "zone": "projects/foobar/global/zones/us-central1-a" + }, + "after_unknown": { + "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 + } + ], + "cpu_platform": true, + "disk": [ + + ], + "guest_accelerator": true, + "id": true, + "instance_id": true, + "label_fingerprint": true, + "metadata": { + }, + "metadata_fingerprint": true, + "network_interface": [ + { + "access_config": [ + { + "assigned_nat_ip": true, + "nat_ip": true, + "network_tier": true + } + ], + "address": true, + "alias_ip_range": [ + + ], + "name": true, + "network_ip": true, + "subnetwork": true, + "subnetwork_project": true + } + ], + "scheduling": true, + "scratch_disk": [ + { + } + ], + "self_link": true, + "service_account": [ + { + "email": true, + "scopes": [ + false, + false, + false + ] + } + ], + "shielded_instance_config": [ + + ], + "tags": [ + false, + false + ], + "tags_fingerprint": true + } + } + }, + { + "address": "google_folder_iam_binding.my-test-folder-binding", + "mode": "managed", + "type": "google_folder_iam_binding", + "name": "my-test-folder-binding", + "provider_name": "google", + "change": { + "actions": [ + "create" + ], + "before": { + "folder": "my-folder", + "members": [ + "user:alice@example.com" + ], + "role": "roles/browser" + }, + "after": { + "folder": "my-folder", + "members": [ + "user:alice@example.com" + ], + "role": "roles/browser" + }, + "after_unknown": { + "etag": true, + "id": true, + "members": [ + false + ] + } + } + }, + { + "address": "google_folder_iam_member.my-test-folder-member", + "mode": "managed", + "type": "google_folder_iam_member", + "name": "my-test-folder-member", + "provider_name": "google", + "change": { + "actions": [ + "create" + ], + "before": { + "folder": "my-folder", + "member": "user:jane@example.com", + "role": "roles/viewer" + }, + "after": { + "folder": "my-folder", + "member": "user:jane@example.com", + "role": "roles/viewer" + }, + "after_unknown": { + "etag": true, + "id": true + } + } + }, + { + "address": "google_folder_iam_policy.my-test-folder-policy", + "mode": "managed", + "type": "google_folder_iam_policy", + "name": "my-test-folder-policy", + "provider_name": "google", + "change": { + "actions": [ + "create" + ], + "before": { + "folder": "my-folder", + "policy_data": "{\"bindings\":[{\"members\":[\"user:bob@example.com\"],\"role\":\"roles/editor\"}]}" + }, + "after": { + "folder": "my-folder", + "policy_data": "{\"bindings\":[{\"members\":[\"user:bob@example.com\"],\"role\":\"roles/editor\"}]}" + }, + "after_unknown": { + "etag": true, + "id": true + } + } + }, + { + "address": "google_organization_iam_binding.my-test-org-binding", + "mode": "managed", + "type": "google_organization_iam_binding", + "name": "my-test-org-binding", + "provider_name": "google", + "change": { + "actions": [ + "create" + ], + "before": { + "members": [ + "user:alice@example.com" + ], + "org_id": "123456789", + "role": "roles/browser" + }, + "after": { + "members": [ + "user:alice@example.com" + ], + "org_id": "123456789", + "role": "roles/browser" + }, + "after_unknown": { + "etag": true, + "id": true, + "members": [ + false + ] + } + } + }, + { + "address": "google_organization_iam_member.my-test-org-member", + "mode": "managed", + "type": "google_organization_iam_member", + "name": "my-test-org-member", + "provider_name": "google", + "change": { + "actions": [ + "create" + ], + "before": { + "member": "user:jane@example.com", + "org_id": "123456789", + "role": "roles/viewer" + }, + "after": { + "member": "user:jane@example.com", + "org_id": "123456789", + "role": "roles/viewer" + }, + "after_unknown": { + "etag": true, + "id": true + } + } + }, + { + "address": "google_organization_iam_policy.my-test-org-policy", + "mode": "managed", + "type": "google_organization_iam_policy", + "name": "my-test-org-policy", + "provider_name": "google", + "change": { + "actions": [ + "create" + ], + "before": { + "org_id": "123456789", + "policy_data": "{\"bindings\":[{\"members\":[\"user:bob@example.com\"],\"role\":\"roles/editor\"}]}" + }, + "after": { + "org_id": "123456789", + "policy_data": "{\"bindings\":[{\"members\":[\"user:bob@example.com\"],\"role\":\"roles/editor\"}]}" + }, + "after_unknown": { + "etag": true, + "id": true + } + } + }, + { + "address": "google_project.my-project-resource", + "mode": "managed", + "type": "google_project", + "name": "my-project-resource", + "provider_name": "google", + "change": { + "actions": [ + "create" + ], + "before": { + "auto_create_network": true, + "billing_account": "012345-567890-ABCDEF", + "labels": { + "project-label-key-a": "project-label-val-a" + }, + "name": "My Project Name", + "org_id": "my-org", + "project_id": "foobar", + "timeouts": null + }, + "after": { + "auto_create_network": true, + "billing_account": "012345-567890-ABCDEF", + "labels": { + "project-label-key-a": "project-label-val-a" + }, + "name": "My Project Name", + "org_id": "my-org", + "project_id": "foobar", + "timeouts": null + }, + "after_unknown": { + "app_engine": true, + "folder_id": true, + "id": true, + "labels": { + }, + "number": true, + "policy_data": true, + "policy_etag": true, + "skip_delete": true + } + } + }, + { + "address": "google_project_iam_binding.my-test-project-binding", + "mode": "managed", + "type": "google_project_iam_binding", + "name": "my-test-project-binding", + "provider_name": "google", + "change": { + "actions": [ + "create" + ], + "before": { + "members": [ + "user:alice@example.com" + ], + "project": "foobar", + "role": "roles/browser" + }, + "after": { + "members": [ + "user:alice@example.com" + ], + "project": "foobar", + "role": "roles/browser" + }, + "after_unknown": { + "etag": true, + "id": true, + "members": [ + false + ] + } + } + }, + { + "address": "google_project_iam_member.my-test-project-member", + "mode": "managed", + "type": "google_project_iam_member", + "name": "my-test-project-member", + "provider_name": "google", + "change": { + "actions": [ + "create" + ], + "before": { + "member": "user:jane@example.com", + "project": "foobar", + "role": "roles/viewer" + }, + "after": { + "member": "user:jane@example.com", + "project": "foobar", + "role": "roles/viewer" + }, + "after_unknown": { + "etag": true, + "id": true + } + } + }, + { + "address": "google_project_iam_policy.my-test-project-policy", + "mode": "managed", + "type": "google_project_iam_policy", + "name": "my-test-project-policy", + "provider_name": "google", + "change": { + "actions": [ + "create" + ], + "before": { + "authoritative": null, + "disable_project": null, + "policy_data": "{\"bindings\":[{\"members\":[\"user:bob@example.com\"],\"role\":\"roles/editor\"}]}", + "project": "foobar" + }, + "after": { + "authoritative": null, + "disable_project": null, + "policy_data": "{\"bindings\":[{\"members\":[\"user:bob@example.com\"],\"role\":\"roles/editor\"}]}", + "project": "foobar" + }, + "after_unknown": { + "etag": true, + "id": true, + "restore_policy": true + } + } + }, + { + "address": "google_sql_database_instance.my-test-sql", + "mode": "managed", + "type": "google_sql_database_instance", + "name": "my-test-sql", + "provider_name": "google", + "change": { + "actions": [ + "create" + ], + "before": { + "database_version": "POSTGRES_9_6", + "name": "master-instance", + "region": "us-central1", + "settings": [ + { + "database_flags": [ + + ], + "disk_autoresize": true, + "maintenance_window": [ + + ], + "pricing_plan": "PER_USE", + "tier": "db-f1-micro", + "user_labels": null + } + ], + "timeouts": null + }, + "after": { + "database_version": "POSTGRES_9_6", + "name": "master-instance", + "region": "us-central1", + "settings": [ + { + "database_flags": [ + + ], + "disk_autoresize": true, + "maintenance_window": [ + + ], + "pricing_plan": "PER_USE", + "tier": "db-f1-micro", + "user_labels": null + } + ], + "timeouts": null + }, + "after_unknown": { + "connection_name": true, + "first_ip_address": true, + "id": true, + "ip_address": true, + "master_instance_name": true, + "private_ip_address": true, + "project": true, + "public_ip_address": true, + "replica_configuration": true, + "self_link": true, + "server_ca_cert": true, + "service_account_email_address": true, + "settings": [ + { + "activation_policy": true, + "availability_type": true, + "backup_configuration": true, + "database_flags": [ + + ], + "disk_size": true, + "disk_type": true, + "ip_configuration": true, + "location_preference": true, + "maintenance_window": [ + + ], + "version": true + } + ] + } + } + }, + { + "address": "google_storage_bucket.my-test-bucket", + "mode": "managed", + "type": "google_storage_bucket", + "name": "my-test-bucket", + "provider_name": "google", + "change": { + "actions": [ + "create" + ], + "before": { + "cors": [ + + ], + "encryption": [ + + ], + "force_destroy": false, + "labels": null, + "lifecycle_rule": [ + + ], + "location": "EU", + "logging": [ + + ], + "name": "test-bucket", + "predefined_acl": null, + "requester_pays": null, + "retention_policy": [ + + ], + "storage_class": "STANDARD", + "versioning": [ + + ], + "website": [ + { + "main_page_suffix": "index.html", + "not_found_page": "404.html" + } + ] + }, + "after": { + "cors": [ + + ], + "encryption": [ + + ], + "force_destroy": false, + "labels": null, + "lifecycle_rule": [ + + ], + "location": "EU", + "logging": [ + + ], + "name": "test-bucket", + "predefined_acl": null, + "requester_pays": null, + "retention_policy": [ + + ], + "storage_class": "STANDARD", + "versioning": [ + + ], + "website": [ + { + "main_page_suffix": "index.html", + "not_found_page": "404.html" + } + ] + }, + "after_unknown": { + "uniform_bucket_level_access": true, + "cors": [ + + ], + "encryption": [ + + ], + "id": true, + "lifecycle_rule": [ + + ], + "logging": [ + + ], + "project": true, + "retention_policy": [ + + ], + "self_link": true, + "url": true, + "versioning": [ + + ], + "website": [ + { + } + ] + } + } + } + ], + "prior_state": { + "format_version": "0.1", + "terraform_version": "0.12.6", + "values": { + "root_module": { + "resources": [ + { + "address": "data.google_iam_policy.admin", + "mode": "data", + "type": "google_iam_policy", + "name": "admin", + "provider_name": "google", + "schema_version": 0, + "values": { + "audit_config": null, + "binding": [ + { + "members": [ + "user:bob@example.com" + ], + "role": "roles/editor" + } + ], + "id": "2315450596", + "policy_data": "{\"bindings\":[{\"members\":[\"user:bob@example.com\"],\"role\":\"roles/editor\"}]}" + } + } + ] + } + } + }, + "configuration": { + "provider_config": { + "google": { + "name": "google", + "version_constraint": "~> 2.5", + "expressions": { + } + } + }, + "root_module": { + "resources": [ + { + "address": "google_compute_disk.my-disk-resource", + "mode": "managed", + "type": "google_compute_disk", + "name": "my-disk-resource", + "provider_config_key": "google", + "expressions": { + "image": { + "constant_value": "projects/debian-cloud/global/images/debian-8-jessie-v20170523" + }, + "labels": { + "constant_value": { + "disk-label-key-a": "disk-label-val-a" + } + }, + "name": { + "constant_value": "my-disk" + }, + "project": { + "constant_value": "foobar" + }, + "type": { + "constant_value": "pd-ssd" + }, + "zone": { + "constant_value": "projects/foobar/global/zones/us-central1-a" + } + }, + "schema_version": 0 + }, + { + "address": "google_compute_firewall.my-test-firewall", + "mode": "managed", + "type": "google_compute_firewall", + "name": "my-test-firewall", + "provider_config_key": "google", + "expressions": { + "allow": [ + { + "protocol": { + "constant_value": "icmp" + } + }, + { + "ports": { + "constant_value": [ + "80", + "8080", + "1000-2000" + ] + }, + "protocol": { + "constant_value": "tcp" + } + } + ], + "name": { + "constant_value": "my-test-firewall" + }, + "network": { + "constant_value": "default" + }, + "source_tags": { + "constant_value": [ + "web" + ] + } + }, + "schema_version": 1 + }, + { + "address": "google_compute_instance.my-test-instance", + "mode": "managed", + "type": "google_compute_instance", + "name": "my-test-instance", + "provider_config_key": "google", + "expressions": { + "boot_disk": [ + { + "initialize_params": [ + { + "image": { + "constant_value": "projects/debian-cloud/global/images/debian-8-jessie-v20170523" + } + } + ] + } + ], + "machine_type": { + "constant_value": "n1-standard-1" + }, + "metadata": { + "constant_value": { + "foo": "bar" + } + }, + "metadata_startup_script": { + "constant_value": "echo hi > /test.txt" + }, + "name": { + "constant_value": "my-instance" + }, + "network_interface": [ + { + "access_config": [ + { + } + ], + "network": { + "constant_value": "default" + } + } + ], + "project": { + "constant_value": "foobar" + }, + "scratch_disk": [ + { + } + ], + "service_account": [ + { + "scopes": { + "constant_value": [ + "userinfo-email", + "compute-ro", + "storage-ro" + ] + } + } + ], + "tags": { + "constant_value": [ + "foo", + "bar" + ] + }, + "zone": { + "constant_value": "projects/foobar/global/zones/us-central1-a" + } + }, + "schema_version": 6 + }, + { + "address": "google_folder_iam_binding.my-test-folder-binding", + "mode": "managed", + "type": "google_folder_iam_binding", + "name": "my-test-folder-binding", + "provider_config_key": "google", + "expressions": { + "folder": { + "constant_value": "my-folder" + }, + "members": { + "constant_value": [ + "user:alice@example.com" + ] + }, + "role": { + "constant_value": "roles/browser" + } + }, + "schema_version": 0 + }, + { + "address": "google_folder_iam_member.my-test-folder-member", + "mode": "managed", + "type": "google_folder_iam_member", + "name": "my-test-folder-member", + "provider_config_key": "google", + "expressions": { + "folder": { + "constant_value": "my-folder" + }, + "member": { + "constant_value": "user:jane@example.com" + }, + "role": { + "constant_value": "roles/viewer" + } + }, + "schema_version": 0 + }, + { + "address": "google_folder_iam_policy.my-test-folder-policy", + "mode": "managed", + "type": "google_folder_iam_policy", + "name": "my-test-folder-policy", + "provider_config_key": "google", + "expressions": { + "folder": { + "constant_value": "my-folder" + }, + "policy_data": { + "references": [ + "data.google_iam_policy.admin" + ] + } + }, + "schema_version": 0 + }, + { + "address": "google_organization_iam_binding.my-test-org-binding", + "mode": "managed", + "type": "google_organization_iam_binding", + "name": "my-test-org-binding", + "provider_config_key": "google", + "expressions": { + "members": { + "constant_value": [ + "user:alice@example.com" + ] + }, + "org_id": { + "constant_value": "123456789" + }, + "role": { + "constant_value": "roles/browser" + } + }, + "schema_version": 0 + }, + { + "address": "google_organization_iam_member.my-test-org-member", + "mode": "managed", + "type": "google_organization_iam_member", + "name": "my-test-org-member", + "provider_config_key": "google", + "expressions": { + "member": { + "constant_value": "user:jane@example.com" + }, + "org_id": { + "constant_value": "123456789" + }, + "role": { + "constant_value": "roles/viewer" + } + }, + "schema_version": 0 + }, + { + "address": "google_organization_iam_policy.my-test-org-policy", + "mode": "managed", + "type": "google_organization_iam_policy", + "name": "my-test-org-policy", + "provider_config_key": "google", + "expressions": { + "org_id": { + "constant_value": "123456789" + }, + "policy_data": { + "references": [ + "data.google_iam_policy.admin" + ] + } + }, + "schema_version": 0 + }, + { + "address": "google_project.my-project-resource", + "mode": "managed", + "type": "google_project", + "name": "my-project-resource", + "provider_config_key": "google", + "expressions": { + "billing_account": { + "constant_value": "012345-567890-ABCDEF" + }, + "labels": { + "constant_value": { + "project-label-key-a": "project-label-val-a" + } + }, + "name": { + "constant_value": "My Project Name" + }, + "org_id": { + "constant_value": "my-org" + }, + "project_id": { + "constant_value": "foobar" + } + }, + "schema_version": 1 + }, + { + "address": "google_project_iam_binding.my-test-project-binding", + "mode": "managed", + "type": "google_project_iam_binding", + "name": "my-test-project-binding", + "provider_config_key": "google", + "expressions": { + "members": { + "constant_value": [ + "user:alice@example.com" + ] + }, + "project": { + "constant_value": "foobar" + }, + "role": { + "constant_value": "roles/browser" + } + }, + "schema_version": 0 + }, + { + "address": "google_project_iam_member.my-test-project-member", + "mode": "managed", + "type": "google_project_iam_member", + "name": "my-test-project-member", + "provider_config_key": "google", + "expressions": { + "member": { + "constant_value": "user:jane@example.com" + }, + "project": { + "constant_value": "foobar" + }, + "role": { + "constant_value": "roles/viewer" + } + }, + "schema_version": 0 + }, + { + "address": "google_project_iam_policy.my-test-project-policy", + "mode": "managed", + "type": "google_project_iam_policy", + "name": "my-test-project-policy", + "provider_config_key": "google", + "expressions": { + "policy_data": { + "references": [ + "data.google_iam_policy.admin" + ] + }, + "project": { + "constant_value": "foobar" + } + }, + "schema_version": 0 + }, + { + "address": "google_sql_database_instance.my-test-sql", + "mode": "managed", + "type": "google_sql_database_instance", + "name": "my-test-sql", + "provider_config_key": "google", + "expressions": { + "database_version": { + "constant_value": "POSTGRES_9_6" + }, + "name": { + "constant_value": "master-instance" + }, + "region": { + "constant_value": "us-central1" + }, + "settings": [ + { + "tier": { + "constant_value": "db-f1-micro" + } + } + ] + }, + "schema_version": 0 + }, + { + "address": "google_storage_bucket.my-test-bucket", + "mode": "managed", + "type": "google_storage_bucket", + "name": "my-test-bucket", + "provider_config_key": "google", + "expressions": { + "location": { + "constant_value": "EU" + }, + "name": { + "constant_value": "test-bucket" + }, + "website": [ + { + "main_page_suffix": { + "constant_value": "index.html" + }, + "not_found_page": { + "constant_value": "404.html" + } + } + ] + }, + "schema_version": 0 + }, + { + "address": "data.google_iam_policy.admin", + "mode": "data", + "type": "google_iam_policy", + "name": "admin", + "provider_config_key": "google", + "expressions": { + "binding": [ + { + "members": { + "constant_value": [ + "user:bob@example.com" + ] + }, + "role": { + "constant_value": "roles/editor" + } + } + ] + }, + "schema_version": 0 + } + ] + } + } +} diff --git a/mmv1/third_party/validator/tests/source/read_planned_assets/tf1_0plan.applied.json b/mmv1/third_party/validator/tests/source/read_planned_assets/tf1_0plan.applied.json new file mode 100644 index 000000000000..c2adb6588dc2 --- /dev/null +++ b/mmv1/third_party/validator/tests/source/read_planned_assets/tf1_0plan.applied.json @@ -0,0 +1,1803 @@ +{ + "format_version": "0.2", + "terraform_version": "1.0.3", + "planned_values": { + "root_module": { + "resources": [ + { + "address": "google_compute_disk.my-disk", + "mode": "managed", + "type": "google_compute_disk", + "name": "my-disk", + "provider_name": "registry.terraform.io/hashicorp/google", + "schema_version": 0, + "values": { + "creation_timestamp": "2021-08-02T04:24:36.438-07:00", + "description": "", + "disk_encryption_key": [], + "id": "projects/foobar/zones/us-central1-a/disks/my-disk", + "image": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-8-jessie-v20170523", + "label_fingerprint": "1TQLkowq0ZY=", + "labels": { + "foo": "bar" + }, + "last_attach_timestamp": "", + "last_detach_timestamp": "", + "name": "my-disk", + "physical_block_size_bytes": 4096, + "project": "foobar", + "self_link": "https://www.googleapis.com/compute/v1/projects/foobar/zones/us-central1-a/disks/my-disk", + "size": 10, + "snapshot": "", + "source_image_encryption_key": [], + "source_image_id": "2405673006522696145", + "source_snapshot_encryption_key": [], + "source_snapshot_id": "", + "timeouts": null, + "type": "pd-ssd", + "users": [], + "zone": "us-central1-a" + }, + "sensitive_values": { + "disk_encryption_key": [], + "labels": {}, + "source_image_encryption_key": [], + "source_snapshot_encryption_key": [], + "users": [] + } + }, + { + "address": "google_compute_firewall.my-test-firewall", + "mode": "managed", + "type": "google_compute_firewall", + "name": "my-test-firewall", + "provider_name": "registry.terraform.io/hashicorp/google", + "schema_version": 1, + "values": { + "allow": [ + { + "ports": [ + "80", + "8080", + "1000-2000" + ], + "protocol": "tcp" + }, + { + "ports": [], + "protocol": "icmp" + } + ], + "creation_timestamp": "2021-08-02T04:24:35.599-07:00", + "deny": [], + "description": "", + "destination_ranges": [], + "direction": "INGRESS", + "disabled": false, + "enable_logging": null, + "id": "projects/foobar/global/firewalls/my-test-firewall", + "log_config": [], + "name": "my-test-firewall", + "network": "https://www.googleapis.com/compute/v1/projects/foobar/global/networks/default", + "priority": 1000, + "project": "foobar", + "self_link": "https://www.googleapis.com/compute/v1/projects/foobar/global/firewalls/my-test-firewall", + "source_ranges": [], + "source_service_accounts": [], + "source_tags": [ + "web" + ], + "target_service_accounts": [], + "target_tags": [], + "timeouts": null + }, + "sensitive_values": { + "allow": [ + { + "ports": [ + false, + false, + false + ] + }, + { + "ports": [] + } + ], + "deny": [], + "destination_ranges": [], + "log_config": [], + "source_ranges": [], + "source_service_accounts": [], + "source_tags": [ + false + ], + "target_service_accounts": [], + "target_tags": [] + } + }, + { + "address": "google_folder.test", + "mode": "managed", + "type": "google_folder", + "name": "test", + "provider_name": "registry.terraform.io/hashicorp/google", + "schema_version": 0, + "values": { + "create_time": "2021-08-02T10:58:29.568Z", + "display_name": "test-folder", + "folder_id": "567", + "id": "folders/567", + "lifecycle_state": "ACTIVE", + "name": "folders/567", + "parent": "organizations/123", + "timeouts": null + }, + "sensitive_values": {} + }, + { + "address": "google_project.my_project", + "mode": "managed", + "type": "google_project", + "name": "my_project", + "provider_name": "registry.terraform.io/hashicorp/google", + "schema_version": 1, + "values": { + "auto_create_network": true, + "billing_account": "ABCDEF-GHIJKL-MNOPQR", + "folder_id": "567", + "id": "projects/foobar", + "labels": { + "project-label-key-a": "project-label-val-a" + }, + "name": "test-project", + "number": "345", + "org_id": "", + "project_id": "foobar", + "skip_delete": null, + "timeouts": null + }, + "sensitive_values": { + "labels": {} + } + }, + { + "address": "google_project_iam_binding.editors", + "mode": "managed", + "type": "google_project_iam_binding", + "name": "editors", + "provider_name": "registry.terraform.io/hashicorp/google", + "schema_version": 0, + "values": { + "condition": [], + "etag": "BwXIkdCSmWo=", + "id": "foobar/roles/editor", + "members": [ + "user:example-a@google.com" + ], + "project": "foobar", + "role": "roles/editor" + }, + "sensitive_values": { + "condition": [], + "members": [ + false + ] + } + }, + { + "address": "google_project_iam_member.owner-a", + "mode": "managed", + "type": "google_project_iam_member", + "name": "owner-a", + "provider_name": "registry.terraform.io/hashicorp/google", + "schema_version": 0, + "values": { + "condition": [], + "etag": "BwXIkdCSmWo=", + "id": "foobar/roles/owner/user:example-a@google.com", + "member": "user:example-a@google.com", + "project": "foobar", + "role": "roles/owner" + }, + "sensitive_values": { + "condition": [] + } + }, + { + "address": "google_project_iam_member.viewer-a", + "mode": "managed", + "type": "google_project_iam_member", + "name": "viewer-a", + "provider_name": "registry.terraform.io/hashicorp/google", + "schema_version": 0, + "values": { + "condition": [], + "etag": "BwXIkdCSmWo=", + "id": "foobar/roles/viewer/user:example-a@google.com", + "member": "user:example-a@google.com", + "project": "foobar", + "role": "roles/viewer" + }, + "sensitive_values": { + "condition": [] + } + }, + { + "address": "google_project_iam_member.viewer-b", + "mode": "managed", + "type": "google_project_iam_member", + "name": "viewer-b", + "provider_name": "registry.terraform.io/hashicorp/google", + "schema_version": 0, + "values": { + "condition": [], + "etag": "BwXIkdCSmWo=", + "id": "foobar/roles/viewer/user:example-a@google.com", + "member": "user:example-a@google.com", + "project": "foobar", + "role": "roles/viewer" + }, + "sensitive_values": { + "condition": [] + } + }, + { + "address": "google_storage_bucket.my-bucket", + "mode": "managed", + "type": "google_storage_bucket", + "name": "my-bucket", + "provider_name": "registry.terraform.io/hashicorp/google", + "schema_version": 0, + "values": { + "uniform_bucket_level_access": true, + "cors": [ + { + "max_age_seconds": 0, + "method": [ + "POST" + ], + "origin": [ + "*" + ], + "response_header": [] + } + ], + "default_event_based_hold": false, + "encryption": [], + "force_destroy": false, + "id": "my-bucket-a75386cfe95a0c83", + "labels": { + "foo": "bar" + }, + "lifecycle_rule": [], + "location": "US", + "logging": [], + "name": "my-bucket-a75386cfe95a0c83", + "project": "foobar", + "requester_pays": false, + "retention_policy": [], + "self_link": "https://www.googleapis.com/storage/v1/b/my-bucket-a75386cfe95a0c83", + "storage_class": "STANDARD", + "uniform_bucket_level_access": true, + "url": "gs://my-bucket-a75386cfe95a0c83", + "versioning": [], + "website": [ + { + "main_page_suffix": "index.html", + "not_found_page": "404.html" + } + ] + }, + "sensitive_values": { + "cors": [ + { + "method": [ + false + ], + "origin": [ + false + ], + "response_header": [] + } + ], + "encryption": [], + "labels": {}, + "lifecycle_rule": [], + "logging": [], + "retention_policy": [], + "versioning": [], + "website": [ + {} + ] + } + }, + { + "address": "random_id.bucket", + "mode": "managed", + "type": "random_id", + "name": "bucket", + "provider_name": "registry.terraform.io/hashicorp/random", + "schema_version": 0, + "values": { + "b64_std": "p1OGz+laDIM=", + "b64_url": "p1OGz-laDIM", + "byte_length": 8, + "dec": "12057128854932294787", + "hex": "a75386cfe95a0c83", + "id": "p1OGz-laDIM", + "keepers": null, + "prefix": null + }, + "sensitive_values": {} + } + ] + } + }, + "resource_drift": [ + { + "address": "google_storage_bucket.my-bucket", + "mode": "managed", + "type": "google_storage_bucket", + "name": "my-bucket", + "provider_name": "registry.terraform.io/hashicorp/google", + "change": { + "actions": [ + "update" + ], + "before": { + "uniform_bucket_level_access": true, + "cors": [ + { + "max_age_seconds": 0, + "method": [ + "POST" + ], + "origin": [ + "*" + ], + "response_header": null + } + ], + "default_event_based_hold": false, + "encryption": [], + "force_destroy": false, + "id": "my-bucket-a75386cfe95a0c83", + "labels": { + "foo": "bar" + }, + "lifecycle_rule": [], + "location": "US", + "logging": [], + "name": "my-bucket-a75386cfe95a0c83", + "project": "foobar", + "requester_pays": false, + "retention_policy": [], + "self_link": "https://www.googleapis.com/storage/v1/b/my-bucket-a75386cfe95a0c83", + "storage_class": "STANDARD", + "uniform_bucket_level_access": true, + "url": "gs://my-bucket-a75386cfe95a0c83", + "versioning": [], + "website": [ + { + "main_page_suffix": "index.html", + "not_found_page": "404.html" + } + ] + }, + "after": { + "uniform_bucket_level_access": true, + "cors": [ + { + "max_age_seconds": 0, + "method": [ + "POST" + ], + "origin": [ + "*" + ], + "response_header": [] + } + ], + "default_event_based_hold": false, + "encryption": [], + "force_destroy": false, + "id": "my-bucket-a75386cfe95a0c83", + "labels": { + "foo": "bar" + }, + "lifecycle_rule": [], + "location": "US", + "logging": [], + "name": "my-bucket-a75386cfe95a0c83", + "project": "foobar", + "requester_pays": false, + "retention_policy": [], + "self_link": "https://www.googleapis.com/storage/v1/b/my-bucket-a75386cfe95a0c83", + "storage_class": "STANDARD", + "uniform_bucket_level_access": true, + "url": "gs://my-bucket-a75386cfe95a0c83", + "versioning": [], + "website": [ + { + "main_page_suffix": "index.html", + "not_found_page": "404.html" + } + ] + }, + "before_sensitive": { + "cors": [ + { + "method": [ + false + ], + "origin": [ + false + ] + } + ], + "encryption": [], + "labels": {}, + "lifecycle_rule": [], + "logging": [], + "retention_policy": [], + "versioning": [], + "website": [ + {} + ] + }, + "after_sensitive": { + "cors": [ + { + "method": [ + false + ], + "origin": [ + false + ], + "response_header": [] + } + ], + "encryption": [], + "labels": {}, + "lifecycle_rule": [], + "logging": [], + "retention_policy": [], + "versioning": [], + "website": [ + {} + ] + } + } + } + ], + "resource_changes": [ + { + "address": "google_compute_disk.my-disk", + "mode": "managed", + "type": "google_compute_disk", + "name": "my-disk", + "provider_name": "registry.terraform.io/hashicorp/google", + "change": { + "actions": [ + "no-op" + ], + "before": { + "creation_timestamp": "2021-08-02T04:24:36.438-07:00", + "description": "", + "disk_encryption_key": [], + "id": "projects/foobar/zones/us-central1-a/disks/my-disk", + "image": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-8-jessie-v20170523", + "label_fingerprint": "1TQLkowq0ZY=", + "labels": { + "foo": "bar" + }, + "last_attach_timestamp": "", + "last_detach_timestamp": "", + "name": "my-disk", + "physical_block_size_bytes": 4096, + "project": "foobar", + "self_link": "https://www.googleapis.com/compute/v1/projects/foobar/zones/us-central1-a/disks/my-disk", + "size": 10, + "snapshot": "", + "source_image_encryption_key": [], + "source_image_id": "2405673006522696145", + "source_snapshot_encryption_key": [], + "source_snapshot_id": "", + "timeouts": null, + "type": "pd-ssd", + "users": [], + "zone": "us-central1-a" + }, + "after": { + "creation_timestamp": "2021-08-02T04:24:36.438-07:00", + "description": "", + "disk_encryption_key": [], + "id": "projects/foobar/zones/us-central1-a/disks/my-disk", + "image": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-8-jessie-v20170523", + "label_fingerprint": "1TQLkowq0ZY=", + "labels": { + "foo": "bar" + }, + "last_attach_timestamp": "", + "last_detach_timestamp": "", + "name": "my-disk", + "physical_block_size_bytes": 4096, + "project": "foobar", + "self_link": "https://www.googleapis.com/compute/v1/projects/foobar/zones/us-central1-a/disks/my-disk", + "size": 10, + "snapshot": "", + "source_image_encryption_key": [], + "source_image_id": "2405673006522696145", + "source_snapshot_encryption_key": [], + "source_snapshot_id": "", + "timeouts": null, + "type": "pd-ssd", + "users": [], + "zone": "us-central1-a" + }, + "after_unknown": {}, + "before_sensitive": { + "disk_encryption_key": [], + "labels": {}, + "source_image_encryption_key": [], + "source_snapshot_encryption_key": [], + "users": [] + }, + "after_sensitive": { + "disk_encryption_key": [], + "labels": {}, + "source_image_encryption_key": [], + "source_snapshot_encryption_key": [], + "users": [] + } + } + }, + { + "address": "google_compute_firewall.my-test-firewall", + "mode": "managed", + "type": "google_compute_firewall", + "name": "my-test-firewall", + "provider_name": "registry.terraform.io/hashicorp/google", + "change": { + "actions": [ + "no-op" + ], + "before": { + "allow": [ + { + "ports": [ + "80", + "8080", + "1000-2000" + ], + "protocol": "tcp" + }, + { + "ports": [], + "protocol": "icmp" + } + ], + "creation_timestamp": "2021-08-02T04:24:35.599-07:00", + "deny": [], + "description": "", + "destination_ranges": [], + "direction": "INGRESS", + "disabled": false, + "enable_logging": null, + "id": "projects/foobar/global/firewalls/my-test-firewall", + "log_config": [], + "name": "my-test-firewall", + "network": "https://www.googleapis.com/compute/v1/projects/foobar/global/networks/default", + "priority": 1000, + "project": "foobar", + "self_link": "https://www.googleapis.com/compute/v1/projects/foobar/global/firewalls/my-test-firewall", + "source_ranges": [], + "source_service_accounts": [], + "source_tags": [ + "web" + ], + "target_service_accounts": [], + "target_tags": [], + "timeouts": null + }, + "after": { + "allow": [ + { + "ports": [ + "80", + "8080", + "1000-2000" + ], + "protocol": "tcp" + }, + { + "ports": [], + "protocol": "icmp" + } + ], + "creation_timestamp": "2021-08-02T04:24:35.599-07:00", + "deny": [], + "description": "", + "destination_ranges": [], + "direction": "INGRESS", + "disabled": false, + "enable_logging": null, + "id": "projects/foobar/global/firewalls/my-test-firewall", + "log_config": [], + "name": "my-test-firewall", + "network": "https://www.googleapis.com/compute/v1/projects/foobar/global/networks/default", + "priority": 1000, + "project": "foobar", + "self_link": "https://www.googleapis.com/compute/v1/projects/foobar/global/firewalls/my-test-firewall", + "source_ranges": [], + "source_service_accounts": [], + "source_tags": [ + "web" + ], + "target_service_accounts": [], + "target_tags": [], + "timeouts": null + }, + "after_unknown": {}, + "before_sensitive": { + "allow": [ + { + "ports": [ + false, + false, + false + ] + }, + { + "ports": [] + } + ], + "deny": [], + "destination_ranges": [], + "log_config": [], + "source_ranges": [], + "source_service_accounts": [], + "source_tags": [ + false + ], + "target_service_accounts": [], + "target_tags": [] + }, + "after_sensitive": { + "allow": [ + { + "ports": [ + false, + false, + false + ] + }, + { + "ports": [] + } + ], + "deny": [], + "destination_ranges": [], + "log_config": [], + "source_ranges": [], + "source_service_accounts": [], + "source_tags": [ + false + ], + "target_service_accounts": [], + "target_tags": [] + } + } + }, + { + "address": "google_folder.test", + "mode": "managed", + "type": "google_folder", + "name": "test", + "provider_name": "registry.terraform.io/hashicorp/google", + "change": { + "actions": [ + "no-op" + ], + "before": { + "create_time": "2021-08-02T10:58:29.568Z", + "display_name": "test-folder", + "folder_id": "567", + "id": "folders/567", + "lifecycle_state": "ACTIVE", + "name": "folders/567", + "parent": "organizations/123", + "timeouts": null + }, + "after": { + "create_time": "2021-08-02T10:58:29.568Z", + "display_name": "test-folder", + "folder_id": "567", + "id": "folders/567", + "lifecycle_state": "ACTIVE", + "name": "folders/567", + "parent": "organizations/123", + "timeouts": null + }, + "after_unknown": {}, + "before_sensitive": {}, + "after_sensitive": {} + } + }, + { + "address": "google_project.my_project", + "mode": "managed", + "type": "google_project", + "name": "my_project", + "provider_name": "registry.terraform.io/hashicorp/google", + "change": { + "actions": [ + "no-op" + ], + "before": { + "auto_create_network": true, + "billing_account": "ABCDEF-GHIJKL-MNOPQR", + "folder_id": "567", + "id": "projects/foobar", + "labels": { + "project-label-key-a": "project-label-val-a" + }, + "name": "test-project", + "number": "345", + "org_id": "", + "project_id": "foobar", + "skip_delete": null, + "timeouts": null + }, + "after": { + "auto_create_network": true, + "billing_account": "ABCDEF-GHIJKL-MNOPQR", + "folder_id": "567", + "id": "projects/foobar", + "labels": { + "project-label-key-a": "project-label-val-a" + }, + "name": "test-project", + "number": "345", + "org_id": "", + "project_id": "foobar", + "skip_delete": null, + "timeouts": null + }, + "after_unknown": {}, + "before_sensitive": { + "labels": {} + }, + "after_sensitive": { + "labels": {} + } + } + }, + { + "address": "google_project_iam_binding.editors", + "mode": "managed", + "type": "google_project_iam_binding", + "name": "editors", + "provider_name": "registry.terraform.io/hashicorp/google", + "change": { + "actions": [ + "no-op" + ], + "before": { + "condition": [], + "etag": "BwXIkdCSmWo=", + "id": "foobar/roles/editor", + "members": [ + "user:example-a@google.com" + ], + "project": "foobar", + "role": "roles/editor" + }, + "after": { + "condition": [], + "etag": "BwXIkdCSmWo=", + "id": "foobar/roles/editor", + "members": [ + "user:example-a@google.com" + ], + "project": "foobar", + "role": "roles/editor" + }, + "after_unknown": {}, + "before_sensitive": { + "condition": [], + "members": [ + false + ] + }, + "after_sensitive": { + "condition": [], + "members": [ + false + ] + } + } + }, + { + "address": "google_project_iam_member.owner-a", + "mode": "managed", + "type": "google_project_iam_member", + "name": "owner-a", + "provider_name": "registry.terraform.io/hashicorp/google", + "change": { + "actions": [ + "no-op" + ], + "before": { + "condition": [], + "etag": "BwXIkdCSmWo=", + "id": "foobar/roles/owner/user:example-a@google.com", + "member": "user:example-a@google.com", + "project": "foobar", + "role": "roles/owner" + }, + "after": { + "condition": [], + "etag": "BwXIkdCSmWo=", + "id": "foobar/roles/owner/user:example-a@google.com", + "member": "user:example-a@google.com", + "project": "foobar", + "role": "roles/owner" + }, + "after_unknown": {}, + "before_sensitive": { + "condition": [] + }, + "after_sensitive": { + "condition": [] + } + } + }, + { + "address": "google_project_iam_member.viewer-a", + "mode": "managed", + "type": "google_project_iam_member", + "name": "viewer-a", + "provider_name": "registry.terraform.io/hashicorp/google", + "change": { + "actions": [ + "no-op" + ], + "before": { + "condition": [], + "etag": "BwXIkdCSmWo=", + "id": "foobar/roles/viewer/user:example-a@google.com", + "member": "user:example-a@google.com", + "project": "foobar", + "role": "roles/viewer" + }, + "after": { + "condition": [], + "etag": "BwXIkdCSmWo=", + "id": "foobar/roles/viewer/user:example-a@google.com", + "member": "user:example-a@google.com", + "project": "foobar", + "role": "roles/viewer" + }, + "after_unknown": {}, + "before_sensitive": { + "condition": [] + }, + "after_sensitive": { + "condition": [] + } + } + }, + { + "address": "google_project_iam_member.viewer-b", + "mode": "managed", + "type": "google_project_iam_member", + "name": "viewer-b", + "provider_name": "registry.terraform.io/hashicorp/google", + "change": { + "actions": [ + "no-op" + ], + "before": { + "condition": [], + "etag": "BwXIkdCSmWo=", + "id": "foobar/roles/viewer/user:example-a@google.com", + "member": "user:example-a@google.com", + "project": "foobar", + "role": "roles/viewer" + }, + "after": { + "condition": [], + "etag": "BwXIkdCSmWo=", + "id": "foobar/roles/viewer/user:example-a@google.com", + "member": "user:example-a@google.com", + "project": "foobar", + "role": "roles/viewer" + }, + "after_unknown": {}, + "before_sensitive": { + "condition": [] + }, + "after_sensitive": { + "condition": [] + } + } + }, + { + "address": "google_storage_bucket.my-bucket", + "mode": "managed", + "type": "google_storage_bucket", + "name": "my-bucket", + "provider_name": "registry.terraform.io/hashicorp/google", + "change": { + "actions": [ + "no-op" + ], + "before": { + "uniform_bucket_level_access": true, + "cors": [ + { + "max_age_seconds": 0, + "method": [ + "POST" + ], + "origin": [ + "*" + ], + "response_header": [] + } + ], + "default_event_based_hold": false, + "encryption": [], + "force_destroy": false, + "id": "my-bucket-a75386cfe95a0c83", + "labels": { + "foo": "bar" + }, + "lifecycle_rule": [], + "location": "US", + "logging": [], + "name": "my-bucket-a75386cfe95a0c83", + "project": "foobar", + "requester_pays": false, + "retention_policy": [], + "self_link": "https://www.googleapis.com/storage/v1/b/my-bucket-a75386cfe95a0c83", + "storage_class": "STANDARD", + "uniform_bucket_level_access": true, + "url": "gs://my-bucket-a75386cfe95a0c83", + "versioning": [], + "website": [ + { + "main_page_suffix": "index.html", + "not_found_page": "404.html" + } + ] + }, + "after": { + "uniform_bucket_level_access": true, + "cors": [ + { + "max_age_seconds": 0, + "method": [ + "POST" + ], + "origin": [ + "*" + ], + "response_header": [] + } + ], + "default_event_based_hold": false, + "encryption": [], + "force_destroy": false, + "id": "my-bucket-a75386cfe95a0c83", + "labels": { + "foo": "bar" + }, + "lifecycle_rule": [], + "location": "US", + "logging": [], + "name": "my-bucket-a75386cfe95a0c83", + "project": "foobar", + "requester_pays": false, + "retention_policy": [], + "self_link": "https://www.googleapis.com/storage/v1/b/my-bucket-a75386cfe95a0c83", + "storage_class": "STANDARD", + "uniform_bucket_level_access": true, + "url": "gs://my-bucket-a75386cfe95a0c83", + "versioning": [], + "website": [ + { + "main_page_suffix": "index.html", + "not_found_page": "404.html" + } + ] + }, + "after_unknown": {}, + "before_sensitive": { + "cors": [ + { + "method": [ + false + ], + "origin": [ + false + ], + "response_header": [] + } + ], + "encryption": [], + "labels": {}, + "lifecycle_rule": [], + "logging": [], + "retention_policy": [], + "versioning": [], + "website": [ + {} + ] + }, + "after_sensitive": { + "cors": [ + { + "method": [ + false + ], + "origin": [ + false + ], + "response_header": [] + } + ], + "encryption": [], + "labels": {}, + "lifecycle_rule": [], + "logging": [], + "retention_policy": [], + "versioning": [], + "website": [ + {} + ] + } + } + }, + { + "address": "random_id.bucket", + "mode": "managed", + "type": "random_id", + "name": "bucket", + "provider_name": "registry.terraform.io/hashicorp/random", + "change": { + "actions": [ + "no-op" + ], + "before": { + "b64_std": "p1OGz+laDIM=", + "b64_url": "p1OGz-laDIM", + "byte_length": 8, + "dec": "12057128854932294787", + "hex": "a75386cfe95a0c83", + "id": "p1OGz-laDIM", + "keepers": null, + "prefix": null + }, + "after": { + "b64_std": "p1OGz+laDIM=", + "b64_url": "p1OGz-laDIM", + "byte_length": 8, + "dec": "12057128854932294787", + "hex": "a75386cfe95a0c83", + "id": "p1OGz-laDIM", + "keepers": null, + "prefix": null + }, + "after_unknown": {}, + "before_sensitive": {}, + "after_sensitive": {} + } + } + ], + "output_changes": { + "org_id": { + "actions": [ + "no-op" + ], + "before": "123", + "after": "123", + "after_unknown": false, + "before_sensitive": false, + "after_sensitive": false + }, + "project_id": { + "actions": [ + "no-op" + ], + "before": "foobar", + "after": "foobar", + "after_unknown": false, + "before_sensitive": false, + "after_sensitive": false + } + }, + "prior_state": { + "format_version": "0.2", + "terraform_version": "1.0.3", + "values": { + "outputs": { + "org_id": { + "sensitive": false, + "value": "123" + }, + "project_id": { + "sensitive": false, + "value": "foobar" + } + }, + "root_module": { + "resources": [ + { + "address": "google_compute_disk.my-disk", + "mode": "managed", + "type": "google_compute_disk", + "name": "my-disk", + "provider_name": "registry.terraform.io/hashicorp/google", + "schema_version": 0, + "values": { + "creation_timestamp": "2021-08-02T04:24:36.438-07:00", + "description": "", + "disk_encryption_key": [], + "id": "projects/foobar/zones/us-central1-a/disks/my-disk", + "image": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-8-jessie-v20170523", + "label_fingerprint": "1TQLkowq0ZY=", + "labels": { + "foo": "bar" + }, + "last_attach_timestamp": "", + "last_detach_timestamp": "", + "name": "my-disk", + "physical_block_size_bytes": 4096, + "project": "foobar", + "self_link": "https://www.googleapis.com/compute/v1/projects/foobar/zones/us-central1-a/disks/my-disk", + "size": 10, + "snapshot": "", + "source_image_encryption_key": [], + "source_image_id": "2405673006522696145", + "source_snapshot_encryption_key": [], + "source_snapshot_id": "", + "timeouts": null, + "type": "pd-ssd", + "users": [], + "zone": "us-central1-a" + }, + "sensitive_values": { + "disk_encryption_key": [], + "labels": {}, + "source_image_encryption_key": [], + "source_snapshot_encryption_key": [], + "users": [] + } + }, + { + "address": "google_compute_firewall.my-test-firewall", + "mode": "managed", + "type": "google_compute_firewall", + "name": "my-test-firewall", + "provider_name": "registry.terraform.io/hashicorp/google", + "schema_version": 1, + "values": { + "allow": [ + { + "ports": [ + "80", + "8080", + "1000-2000" + ], + "protocol": "tcp" + }, + { + "ports": [], + "protocol": "icmp" + } + ], + "creation_timestamp": "2021-08-02T04:24:35.599-07:00", + "deny": [], + "description": "", + "destination_ranges": [], + "direction": "INGRESS", + "disabled": false, + "enable_logging": null, + "id": "projects/foobar/global/firewalls/my-test-firewall", + "log_config": [], + "name": "my-test-firewall", + "network": "https://www.googleapis.com/compute/v1/projects/foobar/global/networks/default", + "priority": 1000, + "project": "foobar", + "self_link": "https://www.googleapis.com/compute/v1/projects/foobar/global/firewalls/my-test-firewall", + "source_ranges": [], + "source_service_accounts": [], + "source_tags": [ + "web" + ], + "target_service_accounts": [], + "target_tags": [], + "timeouts": null + }, + "sensitive_values": { + "allow": [ + { + "ports": [ + false, + false, + false + ] + }, + { + "ports": [] + } + ], + "deny": [], + "destination_ranges": [], + "log_config": [], + "source_ranges": [], + "source_service_accounts": [], + "source_tags": [ + false + ], + "target_service_accounts": [], + "target_tags": [] + } + }, + { + "address": "google_folder.test", + "mode": "managed", + "type": "google_folder", + "name": "test", + "provider_name": "registry.terraform.io/hashicorp/google", + "schema_version": 0, + "values": { + "create_time": "2021-08-02T10:58:29.568Z", + "display_name": "test-folder", + "folder_id": "567", + "id": "folders/567", + "lifecycle_state": "ACTIVE", + "name": "folders/567", + "parent": "organizations/123", + "timeouts": null + }, + "sensitive_values": {} + }, + { + "address": "google_project.my_project", + "mode": "managed", + "type": "google_project", + "name": "my_project", + "provider_name": "registry.terraform.io/hashicorp/google", + "schema_version": 1, + "values": { + "auto_create_network": true, + "billing_account": "ABCDEF-GHIJKL-MNOPQR", + "folder_id": "567", + "id": "projects/foobar", + "labels": { + "project-label-key-a": "project-label-val-a" + }, + "name": "test-project", + "number": "345", + "org_id": "", + "project_id": "foobar", + "skip_delete": null, + "timeouts": null + }, + "sensitive_values": { + "labels": {} + }, + "depends_on": [ + "google_folder.test" + ] + }, + { + "address": "google_project_iam_binding.editors", + "mode": "managed", + "type": "google_project_iam_binding", + "name": "editors", + "provider_name": "registry.terraform.io/hashicorp/google", + "schema_version": 0, + "values": { + "condition": [], + "etag": "BwXIkdCSmWo=", + "id": "foobar/roles/editor", + "members": [ + "user:example-a@google.com" + ], + "project": "foobar", + "role": "roles/editor" + }, + "sensitive_values": { + "condition": [], + "members": [ + false + ] + } + }, + { + "address": "google_project_iam_member.owner-a", + "mode": "managed", + "type": "google_project_iam_member", + "name": "owner-a", + "provider_name": "registry.terraform.io/hashicorp/google", + "schema_version": 0, + "values": { + "condition": [], + "etag": "BwXIkdCSmWo=", + "id": "foobar/roles/owner/user:example-a@google.com", + "member": "user:example-a@google.com", + "project": "foobar", + "role": "roles/owner" + }, + "sensitive_values": { + "condition": [] + } + }, + { + "address": "google_project_iam_member.viewer-a", + "mode": "managed", + "type": "google_project_iam_member", + "name": "viewer-a", + "provider_name": "registry.terraform.io/hashicorp/google", + "schema_version": 0, + "values": { + "condition": [], + "etag": "BwXIkdCSmWo=", + "id": "foobar/roles/viewer/user:example-a@google.com", + "member": "user:example-a@google.com", + "project": "foobar", + "role": "roles/viewer" + }, + "sensitive_values": { + "condition": [] + } + }, + { + "address": "google_project_iam_member.viewer-b", + "mode": "managed", + "type": "google_project_iam_member", + "name": "viewer-b", + "provider_name": "registry.terraform.io/hashicorp/google", + "schema_version": 0, + "values": { + "condition": [], + "etag": "BwXIkdCSmWo=", + "id": "foobar/roles/viewer/user:example-a@google.com", + "member": "user:example-a@google.com", + "project": "foobar", + "role": "roles/viewer" + }, + "sensitive_values": { + "condition": [] + } + }, + { + "address": "google_storage_bucket.my-bucket", + "mode": "managed", + "type": "google_storage_bucket", + "name": "my-bucket", + "provider_name": "registry.terraform.io/hashicorp/google", + "schema_version": 0, + "values": { + "uniform_bucket_level_access": true, + "cors": [ + { + "max_age_seconds": 0, + "method": [ + "POST" + ], + "origin": [ + "*" + ], + "response_header": [] + } + ], + "default_event_based_hold": false, + "encryption": [], + "force_destroy": false, + "id": "my-bucket-a75386cfe95a0c83", + "labels": { + "foo": "bar" + }, + "lifecycle_rule": [], + "location": "US", + "logging": [], + "name": "my-bucket-a75386cfe95a0c83", + "project": "foobar", + "requester_pays": false, + "retention_policy": [], + "self_link": "https://www.googleapis.com/storage/v1/b/my-bucket-a75386cfe95a0c83", + "storage_class": "STANDARD", + "uniform_bucket_level_access": true, + "url": "gs://my-bucket-a75386cfe95a0c83", + "versioning": [], + "website": [ + { + "main_page_suffix": "index.html", + "not_found_page": "404.html" + } + ] + }, + "sensitive_values": { + "cors": [ + { + "method": [ + false + ], + "origin": [ + false + ], + "response_header": [] + } + ], + "encryption": [], + "labels": {}, + "lifecycle_rule": [], + "logging": [], + "retention_policy": [], + "versioning": [], + "website": [ + {} + ] + }, + "depends_on": [ + "random_id.bucket" + ] + }, + { + "address": "random_id.bucket", + "mode": "managed", + "type": "random_id", + "name": "bucket", + "provider_name": "registry.terraform.io/hashicorp/random", + "schema_version": 0, + "values": { + "b64_std": "p1OGz+laDIM=", + "b64_url": "p1OGz-laDIM", + "byte_length": 8, + "dec": "12057128854932294787", + "hex": "a75386cfe95a0c83", + "id": "p1OGz-laDIM", + "keepers": null, + "prefix": null + }, + "sensitive_values": {} + } + ] + } + } + }, + "configuration": { + "provider_config": { + "google": { + "name": "google", + "version_constraint": "~\u003e 3.57.0", + "expressions": { + "project": { + "references": [ + "var.project_id" + ] + } + } + } + }, + "root_module": { + "outputs": { + "org_id": { + "expression": { + "references": [ + "var.org_id" + ] + } + }, + "project_id": { + "expression": { + "references": [ + "var.project_id" + ] + } + } + }, + "resources": [ + { + "address": "google_compute_disk.my-disk", + "mode": "managed", + "type": "google_compute_disk", + "name": "my-disk", + "provider_config_key": "google", + "expressions": { + "image": { + "constant_value": "debian-8-jessie-v20170523" + }, + "labels": { + "constant_value": { + "foo": "bar" + } + }, + "name": { + "constant_value": "my-disk" + }, + "project": { + "references": [ + "var.project_id" + ] + }, + "type": { + "constant_value": "pd-ssd" + }, + "zone": { + "constant_value": "us-central1-a" + } + }, + "schema_version": 0 + }, + { + "address": "google_compute_firewall.my-test-firewall", + "mode": "managed", + "type": "google_compute_firewall", + "name": "my-test-firewall", + "provider_config_key": "google", + "expressions": { + "allow": [ + { + "protocol": { + "constant_value": "icmp" + } + }, + { + "ports": { + "constant_value": [ + "80", + "8080", + "1000-2000" + ] + }, + "protocol": { + "constant_value": "tcp" + } + } + ], + "name": { + "constant_value": "my-test-firewall" + }, + "network": { + "constant_value": "default" + }, + "project": { + "references": [ + "var.project_id" + ] + }, + "source_tags": { + "constant_value": [ + "web" + ] + } + }, + "schema_version": 1 + }, + { + "address": "google_folder.test", + "mode": "managed", + "type": "google_folder", + "name": "test", + "provider_config_key": "google", + "expressions": { + "display_name": { + "constant_value": "test-folder" + }, + "parent": { + "references": [ + "var.org_id" + ] + } + }, + "schema_version": 0 + }, + { + "address": "google_project.my_project", + "mode": "managed", + "type": "google_project", + "name": "my_project", + "provider_config_key": "google", + "expressions": { + "billing_account": { + "constant_value": "ABCDEF-GHIJKL-MNOPQR" + }, + "folder_id": { + "references": [ + "google_folder.test.name", + "google_folder.test" + ] + }, + "labels": { + "constant_value": { + "project-label-key-a": "project-label-val-a" + } + }, + "name": { + "constant_value": "test-project" + }, + "project_id": { + "references": [ + "var.project_id" + ] + } + }, + "schema_version": 1 + }, + { + "address": "google_project_iam_binding.editors", + "mode": "managed", + "type": "google_project_iam_binding", + "name": "editors", + "provider_config_key": "google", + "expressions": { + "members": { + "constant_value": [ + "user:example-a@google.com", + "user:example-b@google.com" + ] + }, + "project": { + "references": [ + "var.project_id" + ] + }, + "role": { + "constant_value": "roles/editor" + } + }, + "schema_version": 0 + }, + { + "address": "google_project_iam_member.owner-a", + "mode": "managed", + "type": "google_project_iam_member", + "name": "owner-a", + "provider_config_key": "google", + "expressions": { + "member": { + "constant_value": "user:example-a@google.com" + }, + "project": { + "references": [ + "var.project_id" + ] + }, + "role": { + "constant_value": "roles/owner" + } + }, + "schema_version": 0 + }, + { + "address": "google_project_iam_member.viewer-a", + "mode": "managed", + "type": "google_project_iam_member", + "name": "viewer-a", + "provider_config_key": "google", + "expressions": { + "member": { + "constant_value": "user:example-a@google.com" + }, + "project": { + "references": [ + "var.project_id" + ] + }, + "role": { + "constant_value": "roles/viewer" + } + }, + "schema_version": 0 + }, + { + "address": "google_project_iam_member.viewer-b", + "mode": "managed", + "type": "google_project_iam_member", + "name": "viewer-b", + "provider_config_key": "google", + "expressions": { + "member": { + "constant_value": "user:example-b@google.com" + }, + "project": { + "references": [ + "var.project_id" + ] + }, + "role": { + "constant_value": "roles/viewer" + } + }, + "schema_version": 0 + }, + { + "address": "google_storage_bucket.my-bucket", + "mode": "managed", + "type": "google_storage_bucket", + "name": "my-bucket", + "provider_config_key": "google", + "expressions": { + "cors": [ + { + "method": { + "constant_value": [ + "POST" + ] + }, + "origin": { + "constant_value": [ + "*" + ] + } + } + ], + "labels": { + "constant_value": { + "foo": "bar" + } + }, + "location": { + "constant_value": "US" + }, + "name": { + "references": [ + "random_id.bucket.hex", + "random_id.bucket" + ] + }, + "project": { + "references": [ + "var.project_id" + ] + }, + "uniform_bucket_level_access": { + "constant_value": true + }, + "website": [ + { + "main_page_suffix": { + "constant_value": "index.html" + }, + "not_found_page": { + "constant_value": "404.html" + } + } + ] + }, + "schema_version": 0 + }, + { + "address": "random_id.bucket", + "mode": "managed", + "type": "random_id", + "name": "bucket", + "provider_config_key": "random", + "expressions": { + "byte_length": { + "constant_value": 8 + } + }, + "schema_version": 0 + } + ], + "variables": { + "org_id": { + "default": "123", + "description": "The organization ID use for creating resources." + }, + "project_id": { + "default": "foobar", + "description": "The project to create resources inside of." + } + } + } + } +} \ No newline at end of file diff --git a/mmv1/third_party/validator/tests/source/read_planned_assets/tf1_0plan.json b/mmv1/third_party/validator/tests/source/read_planned_assets/tf1_0plan.json new file mode 100644 index 000000000000..eb37b6e183b4 --- /dev/null +++ b/mmv1/third_party/validator/tests/source/read_planned_assets/tf1_0plan.json @@ -0,0 +1,390 @@ +{ + "format_version": "0.2", + "terraform_version": "1.0.1", + "planned_values": { + "root_module": { + "resources": [ + { + "address": "google_compute_firewall.default", + "mode": "managed", + "type": "google_compute_firewall", + "name": "default", + "provider_name": "google", + "schema_version": 1, + "values": { + "allow": [ + { + "ports": [ + "82", + "8080", + "1000-2000" + ], + "protocol": "tcp" + } + ], + "creation_timestamp": "2019-07-23T04:06:22.114-07:00", + "deny": [], + "description": "", + "destination_ranges": [], + "direction": "INGRESS", + "disabled": false, + "id": "test-firewall", + "name": "test-firewall", + "network": "https://www.googleapis.com/compute/v1/projects/gl-akopachevskyy-sql-db/global/networks/default", + "priority": 1000, + "project": "gl-akopachevskyy-sql-db", + "self_link": "https://www.googleapis.com/compute/v1/projects/gl-akopachevskyy-sql-db/global/firewalls/test-firewall", + "source_ranges": [], + "source_service_accounts": [], + "source_tags": [ + "web" + ], + "target_service_accounts": [], + "target_tags": [], + "timeouts": null + } + } + ], + "child_modules": [ + { + "resources": [ + { + "address": "module.mymodule.google_compute_firewall.http", + "mode": "managed", + "type": "google_compute_firewall", + "name": "http", + "provider_name": "google", + "schema_version": 1, + "values": { + "allow": [ + { + "ports": [ + "8181" + ], + "protocol": "udp" + } + ], + "deny": [], + "description": null, + "disabled": null, + "name": "server-fiewall", + "network": "default", + "priority": 1000, + "source_service_accounts": null, + "source_tags": [ + "server" + ], + "target_service_accounts": null, + "target_tags": null, + "timeouts": null + } + } + ], + "address": "module.mymodule" + } + ] + } + }, + "resource_changes": [ + { + "address": "google_compute_firewall.default", + "mode": "managed", + "type": "google_compute_firewall", + "name": "default", + "provider_name": "google", + "change": { + "actions": [ + "create" + ], + "before": { + "allow": [ + { + "ports": [ + "82", + "8080", + "1000-2000" + ], + "protocol": "tcp" + } + ], + "creation_timestamp": "2019-07-23T04:06:22.114-07:00", + "deny": [], + "description": "", + "destination_ranges": [], + "direction": "INGRESS", + "disabled": false, + "id": "test-firewall", + "name": "test-firewall", + "network": "https://www.googleapis.com/compute/v1/projects/gl-akopachevskyy-sql-db/global/networks/default", + "priority": 1000, + "project": "gl-akopachevskyy-sql-db", + "self_link": "https://www.googleapis.com/compute/v1/projects/gl-akopachevskyy-sql-db/global/firewalls/test-firewall", + "source_ranges": [], + "source_service_accounts": [], + "source_tags": [ + "web" + ], + "target_service_accounts": [], + "target_tags": [], + "timeouts": null + }, + "after": { + "allow": [ + { + "ports": [ + "82", + "8080", + "1000-2000" + ], + "protocol": "tcp" + } + ], + "creation_timestamp": "2019-07-23T04:06:22.114-07:00", + "deny": [], + "description": "", + "destination_ranges": [], + "direction": "INGRESS", + "disabled": false, + "id": "test-firewall", + "name": "test-firewall", + "network": "https://www.googleapis.com/compute/v1/projects/gl-akopachevskyy-sql-db/global/networks/default", + "priority": 1000, + "project": "gl-akopachevskyy-sql-db", + "self_link": "https://www.googleapis.com/compute/v1/projects/gl-akopachevskyy-sql-db/global/firewalls/test-firewall", + "source_ranges": [], + "source_service_accounts": [], + "source_tags": [ + "web" + ], + "target_service_accounts": [], + "target_tags": [], + "timeouts": null + }, + "after_unknown": {} + } + }, + { + "address": "module.mymodule.google_compute_firewall.http", + "module_address": "module.mymodule", + "mode": "managed", + "type": "google_compute_firewall", + "name": "http", + "provider_name": "google", + "change": { + "actions": [ + "create" + ], + "before": { + "allow": [ + { + "ports": [ + "8181" + ], + "protocol": "udp" + } + ], + "deny": [], + "description": null, + "disabled": null, + "name": "server-fiewall", + "network": "default", + "priority": 1000, + "source_service_accounts": null, + "source_tags": [ + "server" + ], + "target_service_accounts": null, + "target_tags": null, + "timeouts": null + }, + "after": { + "allow": [ + { + "ports": [ + "8181" + ], + "protocol": "udp" + } + ], + "deny": [], + "description": null, + "disabled": null, + "name": "server-fiewall", + "network": "default", + "priority": 1000, + "source_service_accounts": null, + "source_tags": [ + "server" + ], + "target_service_accounts": null, + "target_tags": null, + "timeouts": null + }, + "after_unknown": { + "allow": [ + { + "ports": [ + false + ] + } + ], + "creation_timestamp": true, + "deny": [], + "destination_ranges": true, + "direction": true, + "id": true, + "project": true, + "self_link": true, + "source_ranges": true, + "source_tags": [ + false + ] + } + } + } + ], + "prior_state": { + "format_version": "0.1", + "terraform_version": "0.12.4", + "values": { + "root_module": { + "resources": [ + { + "address": "google_compute_firewall.default", + "mode": "managed", + "type": "google_compute_firewall", + "name": "default", + "provider_name": "google", + "schema_version": 1, + "values": { + "allow": [ + { + "ports": [ + "82", + "8080", + "1000-2000" + ], + "protocol": "tcp" + } + ], + "creation_timestamp": "2019-07-23T04:06:22.114-07:00", + "deny": [], + "description": "", + "destination_ranges": [], + "direction": "INGRESS", + "disabled": false, + "id": "test-firewall", + "name": "test-firewall", + "network": "https://www.googleapis.com/compute/v1/projects/gl-akopachevskyy-sql-db/global/networks/default", + "priority": 1000, + "project": "gl-akopachevskyy-sql-db", + "self_link": "https://www.googleapis.com/compute/v1/projects/gl-akopachevskyy-sql-db/global/firewalls/test-firewall", + "source_ranges": [], + "source_service_accounts": [], + "source_tags": [ + "web" + ], + "target_service_accounts": [], + "target_tags": [], + "timeouts": null + } + } + ] + } + } + }, + "configuration": { + "provider_config": { + "google": { + "name": "google", + "version_constraint": "~\u003e 2.5", + "expressions": { + "project": { + "constant_value": "gl-akopachevskyy-sql-db" + } + } + } + }, + "root_module": { + "resources": [ + { + "address": "google_compute_firewall.default", + "mode": "managed", + "type": "google_compute_firewall", + "name": "default", + "provider_config_key": "google", + "expressions": { + "allow": [ + { + "ports": { + "constant_value": [ + "82", + "8080", + "1000-2000" + ] + }, + "protocol": { + "constant_value": "tcp" + } + } + ], + "name": { + "constant_value": "test-firewall" + }, + "network": { + "constant_value": "default" + }, + "source_tags": { + "constant_value": [ + "web" + ] + } + }, + "schema_version": 1 + } + ], + "module_calls": { + "mymodule": { + "source": "./module", + "module": { + "resources": [ + { + "address": "google_compute_firewall.http", + "mode": "managed", + "type": "google_compute_firewall", + "name": "http", + "provider_config_key": "mymodule:google", + "expressions": { + "allow": [ + { + "ports": { + "constant_value": [ + "8181" + ] + }, + "protocol": { + "constant_value": "udp" + } + } + ], + "name": { + "constant_value": "server-fiewall" + }, + "network": { + "constant_value": "default" + }, + "source_tags": { + "constant_value": [ + "server" + ] + } + }, + "schema_version": 1 + } + ] + } + } + } + } + } +} diff --git a/mmv1/third_party/validator/tests/manifest/read_test.go.erb b/mmv1/third_party/validator/tests/source/read_test.go.erb similarity index 100% rename from mmv1/third_party/validator/tests/manifest/read_test.go.erb rename to mmv1/third_party/validator/tests/source/read_test.go.erb diff --git a/mmv1/third_party/validator/tests/utils.go b/mmv1/third_party/validator/tests/source/utils.go similarity index 100% rename from mmv1/third_party/validator/tests/utils.go rename to mmv1/third_party/validator/tests/source/utils.go