Skip to content

Commit

Permalink
clean up map
Browse files Browse the repository at this point in the history
  • Loading branch information
megan07 committed Aug 14, 2020
1 parent 40b312d commit cd2fc5d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
13 changes: 0 additions & 13 deletions templates/terraform/constants/bigquery_dataset_access.go.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit cd2fc5d

Please sign in to comment.