Repository: GoogleCloudPlatform/terraform-validator
Pull request #402 (2021-11-24 17:33:38)

Add support for project and organization iam custom role resources to terraform-validator
<!-- Put a description of what this PR is for here, along with any references to issues that this resolves or contributes to -->
* Added handwritten converters for project_iam_custom_role and organization_iam_custom_role resources.
* Added entries to resource_converters.go.erb for these resources.
* Added entries to terraform_validator.rb for copying the handwriiten converter files to validator.



<!--
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).
- [ ] [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/master/templates/terraform/examples) (for generated resources) or [third_party test](https://github.com/GoogleCloudPlatform/magic-modules/tree/master/third_party/terraform/tests) (for handwritten resources or update tests).
- [ ] [Ran](https://github.com/hashicorp/terraform-provider-google/blob/master/.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).
- [ ] Read the [Release Notes Guide](https://github.com/GoogleCloudPlatform/magic-modules/blob/master/.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/5459


Patch:
diff --git a/converters/google/resources/organization_iam_custom_role.go b/converters/google/resources/organization_iam_custom_role.go
new file mode 100644
index 00000000..7cebdfcc
--- /dev/null
+++ b/converters/google/resources/organization_iam_custom_role.go
@@ -0,0 +1,87 @@
+package google
+
+import (
+	"reflect"
+
+	"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
+)
+
+const OrganizationIAMCustomRoleAssetType string = "iam.googleapis.com/Role"
+
+func resourceConverterOrganizationIAMCustomRole() ResourceConverter {
+	return ResourceConverter{
+		AssetType: OrganizationIAMCustomRoleAssetType,
+		Convert:   GetOrganizationIAMCustomRoleCaiObject,
+	}
+}
+
+func GetOrganizationIAMCustomRoleCaiObject(d TerraformResourceData, config *Config) ([]Asset, error) {
+	name, err := assetName(d, config, "//iam.googleapis.com/organizations/{{org_id}}/roles/{{role_id}}")
+	if err != nil {
+		return []Asset{}, err
+	}
+	if obj, err := GetOrganizationIAMCustomRoleApiObject(d, config); err == nil {
+		return []Asset{{
+			Name: name,
+			Type: OrganizationIAMCustomRoleAssetType,
+			Resource: &AssetResource{
+				Version:              "v1",
+				DiscoveryDocumentURI: "https://iam.googleapis.com/$discovery/rest?version=v1",
+				DiscoveryName:        "Role",
+				Data:                 obj,
+			},
+		}}, nil
+	} else {
+		return []Asset{}, err
+	}
+}
+
+func GetOrganizationIAMCustomRoleApiObject(d TerraformResourceData, config *Config) (map[string]interface{}, error) {
+	obj := make(map[string]interface{})
+
+	descriptionProp, err := expandOrganizationIAMCustomRoleDescription(d.Get("description"), d, config)
+	if err != nil {
+		return nil, err
+	} else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(descriptionProp)) && (ok || !reflect.DeepEqual(v, descriptionProp)) {
+		obj["description"] = descriptionProp
+	}
+
+	titleProp, err := expandOrganizationIAMCustomRoleTitle(d.Get("title"), d, config)
+	if err != nil {
+		return nil, err
+	} else if v, ok := d.GetOkExists("title"); !isEmptyValue(reflect.ValueOf(titleProp)) && (ok || !reflect.DeepEqual(v, titleProp)) {
+		obj["title"] = titleProp
+	}
+
+	stageProp, err := expandOrganizationIAMCustomRoleStage(d.Get("stage"), d, config)
+	if err != nil {
+		return nil, err
+	} else if v, ok := d.GetOkExists("stage"); !isEmptyValue(reflect.ValueOf(stageProp)) && (ok || !reflect.DeepEqual(v, stageProp)) {
+		obj["stage"] = stageProp
+	}
+
+	includedPermissionsProp, err := expandOrganizationIAMCustomRolePermissions(d.Get("permissions"), d, config)
+	if err != nil {
+		return nil, err
+	} else if v, ok := d.GetOkExists("permissions"); !isEmptyValue(reflect.ValueOf(includedPermissionsProp)) && (ok || !reflect.DeepEqual(v, includedPermissionsProp)) {
+		obj["includedPermissions"] = includedPermissionsProp
+	}
+
+	return obj, nil
+}
+
+func expandOrganizationIAMCustomRoleDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+	return v, nil
+}
+
+func expandOrganizationIAMCustomRoleTitle(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+	return v, nil
+}
+
+func expandOrganizationIAMCustomRoleStage(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+	return v, nil
+}
+
+func expandOrganizationIAMCustomRolePermissions(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+	return v.(*schema.Set).List(), nil
+}
diff --git a/converters/google/resources/project_iam_custom_role.go b/converters/google/resources/project_iam_custom_role.go
new file mode 100644
index 00000000..2b6020a6
--- /dev/null
+++ b/converters/google/resources/project_iam_custom_role.go
@@ -0,0 +1,87 @@
+package google
+
+import (
+	"reflect"
+
+	"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
+)
+
+const ProjectIAMCustomRoleAssetType string = "iam.googleapis.com/Role"
+
+func resourceConverterProjectIAMCustomRole() ResourceConverter {
+	return ResourceConverter{
+		AssetType: ProjectIAMCustomRoleAssetType,
+		Convert:   GetProjectIAMCustomRoleCaiObject,
+	}
+}
+
+func GetProjectIAMCustomRoleCaiObject(d TerraformResourceData, config *Config) ([]Asset, error) {
+	name, err := assetName(d, config, "//iam.googleapis.com/projects/{{project}}/roles/{{role_id}}")
+	if err != nil {
+		return []Asset{}, err
+	}
+	if obj, err := GetProjectIAMCustomRoleApiObject(d, config); err == nil {
+		return []Asset{{
+			Name: name,
+			Type: ProjectIAMCustomRoleAssetType,
+			Resource: &AssetResource{
+				Version:              "v1",
+				DiscoveryDocumentURI: "https://iam.googleapis.com/$discovery/rest?version=v1",
+				DiscoveryName:        "Role",
+				Data:                 obj,
+			},
+		}}, nil
+	} else {
+		return []Asset{}, err
+	}
+}
+
+func GetProjectIAMCustomRoleApiObject(d TerraformResourceData, config *Config) (map[string]interface{}, error) {
+	obj := make(map[string]interface{})
+
+	descriptionProp, err := expandProjectIAMCustomRoleDescription(d.Get("description"), d, config)
+	if err != nil {
+		return nil, err
+	} else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(descriptionProp)) && (ok || !reflect.DeepEqual(v, descriptionProp)) {
+		obj["description"] = descriptionProp
+	}
+
+	titleProp, err := expandProjectIAMCustomRoleTitle(d.Get("title"), d, config)
+	if err != nil {
+		return nil, err
+	} else if v, ok := d.GetOkExists("title"); !isEmptyValue(reflect.ValueOf(titleProp)) && (ok || !reflect.DeepEqual(v, titleProp)) {
+		obj["title"] = titleProp
+	}
+
+	stageProp, err := expandProjectIAMCustomRoleStage(d.Get("stage"), d, config)
+	if err != nil {
+		return nil, err
+	} else if v, ok := d.GetOkExists("stage"); !isEmptyValue(reflect.ValueOf(stageProp)) && (ok || !reflect.DeepEqual(v, stageProp)) {
+		obj["stage"] = stageProp
+	}
+
+	includedPermissionsProp, err := expandProjectIAMCustomRolePermissions(d.Get("permissions"), d, config)
+	if err != nil {
+		return nil, err
+	} else if v, ok := d.GetOkExists("permissions"); !isEmptyValue(reflect.ValueOf(includedPermissionsProp)) && (ok || !reflect.DeepEqual(v, includedPermissionsProp)) {
+		obj["includedPermissions"] = includedPermissionsProp
+	}
+
+	return obj, nil
+}
+
+func expandProjectIAMCustomRoleDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+	return v, nil
+}
+
+func expandProjectIAMCustomRoleTitle(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+	return v, nil
+}
+
+func expandProjectIAMCustomRoleStage(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+	return v, nil
+}
+
+func expandProjectIAMCustomRolePermissions(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+	return v.(*schema.Set).List(), nil
+}
diff --git a/converters/google/resources/resource_converters.go b/converters/google/resources/resource_converters.go
index 8b512946..85555b6f 100644
--- a/converters/google/resources/resource_converters.go
+++ b/converters/google/resources/resource_converters.go
@@ -125,21 +125,23 @@ func ResourceConverters() map[string][]ResourceConverter {
 			resourceConverterBigtableInstance(),
 			resourceConverterBigtableCluster(),
 		},
-		"google_organization_iam_policy":     {resourceConverterOrganizationIamPolicy()},
-		"google_organization_iam_binding":    {resourceConverterOrganizationIamBinding()},
-		"google_organization_iam_member":     {resourceConverterOrganizationIamMember()},
-		"google_project_organization_policy": {resourceConverterProjectOrgPolicy()},
-		"google_folder_iam_policy":           {resourceConverterFolderIamPolicy()},
-		"google_folder_iam_binding":          {resourceConverterFolderIamBinding()},
-		"google_folder_iam_member":           {resourceConverterFolderIamMember()},
-		"google_kms_crypto_key_iam_policy":   {resourceConverterKmsCryptoKeyIamPolicy()},
-		"google_kms_crypto_key_iam_binding":  {resourceConverterKmsCryptoKeyIamBinding()},
-		"google_kms_crypto_key_iam_member":   {resourceConverterKmsCryptoKeyIamMember()},
-		"google_kms_key_ring_iam_policy":     {resourceConverterKmsKeyRingIamPolicy()},
-		"google_kms_key_ring_iam_binding":    {resourceConverterKmsKeyRingIamBinding()},
-		"google_kms_key_ring_iam_member":     {resourceConverterKmsKeyRingIamMember()},
-		"google_project_iam_policy":          {resourceConverterProjectIamPolicy()},
-		"google_project_iam_binding":         {resourceConverterProjectIamBinding()},
-		"google_project_iam_member":          {resourceConverterProjectIamMember()},
+		"google_organization_iam_policy":      {resourceConverterOrganizationIamPolicy()},
+		"google_organization_iam_binding":     {resourceConverterOrganizationIamBinding()},
+		"google_organization_iam_member":      {resourceConverterOrganizationIamMember()},
+		"google_project_organization_policy":  {resourceConverterProjectOrgPolicy()},
+		"google_folder_iam_policy":            {resourceConverterFolderIamPolicy()},
+		"google_folder_iam_binding":           {resourceConverterFolderIamBinding()},
+		"google_folder_iam_member":            {resourceConverterFolderIamMember()},
+		"google_kms_crypto_key_iam_policy":    {resourceConverterKmsCryptoKeyIamPolicy()},
+		"google_kms_crypto_key_iam_binding":   {resourceConverterKmsCryptoKeyIamBinding()},
+		"google_kms_crypto_key_iam_member":    {resourceConverterKmsCryptoKeyIamMember()},
+		"google_kms_key_ring_iam_policy":      {resourceConverterKmsKeyRingIamPolicy()},
+		"google_kms_key_ring_iam_binding":     {resourceConverterKmsKeyRingIamBinding()},
+		"google_kms_key_ring_iam_member":      {resourceConverterKmsKeyRingIamMember()},
+		"google_project_iam_policy":           {resourceConverterProjectIamPolicy()},
+		"google_project_iam_binding":          {resourceConverterProjectIamBinding()},
+		"google_project_iam_member":           {resourceConverterProjectIamMember()},
+		"google_project_iam_custom_role":      {resourceConverterProjectIAMCustomRole()},
+		"google_organization_iam_custom_role": {resourceConverterOrganizationIAMCustomRole()},
 	}
 }


Test patch:
diff --git a/test/cli_test.go b/test/cli_test.go
index a03e7416..7fd331cf 100644
--- a/test/cli_test.go
+++ b/test/cli_test.go
@@ -98,9 +98,11 @@ func TestCLI(t *testing.T) {
 		{name: "example_kms_key_ring_iam_member"},
 		{name: "example_kms_key_ring_iam_policy"},
 		{name: "example_organization_iam_binding"},
+		{name: "example_organization_iam_custom_role"},
 		{name: "example_organization_iam_member"},
 		{name: "example_organization_iam_policy"},
 		{name: "example_project_iam"},
+		{name: "example_project_iam_custom_role"},
 		{name: "example_project_iam_policy"},
 		{name: "example_project_in_folder"},
 		{name: "example_project_in_org"},
diff --git a/test/read_test.go b/test/read_test.go
index 21ed9a8b..4f33be08 100644
--- a/test/read_test.go
+++ b/test/read_test.go
@@ -57,9 +57,11 @@ func TestReadPlannedAssetsCoverage(t *testing.T) {
 		{name: "example_kms_key_ring_iam_member"},
 		{name: "example_kms_key_ring_iam_policy"},
 		{name: "example_organization_iam_binding"},
+		{name: "example_organization_iam_custom_role"},
 		{name: "example_organization_iam_member"},
 		{name: "example_organization_iam_policy"},
 		{name: "example_project_iam"},
+		{name: "example_project_iam_custom_role"},
 		{name: "example_project_iam_policy"},
 		{name: "example_project_in_folder"},
 		{name: "example_project_in_org"},
diff --git a/testdata/templates/example_organization_iam_custom_role.json b/testdata/templates/example_organization_iam_custom_role.json
new file mode 100644
index 00000000..2af903ef
--- /dev/null
+++ b/testdata/templates/example_organization_iam_custom_role.json
@@ -0,0 +1,23 @@
+[
+  {
+    "name": "//iam.googleapis.com/organizations/{{.OrgID}}/roles/myCustomRole",
+    "asset_type": "iam.googleapis.com/Role",
+    "ancestry_path": "{{.Ancestry}}/project/{{.Provider.project}}",
+    "resource": {
+      "version": "v1",
+      "discovery_document_uri": "https://iam.googleapis.com/$discovery/rest?version=v1",
+      "discovery_name": "Role",
+      "parent": "//cloudresourcemanager.googleapis.com/projects/{{.Provider.project}}",
+      "data": {
+        "description": "A description",
+        "includedPermissions": [
+          "iam.roles.delete",
+          "iam.roles.list",
+          "iam.roles.create"
+        ],
+        "stage": "GA",
+        "title": "My Custom Role"
+      }
+    }
+  }
+]
diff --git a/testdata/templates/example_organization_iam_custom_role.tf b/testdata/templates/example_organization_iam_custom_role.tf
new file mode 100644
index 00000000..eb2d76c4
--- /dev/null
+++ b/testdata/templates/example_organization_iam_custom_role.tf
@@ -0,0 +1,36 @@
+/**
+ * Copyright 2021 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_organization_iam_custom_role" "my-custom-role" {
+org_id = "{{.OrgID}}"
+role_id = "myCustomRole"
+title = "My Custom Role"
+description = "A description"
+permissions = ["iam.roles.list", "iam.roles.create", "iam.roles.delete"]
+}
\ No newline at end of file
diff --git a/testdata/templates/example_organization_iam_custom_role.tfplan.json b/testdata/templates/example_organization_iam_custom_role.tfplan.json
new file mode 100644
index 00000000..2e1ad72f
--- /dev/null
+++ b/testdata/templates/example_organization_iam_custom_role.tfplan.json
@@ -0,0 +1,102 @@
+{
+  "format_version": "0.1",
+  "terraform_version": "0.13.5",
+  "planned_values": {
+    "root_module": {
+      "resources": [
+        {
+          "address": "google_organization_iam_custom_role.my-custom-role",
+          "mode": "managed",
+          "type": "google_organization_iam_custom_role",
+          "name": "my-custom-role",
+          "provider_name": "registry.terraform.io/hashicorp/google",
+          "schema_version": 0,
+          "values": {
+            "description": "A description",
+            "org_id": "{{.OrgID}}",
+            "permissions": [
+              "iam.roles.create",
+              "iam.roles.delete",
+              "iam.roles.list"
+            ],
+            "role_id": "myCustomRole",
+            "stage": "GA",
+            "title": "My Custom Role"
+          }
+        }
+      ]
+    }
+  },
+  "resource_changes": [
+    {
+      "address": "google_organization_iam_custom_role.my-custom-role",
+      "mode": "managed",
+      "type": "google_organization_iam_custom_role",
+      "name": "my-custom-role",
+      "provider_name": "registry.terraform.io/hashicorp/google",
+      "change": {
+        "actions": [
+          "create"
+        ],
+        "before": null,
+        "after": {
+          "description": "A description",
+          "org_id": "{{.OrgID}}",
+          "permissions": [
+            "iam.roles.create",
+            "iam.roles.delete",
+            "iam.roles.list"
+          ],
+          "role_id": "myCustomRole",
+          "stage": "GA",
+          "title": "My Custom Role"
+        },
+        "after_unknown": {
+          "deleted": true,
+          "id": true,
+          "name": true,
+          "permissions": [
+            false,
+            false,
+            false
+          ]
+        }
+      }
+    }
+  ],
+  "configuration": {
+    "root_module": {
+      "resources": [
+        {
+          "address": "google_organization_iam_custom_role.my-custom-role",
+          "mode": "managed",
+          "type": "google_organization_iam_custom_role",
+          "name": "my-custom-role",
+          "provider_config_key": "google",
+          "expressions": {
+            "description": {
+              "constant_value": "A description"
+            },
+            "org_id": {
+              "constant_value": "{{.OrgID}}"
+            },
+            "permissions": {
+              "constant_value": [
+                "iam.roles.list",
+                "iam.roles.create",
+                "iam.roles.delete"
+              ]
+            },
+            "role_id": {
+              "constant_value": "myCustomRole"
+            },
+            "title": {
+              "constant_value": "My Custom Role"
+            }
+          },
+          "schema_version": 0
+        }
+      ]
+    }
+  }
+}
\ No newline at end of file
diff --git a/testdata/templates/example_project_iam_custom_role.json b/testdata/templates/example_project_iam_custom_role.json
new file mode 100644
index 00000000..4c7a259d
--- /dev/null
+++ b/testdata/templates/example_project_iam_custom_role.json
@@ -0,0 +1,23 @@
+[
+  {
+    "name": "//iam.googleapis.com/projects/{{.Provider.project}}/roles/myCustomRole",
+    "asset_type": "iam.googleapis.com/Role",
+    "ancestry_path": "{{.Ancestry}}/project/{{.Provider.project}}",
+    "resource": {
+      "version": "v1",
+      "discovery_document_uri": "https://iam.googleapis.com/$discovery/rest?version=v1",
+      "discovery_name": "Role",
+      "parent": "//cloudresourcemanager.googleapis.com/projects/{{.Provider.project}}",
+      "data": {
+        "description": "A description",
+        "includedPermissions": [
+          "iam.roles.delete",
+          "iam.roles.list",
+          "iam.roles.create"
+        ],
+        "stage": "GA",
+        "title": "My Custom Role"
+      }
+    }
+  }
+]
\ No newline at end of file
diff --git a/testdata/templates/example_project_iam_custom_role.tf b/testdata/templates/example_project_iam_custom_role.tf
new file mode 100644
index 00000000..cf7752af
--- /dev/null
+++ b/testdata/templates/example_project_iam_custom_role.tf
@@ -0,0 +1,36 @@
+/**
+ * Copyright 2021 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_project_iam_custom_role" "my-custom-role" {
+  project = "{{.Provider.project}}"
+  role_id = "myCustomRole"
+  title = "My Custom Role"
+  description = "A description"
+  permissions = ["iam.roles.list", "iam.roles.create", "iam.roles.delete"]
+}
\ No newline at end of file
diff --git a/testdata/templates/example_project_iam_custom_role.tfplan.json b/testdata/templates/example_project_iam_custom_role.tfplan.json
new file mode 100644
index 00000000..a4b32516
--- /dev/null
+++ b/testdata/templates/example_project_iam_custom_role.tfplan.json
@@ -0,0 +1,102 @@
+{
+  "format_version": "0.1",
+  "terraform_version": "0.13.5",
+  "planned_values": {
+    "root_module": {
+      "resources": [
+        {
+          "address": "google_project_iam_custom_role.my-custom-role",
+          "mode": "managed",
+          "type": "google_project_iam_custom_role",
+          "name": "my-custom-role",
+          "provider_name": "registry.terraform.io/hashicorp/google",
+          "schema_version": 0,
+          "values": {
+            "description": "A description",
+            "permissions": [
+              "iam.roles.create",
+              "iam.roles.delete",
+              "iam.roles.list"
+            ],
+            "project": "{{.Provider.project}}",
+            "role_id": "myCustomRole",
+            "stage": "GA",
+            "title": "My Custom Role"
+          }
+        }
+      ]
+    }
+  },
+  "resource_changes": [
+    {
+      "address": "google_project_iam_custom_role.my-custom-role",
+      "mode": "managed",
+      "type": "google_project_iam_custom_role",
+      "name": "my-custom-role",
+      "provider_name": "registry.terraform.io/hashicorp/google",
+      "change": {
+        "actions": [
+          "create"
+        ],
+        "before": null,
+        "after": {
+          "description": "A description",
+          "permissions": [
+            "iam.roles.create",
+            "iam.roles.delete",
+            "iam.roles.list"
+          ],
+          "project": "{{.Provider.project}}",
+          "role_id": "myCustomRole",
+          "stage": "GA",
+          "title": "My Custom Role"
+        },
+        "after_unknown": {
+          "deleted": true,
+          "id": true,
+          "name": true,
+          "permissions": [
+            false,
+            false,
+            false
+          ]
+        }
+      }
+    }
+  ],
+  "configuration": {
+    "root_module": {
+      "resources": [
+        {
+          "address": "google_project_iam_custom_role.my-custom-role",
+          "mode": "managed",
+          "type": "google_project_iam_custom_role",
+          "name": "my-custom-role",
+          "provider_config_key": "google",
+          "expressions": {
+            "description": {
+              "constant_value": "A description"
+            },
+            "permissions": {
+              "constant_value": [
+                "iam.roles.list",
+                "iam.roles.create",
+                "iam.roles.delete"
+              ]
+            },
+            "project": {
+              "constant_value": "{{.Provider.project}}"
+            },
+            "role_id": {
+              "constant_value": "myCustomRole"
+            },
+            "title": {
+              "constant_value": "My Custom Role"
+            }
+          },
+          "schema_version": 0
+        }
+      ]
+    }
+  }
+}
\ No newline at end of file