Skip to content

Commit

Permalink
fix parent id lookup for networking and security stages (#2744)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludoo authored Dec 4, 2024
1 parent 24b9049 commit 1a1886c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 15 deletions.
2 changes: 1 addition & 1 deletion fast/stages/1-resman/stage-2-networking.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module "net-folder" {
var.fast_stage_2.networking.folder_config.parent_id == null
? local.root_node
: try(
local.top_level_folder_ids[var.fast_stage_2.networking.folder_config],
local.top_level_folder_ids[var.fast_stage_2.networking.folder_config.parent_id],
var.fast_stage_2.networking.folder_config.parent_id
)
)
Expand Down
2 changes: 1 addition & 1 deletion fast/stages/1-resman/stage-2-security.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module "sec-folder" {
var.fast_stage_2.security.folder_config.parent_id == null
? local.root_node
: try(
local.top_level_folder_ids[var.fast_stage_2.security.folder_config],
local.top_level_folder_ids[var.fast_stage_2.security.folder_config.parent_id],
var.fast_stage_2.security.folder_config.parent_id
)
)
Expand Down
9 changes: 9 additions & 0 deletions tests/fast/stages/s1_resman/simple.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ fast_stage_2 = {
type = "github"
}
}
folder_config = {
parent_id = "shared"
}
}
security = {
cicd_config = {
Expand Down Expand Up @@ -141,4 +144,10 @@ top_level_folders = {
}
iam_by_principals = {}
}
shared = {
name = "Shared Infrastructure"
automation = {
enable = false
}
}
}
25 changes: 12 additions & 13 deletions tests/fast/stages/s1_resman/simple.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ values:
module.net-folder[0].google_folder.folder[0]:
deletion_protection: false
display_name: Networking
parent: organizations/123456789012
timeouts: null
? module.net-folder[0].google_folder_iam_binding.authoritative["organizations/123456789012/roles/networkFirewallPoliciesAdmin"]
: condition: []
Expand Down Expand Up @@ -1778,23 +1777,23 @@ values:
role: roles/storage.objectAdmin

counts:
google_folder: 13
google_folder: 14
google_folder_iam_binding: 75
google_org_policy_policy: 2
google_organization_iam_member: 19
google_project_iam_member: 26
google_service_account: 26
google_service_account_iam_binding: 26
google_storage_bucket: 12
google_storage_bucket_iam_binding: 24
google_storage_bucket_iam_member: 26
google_storage_bucket_object: 25
google_tags_tag_binding: 13
google_project_iam_member: 27
google_service_account: 27
google_service_account_iam_binding: 27
google_storage_bucket: 13
google_storage_bucket_iam_binding: 26
google_storage_bucket_iam_member: 27
google_storage_bucket_object: 26
google_tags_tag_binding: 14
google_tags_tag_key: 2
google_tags_tag_value: 12
google_tags_tag_value: 13
google_tags_tag_value_iam_binding: 4
modules: 52
resources: 305
modules: 55
resources: 316

outputs:
cicd_repositories:
Expand Down

0 comments on commit 1a1886c

Please sign in to comment.