From cd2fc5d38a7809d5fdf05e2e5927e82b50eb2d8c Mon Sep 17 00:00:00 2001 From: Megan Bang Date: Fri, 14 Aug 2020 11:13:08 -0500 Subject: [PATCH] clean up map --- .../constants/bigquery_dataset_access.go.erb | 13 ------------- .../post_create/bigquery_dataset_access.go.erb | 2 +- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/templates/terraform/constants/bigquery_dataset_access.go.erb b/templates/terraform/constants/bigquery_dataset_access.go.erb index 0023819ecad9..f4c924265d68 100644 --- a/templates/terraform/constants/bigquery_dataset_access.go.erb +++ b/templates/terraform/constants/bigquery_dataset_access.go.erb @@ -4,19 +4,6 @@ var bigqueryAccessRoleToPrimitiveMap = map[string]string { "roles/bigquery.dataViewer": "READER", } -var bigqueryAccessIamMemberToTypeMap = map[string]string{ - "serviceAccount": "user_by_email", - "user": "user_by_email", - "group": "group_by_email", - "domain": "domain", - "specialGroup": "special_group", - "allUsers": "iam_member", - "projectOwners": "special_group", - "projectReaders": "special_group", - "projectWriters": "special_group", - "allAuthenticatedUsers": "special_group", -} - func resourceBigQueryDatasetAccessRoleDiffSuppress(k, old, new string, d *schema.ResourceData) bool { if primitiveRole, ok := bigqueryAccessRoleToPrimitiveMap[new]; ok { return primitiveRole == old diff --git a/templates/terraform/post_create/bigquery_dataset_access.go.erb b/templates/terraform/post_create/bigquery_dataset_access.go.erb index a023e38ba09e..ed93a3f2648e 100644 --- a/templates/terraform/post_create/bigquery_dataset_access.go.erb +++ b/templates/terraform/post_create/bigquery_dataset_access.go.erb @@ -18,7 +18,7 @@ d.Set("api_updated_member", false) // iam_member is a generalized attribute, if the API can map it to a different member type on the backend, it will return // the correct member_type in the response. If it cannot be mapped to a different member type, it will stay in iam_member. -if d.Get("iam_member") != nil { +if iamMemberProp != "" { member_type, member, err := resourceBigQueryDatasetAccessReassignIamMemberInNestedObjectList(d, meta, res["access"].([]interface{})) if err != nil { fmt.Println(err)