File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
modules/services/cloud-bench Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 4
4
5
5
data "aws_caller_identity" "me" {}
6
6
7
- data "aws_organizations_organization" "org" {}
7
+ data "aws_organizations_organization" "org" {
8
+ count = var. is_organizational ? 1 : 0
9
+ }
8
10
9
11
data "sysdig_secure_trusted_cloud_identity" "trusted_identity" {
10
12
cloud_provider = " aws"
11
13
}
12
14
13
15
locals {
14
- member_account_ids = var. is_organizational ? [for a in data . aws_organizations_organization . org . non_master_accounts : a . id ] : []
16
+ member_account_ids = var. is_organizational ? [for a in data . aws_organizations_organization . org [ 0 ] . non_master_accounts : a . id ] : []
15
17
16
- benchmark_task_name = var. is_organizational ? " Organization: ${ data . aws_organizations_organization . org . id } " : data. aws_caller_identity . me . account_id
18
+ benchmark_task_name = var. is_organizational ? " Organization: ${ data . aws_organizations_organization . org [ 0 ] . id } " : data. aws_caller_identity . me . account_id
17
19
accounts_scope_clause = var. is_organizational ? " aws.accountId in (\" ${ join (" \" , \" " , local. member_account_ids )} \" )" : " aws.accountId = \" ${ data . aws_caller_identity . me . account_id } \" "
18
20
regions_scope_clause = length (var. benchmark_regions ) == 0 ? " " : " and aws.region in (\" ${ join (" \" , \" " , var. benchmark_regions )} \" )"
19
21
}
@@ -137,6 +139,6 @@ resource "aws_cloudformation_stack_set_instance" "stackset_instance" {
137
139
region = var. region
138
140
stack_set_name = aws_cloudformation_stack_set. stackset [0 ]. name
139
141
deployment_targets {
140
- organizational_unit_ids = [for root in data . aws_organizations_organization . org . roots : root . id ]
142
+ organizational_unit_ids = [for root in data . aws_organizations_organization . org [ 0 ] . roots : root . id ]
141
143
}
142
144
}
You can’t perform that action at this time.
0 commit comments