Skip to content

Commit 1d621dc

Browse files
Refractor project_iam_member list schema code (GoogleCloudPlatform#18009)
1 parent 7b2c6fe commit 1d621dc

2 files changed

Lines changed: 13 additions & 9 deletions

File tree

mmv1/third_party/terraform/services/resourcemanager/iam_project.go.tmpl

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,21 @@ func ProjectIamParentResourceIdentityParser(d *schema.ResourceData, identity *sc
6060
return s, nil
6161
}
6262

63+
func ProjectIamMemberResource() *schema.Resource {
64+
return tpgiamresource.ResourceIamMember(
65+
IamProjectSchema,
66+
NewProjectIamUpdater,
67+
ProjectIdParseFunc,
68+
tpgiamresource.IamWithBatching,
69+
tpgiamresource.IamWithParentResourceIdentity(ProjectIamParentResourceIdentityParser),
70+
)
71+
}
72+
6373
// NewProjectIamMemberListResource returns the list implementation for google_project_iam_member.
6474
func NewProjectIamMemberListResource() list.ListResource {
6575
return tpgiamresource.NewIamMemberListResource(
6676
"google_project_iam_member",
67-
tpgiamresource.ResourceIamMember(
68-
IamProjectSchema,
69-
NewProjectIamUpdater,
70-
ProjectIdParseFunc,
71-
tpgiamresource.IamWithBatching,
72-
tpgiamresource.IamWithParentResourceIdentity(ProjectIamParentResourceIdentityParser),
73-
),
77+
ProjectIamMemberResource(),
7478
NewProjectIamUpdater,
7579
tpgiamresource.IamMemberListCallConfig{
7680
ParentResourceField: "project",
@@ -158,7 +162,7 @@ func init() {
158162
Name: "google_project_iam_member",
159163
ProductName: "resourcemanager",
160164
Type: registry.SchemaTypeIAMResource,
161-
Schema: tpgiamresource.ResourceIamMember(IamProjectSchema, NewProjectIamUpdater, ProjectIdParseFunc, tpgiamresource.IamWithBatching, tpgiamresource.IamWithParentResourceIdentity(ProjectIamParentResourceIdentityParser)),
165+
Schema: ProjectIamMemberResource(),
162166
}.Register()
163167
registry.Schema{
164168
Name: "google_project_iam_binding",

mmv1/third_party/terraform/website/docs/list-resources/google_project_iam_member.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,5 @@ By default each result includes **resource identity** for `google_project_iam_me
5656

5757
With `include_resource = true` on the `list` block, results also include the full resource-style
5858
attributes documented for the managed
59-
[`google_service_account` resource](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/google_project_iam#attributes-reference)
59+
[`google_project_iam_member` resource](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/google_project_iam#attributes-reference)
6060
(for example `etag`and `condition` where present in state).

0 commit comments

Comments
 (0)