File tree 2 files changed +9
-3
lines changed
2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,12 @@ locals {
16
16
]
17
17
])
18
18
19
+ # # All the account deployments to be created
20
+ account_deployments = {
21
+ for region in local . enabled_regions : region => var . accounts
22
+ }
23
+
24
+ # # All the organizational deployment by key
19
25
organizational_deployments = { for x in local . organization_unit_deployments : x . key => x }
20
26
}
21
27
Original file line number Diff line number Diff line change @@ -52,14 +52,14 @@ resource "aws_cloudformation_stack_set_instance" "ou" {
52
52
53
53
# # Deploy the stackset to the following accounts
54
54
resource "aws_cloudformation_stack_set_instance" "accounts" {
55
- for_each = var . accounts != null ? toset (var . accounts ) : toset ([])
55
+ for_each = local . account_deployments
56
56
57
57
call_as = var. call_as
58
- region = each. value . region
58
+ region = each. key
59
59
stack_set_name = aws_cloudformation_stack_set. stackset . name
60
60
61
61
deployment_targets {
62
- accounts = var . accounts
62
+ accounts = each . value
63
63
}
64
64
65
65
depends_on = [
You can’t perform that action at this time.
0 commit comments