Repository: GoogleCloudPlatform/terraform-validator
Pull request #1390 (2023-02-23 23:57:37)

Fix caps in spanner resource schema accesses
<!-- Put a description of what this PR is for here, along with any references to issues that this resolves or contributes to -->

Should fix the broken build from a cross-merge between https://github.com/GoogleCloudPlatform/magic-modules/pull/7318 and https://github.com/GoogleCloudPlatform/magic-modules/pull/7324


<!--
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:

- [ ] 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).
- [ ] Ensured that all new fields I added that can be set by a user appear in at least one [example](https://github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/templates/terraform/examples) (for generated resources) or [third_party test](https://github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/third_party/terraform/tests) (for handwritten resources or update tests).
- [ ] [Generated Terraform providers](https://github.com/GoogleCloudPlatform/magic-modules/blob/main/docs/content/docs/getting-started/generate-providers.md), and ran [`make test` and `make lint`](https://googlecloudplatform.github.io/magic-modules/docs/getting-started/run-provider-tests/#run-unit-tests) in the generated providers to ensure it passes unit and linter tests.
- [ ] [Ran](https://github.com/GoogleCloudPlatform/magic-modules/blob/main/docs/content/docs/getting-started/run-provider-tests.md) relevant acceptance tests using my own Google Cloud project and credentials (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
- [ ] 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/7346


Patch:
diff --git a/go.mod b/go.mod
index 95bd3ba4..1ce95012 100644
--- a/go.mod
+++ b/go.mod
@@ -26,7 +26,7 @@ require (
 	github.com/hashicorp/go-cleanhttp v0.5.2
 	github.com/hashicorp/terraform-json v0.14.0
 	github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.0
-	github.com/hashicorp/terraform-provider-google v1.20.1-0.20230223184619-984817bc88a4
+	github.com/hashicorp/terraform-provider-google v1.20.1-0.20230223235211-a28617e79822
 	github.com/mitchellh/go-homedir v1.1.0
 	github.com/pkg/errors v0.9.1
 	github.com/sirupsen/logrus v1.9.0
diff --git a/go.sum b/go.sum
index 644db918..5e389744 100644
--- a/go.sum
+++ b/go.sum
@@ -514,8 +514,8 @@ github.com/hashicorp/terraform-plugin-log v0.7.0 h1:SDxJUyT8TwN4l5b5/VkiTIaQgY6R
 github.com/hashicorp/terraform-plugin-log v0.7.0/go.mod h1:p4R1jWBXRTvL4odmEkFfDdhUjHf9zcs/BCoNHAc7IK4=
 github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.0 h1:FtCLTiTcykdsURXPt/ku7fYXm3y19nbzbZcUxHx9RbI=
 github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.0/go.mod h1:80wf5oad1tW+oLnbXS4UTYmDCrl7BuN1Q+IA91X1a4Y=
-github.com/hashicorp/terraform-provider-google v1.20.1-0.20230223184619-984817bc88a4 h1:2HmPdDqlNj4gi9QuXSSkLRzUmQ6GzWY+sAYFQhSX0wI=
-github.com/hashicorp/terraform-provider-google v1.20.1-0.20230223184619-984817bc88a4/go.mod h1:pyZhyCZDq3hw8CosCtfG1e0gpLacdJyvqLbooxxTbns=
+github.com/hashicorp/terraform-provider-google v1.20.1-0.20230223235211-a28617e79822 h1:nIVbS1qkIE8nUbQ6HLlVj+20hqQAppIwQOHHr6H6M7A=
+github.com/hashicorp/terraform-provider-google v1.20.1-0.20230223235211-a28617e79822/go.mod h1:pyZhyCZDq3hw8CosCtfG1e0gpLacdJyvqLbooxxTbns=
 github.com/hashicorp/terraform-registry-address v0.1.0 h1:W6JkV9wbum+m516rCl5/NjKxCyTVaaUBbzYcMzBDO3U=
 github.com/hashicorp/terraform-registry-address v0.1.0/go.mod h1:EnyO2jYO6j29DTHbJcm00E5nQTFeTtyZH3H5ycydQ5A=
 github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0=


Test patch:
diff --git a/testdata/generatedconvert/CloudRunDomainMapping_cloudRunDomainMappingBasicExample_offline.json b/testdata/generatedconvert/CloudRunDomainMapping_cloudRunDomainMappingBasicExample_offline.json
new file mode 100644
index 00000000..3f115744
--- /dev/null
+++ b/testdata/generatedconvert/CloudRunDomainMapping_cloudRunDomainMappingBasicExample_offline.json
@@ -0,0 +1,63 @@
+[
+  {
+    "name": "//run.googleapis.com/projects/foobar/locations/us-central1/DomainMappings/tf-test-domainmeepmerp.gcp.tfacc.hashicorptest.com",
+    "asset_type": "run.googleapis.com/DomainMapping",
+    "resource": {
+      "version": "v1",
+      "discovery_document_uri": "https://www.googleapis.com/discovery/v1/apis/run/v1/rest",
+      "discovery_name": "DomainMapping",
+      "parent": "//cloudresourcemanager.googleapis.com/projects/foobar",
+      "data": {
+        "apiVersion": "domains.cloudrun.com/v1",
+        "kind": "DomainMapping",
+        "metadata": {
+          "name": "tf-test-domainmeepmerp.gcp.tfacc.hashicorptest.com",
+          "namespace": "foobar"
+        },
+        "spec": {
+          "certificateMode": "AUTOMATIC",
+          "routeName": "tf-test-cloudrun-srvmeepmerp"
+        }
+      }
+    },
+    "ancestors": [
+      "projects/foobar",
+      "folders/67890",
+      "organizations/12345"
+    ]
+  },
+  {
+    "name": "//run.googleapis.com/projects/foobar/locations/us-central1/services/tf-test-cloudrun-srvmeepmerp",
+    "asset_type": "run.googleapis.com/Service",
+    "resource": {
+      "version": "v1",
+      "discovery_document_uri": "https://www.googleapis.com/discovery/v1/apis/run/v1/rest",
+      "discovery_name": "Service",
+      "parent": "//cloudresourcemanager.googleapis.com/projects/foobar",
+      "data": {
+        "apiVersion": "serving.knative.dev/v1",
+        "kind": "Service",
+        "metadata": {
+          "name": "tf-test-cloudrun-srvmeepmerp",
+          "namespace": "foobar"
+        },
+        "spec": {
+          "template": {
+            "spec": {
+              "containers": [
+                {
+                  "image": "us-docker.pkg.dev/cloudrun/container/hello"
+                }
+              ]
+            }
+          }
+        }
+      }
+    },
+    "ancestors": [
+      "projects/foobar",
+      "folders/67890",
+      "organizations/12345"
+    ]
+  }
+]
diff --git a/testdata/generatedconvert/CloudRunService_cloudRunServiceBasicExample_offline.json b/testdata/generatedconvert/CloudRunService_cloudRunServiceBasicExample_offline.json
new file mode 100644
index 00000000..2e6aaeb9
--- /dev/null
+++ b/testdata/generatedconvert/CloudRunService_cloudRunServiceBasicExample_offline.json
@@ -0,0 +1,41 @@
+[
+  {
+    "name": "//run.googleapis.com/projects/foobar/locations/us-central1/services/tf-test-cloudrun-srvmeepmerp",
+    "asset_type": "run.googleapis.com/Service",
+    "resource": {
+      "version": "v1",
+      "discovery_document_uri": "https://www.googleapis.com/discovery/v1/apis/run/v1/rest",
+      "discovery_name": "Service",
+      "parent": "//cloudresourcemanager.googleapis.com/projects/foobar",
+      "data": {
+        "apiVersion": "serving.knative.dev/v1",
+        "kind": "Service",
+        "metadata": {
+          "name": "tf-test-cloudrun-srvmeepmerp"
+        },
+        "spec": {
+          "template": {
+            "spec": {
+              "containers": [
+                {
+                  "image": "us-docker.pkg.dev/cloudrun/container/hello"
+                }
+              ]
+            }
+          },
+          "traffic": [
+            {
+              "latestRevision": true,
+              "percent": 100
+            }
+          ]
+        }
+      }
+    },
+    "ancestors": [
+      "projects/foobar",
+      "folders/67890",
+      "organizations/12345"
+    ]
+  }
+]
diff --git a/testdata/generatedconvert/CloudRunService_cloudRunServiceMultipleEnvironmentVariablesExample_offline.json b/testdata/generatedconvert/CloudRunService_cloudRunServiceMultipleEnvironmentVariablesExample_offline.json
new file mode 100644
index 00000000..bd469bc7
--- /dev/null
+++ b/testdata/generatedconvert/CloudRunService_cloudRunServiceMultipleEnvironmentVariablesExample_offline.json
@@ -0,0 +1,54 @@
+[
+  {
+    "name": "//run.googleapis.com/projects/foobar/locations/us-central1/services/tf-test-cloudrun-srvmeepmerp",
+    "asset_type": "run.googleapis.com/Service",
+    "resource": {
+      "version": "v1",
+      "discovery_document_uri": "https://www.googleapis.com/discovery/v1/apis/run/v1/rest",
+      "discovery_name": "Service",
+      "parent": "//cloudresourcemanager.googleapis.com/projects/foobar",
+      "data": {
+        "apiVersion": "serving.knative.dev/v1",
+        "kind": "Service",
+        "metadata": {
+          "annotations": {
+            "generated-by": "magic-modules"
+          },
+          "name": "tf-test-cloudrun-srvmeepmerp"
+        },
+        "spec": {
+          "template": {
+            "spec": {
+              "containers": [
+                {
+                  "env": [
+                    {
+                      "name": "SOURCE",
+                      "value": "remote"
+                    },
+                    {
+                      "name": "TARGET",
+                      "value": "home"
+                    }
+                  ],
+                  "image": "us-docker.pkg.dev/cloudrun/container/hello"
+                }
+              ]
+            }
+          },
+          "traffic": [
+            {
+              "latestRevision": true,
+              "percent": 100
+            }
+          ]
+        }
+      }
+    },
+    "ancestors": [
+      "projects/foobar",
+      "folders/67890",
+      "organizations/12345"
+    ]
+  }
+]
diff --git a/testdata/generatedconvert/CloudRunService_cloudRunServiceSqlExample_offline.json b/testdata/generatedconvert/CloudRunService_cloudRunServiceSqlExample_offline.json
new file mode 100644
index 00000000..046d9b61
--- /dev/null
+++ b/testdata/generatedconvert/CloudRunService_cloudRunServiceSqlExample_offline.json
@@ -0,0 +1,64 @@
+[
+  {
+    "name": "//cloudsql.googleapis.com/projects/foobar/instances/tf-test-cloudrun-sqlmeepmerp",
+    "asset_type": "sqladmin.googleapis.com/Instance",
+    "resource": {
+      "version": "v1beta4",
+      "discovery_document_uri": "https://www.googleapis.com/discovery/v1/apis/sqladmin/v1beta4/rest",
+      "discovery_name": "DatabaseInstance",
+      "parent": "//cloudresourcemanager.googleapis.com/projects/foobar",
+      "data": {
+        "databaseVersion": "MYSQL_5_7",
+        "name": "tf-test-cloudrun-sqlmeepmerp",
+        "project": "foobar",
+        "region": "us-east1",
+        "settings": {
+          "activationPolicy": "ALWAYS",
+          "availabilityType": "ZONAL",
+          "dataDiskType": "PD_SSD",
+          "pricingPlan": "PER_USE",
+          "storageAutoResize": true,
+          "tier": "db-f1-micro"
+        }
+      }
+    },
+    "ancestors": [
+      "projects/foobar",
+      "folders/67890",
+      "organizations/12345"
+    ]
+  },
+  {
+    "name": "//run.googleapis.com/projects/foobar/locations/us-central1/services/tf-test-cloudrun-srvmeepmerp",
+    "asset_type": "run.googleapis.com/Service",
+    "resource": {
+      "version": "v1",
+      "discovery_document_uri": "https://www.googleapis.com/discovery/v1/apis/run/v1/rest",
+      "discovery_name": "Service",
+      "parent": "//cloudresourcemanager.googleapis.com/projects/foobar",
+      "data": {
+        "apiVersion": "serving.knative.dev/v1",
+        "kind": "Service",
+        "metadata": {
+          "name": "tf-test-cloudrun-srvmeepmerp"
+        },
+        "spec": {
+          "template": {
+            "spec": {
+              "containers": [
+                {
+                  "image": "us-docker.pkg.dev/cloudrun/container/hello"
+                }
+              ]
+            }
+          }
+        }
+      }
+    },
+    "ancestors": [
+      "projects/foobar",
+      "folders/67890",
+      "organizations/12345"
+    ]
+  }
+]