Skip to content

Commit dd6c09c

Browse files
authored
fix: Fix of the new group structure (#1174)
1 parent a72d12f commit dd6c09c

File tree

10 files changed

+10
-40
lines changed

10 files changed

+10
-40
lines changed

0-bootstrap/outputs.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ output "common_config" {
6565

6666
output "required_groups" {
6767
description = "List of Google Groups created that are required by the Example Foundation steps."
68-
value = var.groups.create_required_groups == true ? module.required_group : tomap(var.groups.required_groups)
68+
value = var.groups.create_required_groups == false ? tomap(var.groups.required_groups) : tomap({ for key, value in module.required_group : key => value.id })
6969
}
7070

7171
output "optional_groups" {
7272
description = "List of Google Groups created that are optional to the Example Foundation steps."
73-
value = var.groups.create_optional_groups == true ? module.optional_group : tomap(var.groups.optional_groups)
73+
value = var.groups.create_optional_groups == false ? tomap(var.groups.optional_groups) : tomap({ for key, value in module.optional_group : key => value.id })
7474
}
7575

7676
/* ----------------------------------------

0-bootstrap/terraform.example.tfvars

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ groups = {
2525
# create_optional_groups = false # Change to true to create the optional_groups
2626
# billing_project = "REPLACE_ME" # Fill to create required or optional groups
2727
required_groups = {
28-
group_org_admins = "REPLACE_ME" # example "[email protected]"
29-
group_billing_admins = "REPLACE_ME" # example "[email protected]"
28+
group_org_admins = "REPLACE_ME" # example "[email protected]"
29+
group_billing_admins = "REPLACE_ME" # example "[email protected]"
30+
billing_data_users = "REPLACE_ME" # example "[email protected]"
31+
audit_data_users = "REPLACE_ME" # example "[email protected]"
32+
monitoring_workspace_users = "REPLACE_ME" # example "[email protected]"
3033
}
3134
# optional_groups = {
32-
# billing_data_users = "" #"[email protected]"
33-
# audit_data_users = "" #"[email protected]"
34-
# monitoring_workspace_users = "" #"[email protected]"
3535
# gcp_security_reviewer = "" #"[email protected]"
3636
# gcp_network_viewer = "" #"[email protected]"
3737
# gcp_scc_admin = "" #"[email protected]"

2-environments/envs/development/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
| Name | Description | Type | Default | Required |
55
|------|-------------|------|---------|:--------:|
6-
| monitoring\_workspace\_users | Google Workspace or Cloud Identity group that have access to Monitoring Workspaces. | `string` | n/a | yes |
76
| remote\_state\_bucket | Backend bucket to load Terraform Remote State Data from previous steps. | `string` | n/a | yes |
87
| tfc\_org\_name | Name of the TFC organization | `string` | `""` | no |
98

2-environments/envs/development/variables.tf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
variable "monitoring_workspace_users" {
18-
description = "Google Workspace or Cloud Identity group that have access to Monitoring Workspaces."
19-
type = string
20-
}
21-
2217
variable "remote_state_bucket" {
2318
description = "Backend bucket to load Terraform Remote State Data from previous steps."
2419
type = string

2-environments/envs/non-production/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
| Name | Description | Type | Default | Required |
55
|------|-------------|------|---------|:--------:|
6-
| monitoring\_workspace\_users | Google Workspace or Cloud Identity group that have access to Monitoring Workspaces. | `string` | n/a | yes |
76
| remote\_state\_bucket | Backend bucket to load Terraform Remote State Data from previous steps. | `string` | n/a | yes |
87
| tfc\_org\_name | Name of the TFC organization | `string` | `""` | no |
98

2-environments/envs/non-production/variables.tf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
variable "monitoring_workspace_users" {
18-
description = "Google Workspace or Cloud Identity group that have access to Monitoring Workspaces."
19-
type = string
20-
}
21-
2217
variable "remote_state_bucket" {
2318
description = "Backend bucket to load Terraform Remote State Data from previous steps."
2419
type = string

2-environments/envs/production/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
| Name | Description | Type | Default | Required |
55
|------|-------------|------|---------|:--------:|
6-
| monitoring\_workspace\_users | Google Workspace or Cloud Identity group that have access to Monitoring Workspaces. | `string` | n/a | yes |
76
| remote\_state\_bucket | Backend bucket to load Terraform Remote State Data from previous steps. | `string` | n/a | yes |
87
| tfc\_org\_name | Name of the TFC organization | `string` | `""` | no |
98

2-environments/envs/production/variables.tf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
variable "monitoring_workspace_users" {
18-
description = "Google Workspace or Cloud Identity group that have access to Monitoring Workspaces."
19-
type = string
20-
}
21-
2217
variable "remote_state_bucket" {
2318
description = "Backend bucket to load Terraform Remote State Data from previous steps."
2419
type = string

test/integration/envs/envs_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/gcloud"
2323
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/tft"
2424
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/utils"
25+
"github.com/gruntwork-io/terratest/modules/terraform"
2526
"github.com/stretchr/testify/assert"
2627

2728
"github.com/terraform-google-modules/terraform-example-foundation/test/integration/testutils"
@@ -38,11 +39,9 @@ func TestEnvs(t *testing.T) {
3839
utils.SetEnv(t, "GOOGLE_IMPERSONATE_SERVICE_ACCOUNT", terraformSA)
3940

4041
backend_bucket := bootstrap.GetStringOutput("gcs_bucket_tfstate")
41-
monitoringWorkspaceUsers := bootstrap.GetTFSetupStringOutput("monitoring_workspace_users")
4242

4343
vars := map[string]interface{}{
44-
"remote_state_bucket": backend_bucket,
45-
"monitoring_workspace_users": monitoringWorkspaceUsers,
44+
"remote_state_bucket": backend_bucket,
4645
}
4746

4847
backendConfig := map[string]interface{}{
@@ -87,6 +86,7 @@ func TestEnvs(t *testing.T) {
8786
}
8887
assert.Subset([]string{envName}, fldrTagValue, fmt.Sprintf("tag value should be %s for %s env folder", envName, envName))
8988

89+
monitoringWorkspaceUsers := terraform.OutputMap(t, bootstrap.GetTFOptions(), "required_groups")["monitoring_workspace_users"]
9090
for _, projectEnvOutput := range []struct {
9191
projectOutput string
9292
role string

test/setup/outputs.tf

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,6 @@ output "group_email" {
4444
value = var.group_email
4545
}
4646

47-
output "audit_data_users" {
48-
value = var.group_email
49-
}
50-
51-
output "billing_data_users" {
52-
value = var.group_email
53-
}
54-
55-
output "monitoring_workspace_users" {
56-
value = var.group_email
57-
}
58-
5947
output "groups" {
6048
value = {
6149
required_groups = {

0 commit comments

Comments
 (0)