Skip to content

Commit 34fb908

Browse files
author
“Subramanian
committed
Ignore policy creation when integration is disabled
1 parent 22023f8 commit 34fb908

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

data.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,8 @@ data "aws_iam_policy_document" "aqua_cspm_custom_trust" {
357357
}
358358

359359
data "aws_iam_policy_document" "aquahub_sechub_trust" {
360+
count = local.enable_security_hub_integration ? 1 : 0
361+
360362
statement {
361363
effect = "Allow"
362364

iam.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ resource "aws_iam_role" "aqua_cspm_sechub" {
7474
path = "/"
7575
max_session_duration = "3600"
7676

77-
assume_role_policy = data.aws_iam_policy_document.aquahub_sechub_trust.json
77+
assume_role_policy = data.aws_iam_policy_document.aquahub_sechub_trust[0].json
7878
}
7979

8080
resource "aws_iam_role_policy_attachment" "aqua_cspm_sechub" {

0 commit comments

Comments
 (0)