Repository: GoogleCloudPlatform/terraform-validator
Pull request #699 (2022-05-12 20:36:33)

add registry manifest file
<!-- Put a description of what this PR is for here, along with any references to issues that this resolves or contributes to -->




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

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

<!-- AUTOCHANGELOG for Downstream PRs.

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

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

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

```release-note:none

```

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


Patch:
diff --git a/converters/google/resources/resource_converters.go b/converters/google/resources/resource_converters.go
index 7308e53a..1c50e59e 100644
--- a/converters/google/resources/resource_converters.go
+++ b/converters/google/resources/resource_converters.go
@@ -73,6 +73,7 @@ func ResourceConverters() map[string][]ResourceConverter {
 		"google_kms_key_ring":                                     {resourceConverterKMSKeyRing()},
 		"google_filestore_instance":                               {resourceConverterFilestoreInstance()},
 		"google_access_context_manager_service_perimeter":         {resourceConverterAccessContextManagerServicePerimeter()},
+		"google_access_context_manager_access_policy":             {resourceConverterAccessContextManagerAccessPolicy()},
 		"google_cloud_run_service":                                {resourceConverterCloudRunService()},
 		"google_cloud_run_domain_mapping":                         {resourceConverterCloudRunDomainMapping()},
 		"google_cloudfunctions_function":                          {resourceConverterCloudFunctionsCloudFunction()},
diff --git a/go.mod b/go.mod
index 5d7f1653..f6fe6eb5 100644
--- a/go.mod
+++ b/go.mod
@@ -12,7 +12,7 @@ require (
 	github.com/hashicorp/go-cleanhttp v0.5.2
 	github.com/hashicorp/terraform-json v0.13.0
 	github.com/hashicorp/terraform-plugin-sdk/v2 v2.10.1
-	github.com/hashicorp/terraform-provider-google v1.20.1-0.20220512165904-44248ab85cec
+	github.com/hashicorp/terraform-provider-google v1.20.1-0.20220512170723-9f3e9c8765a1
 	github.com/kr/pretty v0.3.0 // indirect
 	github.com/mitchellh/go-homedir v1.1.0
 	github.com/onsi/gomega v1.17.0 // indirect
diff --git a/go.sum b/go.sum
index d6a17193..54577195 100644
--- a/go.sum
+++ b/go.sum
@@ -696,8 +696,8 @@ github.com/hashicorp/terraform-plugin-log v0.2.0 h1:rjflRuBqCnSk3UHOR25MP1G5BDLK
 github.com/hashicorp/terraform-plugin-log v0.2.0/go.mod h1:E1kJmapEHzqu1x6M++gjvhzM2yMQNXPVWZRCB8sgYjg=
 github.com/hashicorp/terraform-plugin-sdk/v2 v2.10.1 h1:B9AocC+dxrCqcf4vVhztIkSkt3gpRjUkEka8AmZWGlQ=
 github.com/hashicorp/terraform-plugin-sdk/v2 v2.10.1/go.mod h1:FjM9DXWfP0w/AeOtJoSKHBZ01LqmaO6uP4bXhv3fekw=
-github.com/hashicorp/terraform-provider-google v1.20.1-0.20220512165904-44248ab85cec h1:PDwUTCYggzg2OUTqJ+4KuKxHY2CLW1TfS1svkMbq1ZU=
-github.com/hashicorp/terraform-provider-google v1.20.1-0.20220512165904-44248ab85cec/go.mod h1:Rt/7kFHGCqyKTWt5NKpz4X8HrX8hApKVqbY8bKonN1s=
+github.com/hashicorp/terraform-provider-google v1.20.1-0.20220512170723-9f3e9c8765a1 h1:isS7PnMSuQ3IU52b4h91hhhNnF2sn3ZvJ1SwgnTvn7c=
+github.com/hashicorp/terraform-provider-google v1.20.1-0.20220512170723-9f3e9c8765a1/go.mod h1:Rt/7kFHGCqyKTWt5NKpz4X8HrX8hApKVqbY8bKonN1s=
 github.com/hashicorp/terraform-registry-address v0.0.0-20210412075316-9b2996cce896 h1:1FGtlkJw87UsTMg5s8jrekrHmUPUJaMcu6ELiVhQrNw=
 github.com/hashicorp/terraform-registry-address v0.0.0-20210412075316-9b2996cce896/go.mod h1:bzBPnUIkI0RxauU8Dqo+2KrZZ28Cf48s8V6IHt3p4co=
 github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0=


Test patch:
diff --git a/test/cli_test.go b/test/cli_test.go
index 5bd0f957..d4aebf39 100644
--- a/test/cli_test.go
+++ b/test/cli_test.go
@@ -65,6 +65,7 @@ func TestCLI(t *testing.T) {
 		{name: "example_storage_bucket_iam_binding", compareConvertOutput: compareMergedIamBindingOutput},
 		{name: "example_storage_bucket_iam_member", compareConvertOutput: compareMergedIamMemberOutput},
 		// auto inserted tests that are not in list above or manually inserted in read_test.go
+		{name: "example_access_context_manager_access_policy"},
 		{name: "example_access_context_manager_service_perimeter"},
 		{name: "example_bigquery_dataset"},
 		{name: "example_bigquery_dataset_iam_binding"},
diff --git a/test/environment_test.go b/test/environment_test.go
index bbb011aa..94b94a31 100644
--- a/test/environment_test.go
+++ b/test/environment_test.go
@@ -21,7 +21,7 @@ const (
 	defaultOrganizationDomain = "meep.test.com"
 	defaultOrganizationTarget = "13579"
 	defaultProject            = "foobar"
-	defaultProviderVersion    = "4.4.0"
+	defaultProviderVersion    = "4.20.0"
 	defaultRegion             = "us-central1"
 	defaultServiceAccount     = "meep@foobar.iam.gserviceaccount.com"
 )
diff --git a/test/read_test.go b/test/read_test.go
index 763305c2..865b0679 100644
--- a/test/read_test.go
+++ b/test/read_test.go
@@ -29,6 +29,7 @@ func TestReadPlannedAssetsCoverage(t *testing.T) {
 		{name: "example_storage_bucket_iam_binding"},
 		{name: "example_storage_bucket_iam_member"},
 		// auto inserted tests that are not in list above or manually inserted in cli_test.go
+		{name: "example_access_context_manager_access_policy"},
 		{name: "example_access_context_manager_service_perimeter"},
 		{name: "example_bigquery_dataset"},
 		{name: "example_bigquery_dataset_iam_binding"},
diff --git a/testdata/templates/example_access_context_manager_access_policy.json b/testdata/templates/example_access_context_manager_access_policy.json
new file mode 100644
index 00000000..fe3b4aae
--- /dev/null
+++ b/testdata/templates/example_access_context_manager_access_policy.json
@@ -0,0 +1,20 @@
+[
+    {
+        "name": "//accesscontextmanager.googleapis.com/accessPolicies/placeholder-BpLnfgDs",
+        "asset_type": "accesscontextmanager.googleapis.com/AccessPolicy",
+        "ancestry_path": "{{.Ancestry}}/project/{{.Provider.project}}",
+        "resource": {
+            "version": "v1",
+            "discovery_document_uri": "https://www.googleapis.com/discovery/v1/apis/accesscontextmanager/v1/rest",
+            "discovery_name": "AccessPolicy",
+            "parent": "//cloudresourcemanager.googleapis.com/projects/{{.Provider.project}}",
+            "data": {
+                "parent": "organizations/{{.OrgID}}",
+                "scopes": [
+                    "projects/{{.Provider.project}}"
+                ],
+                "title": "Scoped Access Policy"
+            }
+        }
+    }
+]
\ No newline at end of file
diff --git a/testdata/templates/example_access_context_manager_access_policy.tf b/testdata/templates/example_access_context_manager_access_policy.tf
new file mode 100644
index 00000000..9c4f0226
--- /dev/null
+++ b/testdata/templates/example_access_context_manager_access_policy.tf
@@ -0,0 +1,34 @@
+/**
+ * Copyright 2019 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+terraform {
+  required_providers {
+    google = {
+      source = "hashicorp/google"
+      version = "~> {{.Provider.version}}"
+    }
+  }
+}
+
+provider "google" {
+  {{if .Provider.credentials }}credentials = "{{.Provider.credentials}}"{{end}}
+}
+
+resource "google_access_context_manager_access_policy" "access-policy" {
+  parent = "organizations/{{.OrgID}}"
+  title  = "Scoped Access Policy"
+  scopes = ["projects/{{.Provider.project}}"]
+}
\ No newline at end of file
diff --git a/testdata/templates/example_access_context_manager_access_policy.tfplan.json b/testdata/templates/example_access_context_manager_access_policy.tfplan.json
new file mode 100644
index 00000000..849ee349
--- /dev/null
+++ b/testdata/templates/example_access_context_manager_access_policy.tfplan.json
@@ -0,0 +1,90 @@
+{
+    "format_version": "0.1",
+    "terraform_version": "0.12.31",
+    "planned_values": {
+        "root_module": {
+            "resources": [
+                {
+                    "address": "google_access_context_manager_access_policy.access-policy",
+                    "mode": "managed",
+                    "type": "google_access_context_manager_access_policy",
+                    "name": "access-policy",
+                    "provider_name": "google",
+                    "schema_version": 0,
+                    "values": {
+                        "parent": "organizations/{{.OrgID}}",
+                        "scopes": [
+                            "projects/{{.Provider.project}}"
+                        ],
+                        "timeouts": null,
+                        "title": "Scoped Access Policy"
+                    }
+                }
+            ]
+        }
+    },
+    "resource_changes": [
+        {
+            "address": "google_access_context_manager_access_policy.access-policy",
+            "mode": "managed",
+            "type": "google_access_context_manager_access_policy",
+            "name": "access-policy",
+            "provider_name": "google",
+            "change": {
+                "actions": [
+                    "create"
+                ],
+                "before": null,
+                "after": {
+                    "parent": "organizations/{{.OrgID}}",
+                    "scopes": [
+                        "projects/{{.Provider.project}}"
+                    ],
+                    "timeouts": null,
+                    "title": "Scoped Access Policy"
+                },
+                "after_unknown": {
+                    "create_time": true,
+                    "id": true,
+                    "name": true,
+                    "scopes": [
+                        false
+                    ],
+                    "update_time": true
+                }
+            }
+        }
+    ],
+    "configuration": {
+        "provider_config": {
+            "google": {
+                "name": "google"
+            }
+        },
+        "root_module": {
+            "resources": [
+                {
+                    "address": "google_access_context_manager_access_policy.access-policy",
+                    "mode": "managed",
+                    "type": "google_access_context_manager_access_policy",
+                    "name": "access-policy",
+                    "provider_config_key": "google",
+                    "expressions": {
+                        "parent": {
+                            "constant_value": "organizations/{{.OrgID}}"
+                        },
+                        "scopes": {
+                            "constant_value": [
+                                "projects/{{.Provider.project}}"
+                            ]
+                        },
+                        "title": {
+                            "constant_value": "Scoped Access Policy"
+                        }
+                    },
+                    "schema_version": 0
+                }
+            ]
+        }
+    }
+}
\ No newline at end of file
diff --git a/testdata/templates/example_filestore_instance.json b/testdata/templates/example_filestore_instance.json
index 2dfe453b..2d38ec5f 100644
--- a/testdata/templates/example_filestore_instance.json
+++ b/testdata/templates/example_filestore_instance.json
@@ -17,6 +17,7 @@
         ],
         "networks": [
           {
+            "connectMode": "DIRECT_PEERING",
             "modes": [
               "MODE_IPV4"
             ],
diff --git a/testdata/templates/example_filestore_instance.tfplan.json b/testdata/templates/example_filestore_instance.tfplan.json
index 505d5b80..e1ab2894 100644
--- a/testdata/templates/example_filestore_instance.tfplan.json
+++ b/testdata/templates/example_filestore_instance.tfplan.json
@@ -1,6 +1,6 @@
 {
   "format_version": "0.1",
-  "terraform_version": "0.13.5",
+  "terraform_version": "0.12.31",
   "planned_values": {
     "root_module": {
       "resources": [
@@ -9,20 +9,24 @@
           "mode": "managed",
           "type": "google_filestore_instance",
           "name": "test",
-          "provider_name": "registry.terraform.io/hashicorp/google",
-          "schema_version": 0,
+          "provider_name": "google",
+          "schema_version": 1,
           "values": {
             "description": null,
             "file_shares": [
               {
                 "capacity_gb": 2660,
-                "name": "share1"
+                "name": "share1",
+                "nfs_export_options": []
               }
             ],
+            "kms_key_name": null,
             "labels": null,
+            "location": "us-central1-b",
             "name": "test-instance",
             "networks": [
               {
+                "connect_mode": "DIRECT_PEERING",
                 "modes": [
                   "MODE_IPV4"
                 ],
@@ -30,8 +34,7 @@
               }
             ],
             "tier": "BASIC_SSD",
-            "timeouts": null,
-            "location": "us-central1-b"
+            "timeouts": null
           }
         }
       ]
@@ -43,7 +46,7 @@
       "mode": "managed",
       "type": "google_filestore_instance",
       "name": "test",
-      "provider_name": "registry.terraform.io/hashicorp/google",
+      "provider_name": "google",
       "change": {
         "actions": [
           "create"
@@ -54,13 +57,17 @@
           "file_shares": [
             {
               "capacity_gb": 2660,
-              "name": "share1"
+              "name": "share1",
+              "nfs_export_options": []
             }
           ],
+          "kms_key_name": null,
           "labels": null,
+          "location": "us-central1-b",
           "name": "test-instance",
           "networks": [
             {
+              "connect_mode": "DIRECT_PEERING",
               "modes": [
                 "MODE_IPV4"
               ],
@@ -68,12 +75,16 @@
             }
           ],
           "tier": "BASIC_SSD",
-          "timeouts": null,
-          "location": "us-central1-b"
+          "timeouts": null
         },
         "after_unknown": {
           "create_time": true,
           "etag": true,
+          "file_shares": [
+            {
+                "nfs_export_options": []
+            }
+        ],
           "id": true,
           "networks": [
             {
@@ -84,7 +95,8 @@
               "reserved_ip_range": true
             }
           ],
-          "project": true
+          "project": true,
+          "zone": true
         }
       }
     }
@@ -92,20 +104,7 @@
   "configuration": {
     "provider_config": {
       "google": {
-        "name": "google",
-        "expressions": {
-          "project": {
-            "constant_value": "{{.Provider.project}}"
-          }
-        }
-      },
-      "google": {
-        "name": "google",
-        "expressions": {
-          "project": {
-            "constant_value": "{{.Provider.project}}"
-          }
-        }
+        "name": "google"
       }
     },
     "root_module": {
@@ -127,6 +126,9 @@
                 }
               }
             ],
+            "location": {
+              "constant_value": "us-central1-b"
+            },
             "name": {
               "constant_value": "test-instance"
             },
@@ -144,12 +146,9 @@
             ],
             "tier": {
               "constant_value": "BASIC_SSD"
-            },
-            "location": {
-              "constant_value": "us-central1-b"
             }
           },
-          "schema_version": 0
+          "schema_version": 1
         }
       ]
     }