File tree Expand file tree Collapse file tree 3 files changed +12
-4
lines changed Expand file tree Collapse file tree 3 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 33This module creates following resources.
44
55- ` aws_macie2_account `
6- - ` aws_macie2_organization_configuration `
6+ - ` aws_macie2_organization_configuration ` (optional)
77- ` aws_macie2_member ` (optional)
88- ` aws_macie2_classification_export_configuration ` (optional)
99
Original file line number Diff line number Diff line change @@ -89,6 +89,11 @@ resource "aws_macie2_member" "this" {
8989# ##################################################
9090
9191resource "aws_macie2_organization_configuration" "this" {
92+ count = anytrue ([
93+ for account in var . member_accounts :
94+ account . type == " ORGANIZATION"
95+ ]) ? 1 : 0
96+
9297 region = aws_macie2_account. this . region
9398
9499 auto_enable = var. organization_config . auto_enable
Original file line number Diff line number Diff line change @@ -65,9 +65,12 @@ output "organization_config" {
6565 description = << EOF
6666 The organization configuration for the macie account.
6767 EOF
68- value = {
69- auto_enable = aws_macie2_organization_configuration.this.auto_enable
70- }
68+ value = (length (aws_macie2_organization_configuration. this ) > 0
69+ ? {
70+ auto_enable = aws_macie2_organization_configuration.this[0 ].auto_enable
71+ }
72+ : null
73+ )
7174}
7275
7376output "discovery_result_repository" {
You can’t perform that action at this time.
0 commit comments