Skip to content

Commit

Permalink
Unbreak IAM.
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
paddycarver authored and modular-magician committed Aug 14, 2019
1 parent 5a6917d commit 8294271
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
12 changes: 11 additions & 1 deletion google-beta/iam.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,18 @@ func createIamBindingsMap(bindings []*cloudresourcemanager.Binding) map[string]m
}
// Get each member (user/principal) for the binding
for _, m := range b.Members {
// members are in <type>:<value> format
// <type> is case sensitive
// <value> isn't
// so let's lowercase the value and leave the type alone
pieces := strings.Split(m, ":")
if len(pieces) > 1 {
pieces[1] = strings.ToLower(pieces[1])
}
m = strings.Join(pieces, ":")

// Add the member
bm[b.Role][strings.ToLower(m)] = struct{}{}
bm[b.Role][m] = struct{}{}
}
}
return bm
Expand Down
1 change: 1 addition & 0 deletions google-beta/resource_sql_database_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/hashicorp/terraform/helper/acctest"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/terraform"

sqladmin "google.golang.org/api/sqladmin/v1beta4"
)

Expand Down

0 comments on commit 8294271

Please sign in to comment.