Skip to content

Commit

Permalink
Allows groups from other orgs
Browse files Browse the repository at this point in the history
  • Loading branch information
drebes committed May 17, 2023
1 parent 3cc6c71 commit b108838
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion fast/stages-multitenant/0-bootstrap-tenant/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ locals {
)
groups = {
for k, v in var.tenant_config.groups :
k => v == null ? null : "${v}@${var.organization.domain}"
k => v == null ? null : can(regex(".*@.*", v)) ? v : "${v}@${var.organization.domain}"
}
fast_features = {
for k, v in var.tenant_config.fast_features :
Expand Down
2 changes: 1 addition & 1 deletion fast/stages-multitenant/1-resman-tenant/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ locals {
)
groups = {
for k, v in var.groups :
k => v == null ? null : "${v}@${var.organization.domain}"
k => v == null ? null : can(regex(".*@.*", v)) ? v : "${v}@${var.organization.domain}"
}
groups_iam = {
for k, v in local.groups : k => v != null ? "group:${v}" : null
Expand Down
2 changes: 1 addition & 1 deletion fast/stages/0-bootstrap/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ locals {
)
groups = {
for k, v in var.groups :
k => "${v}@${var.organization.domain}"
k => can(regex(".*@.*", v)) ? v : "${v}@${var.organization.domain}"
}
groups_iam = {
for k, v in local.groups :
Expand Down
2 changes: 1 addition & 1 deletion fast/stages/0-bootstrap/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ variable "federated_identity_providers" {

variable "groups" {
# https://cloud.google.com/docs/enterprise/setup-checklist
description = "Group names to grant organization-level permissions."
description = "Group names or emails to grant organization-level permissions. If just the name is provided, the default organization domain is assumed."
type = map(string)
default = {
gcp-billing-admins = "gcp-billing-admins",
Expand Down
2 changes: 1 addition & 1 deletion fast/stages/1-resman/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ locals {
)
groups = {
for k, v in var.groups :
k => "${v}@${var.organization.domain}"
k => can(regex(".*@.*", v)) ? v : "${v}@${var.organization.domain}"
}
groups_iam = {
for k, v in local.groups : k => v != null ? "group:${v}" : null
Expand Down
2 changes: 1 addition & 1 deletion fast/stages/1-resman/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ variable "fast_features" {
variable "groups" {
# tfdoc:variable:source 0-bootstrap
# https://cloud.google.com/docs/enterprise/setup-checklist
description = "Group names to grant organization-level permissions."
description = "Group names or emails to grant organization-level permissions. If just the name is provided, the default organization domain is assumed."
type = object({
gcp-devops = optional(string)
gcp-network-admins = optional(string)
Expand Down

0 comments on commit b108838

Please sign in to comment.