Skip to content

Commit

Permalink
Chore/partitions and condition overrides (#44)
Browse files Browse the repository at this point in the history
* adding partition and condition of module is disabled

* adding partition and changing the condition if the module is disabled
  • Loading branch information
tsaucier-sf authored Mar 7, 2024
1 parent 9644d94 commit 02d0954
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion eventbridge.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ data "aws_iam_policy_document" "sns_kms_key_policy" {

principals {
type = "AWS"
identifiers = ["arn:aws:iam::${one(data.aws_caller_identity.this[*].account_id)}:root"]
identifiers = ["arn:${one(data.aws_partition.this[*].partition)}:iam::${one(data.aws_caller_identity.this[*].account_id)}:root"]
}
}

Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ locals {
imported_findings_notification_arn = local.enable_notifications ? (var.imported_findings_notification_arn != null ? var.imported_findings_notification_arn : module.sns_topic[0].sns_topic.arn) : null
enabled_standards_arns = toset([
for standard in var.enabled_standards :
format("arn:%s:securityhub:%s::%s", one(data.aws_partition.this[*].partition), length(regexall("ruleset", standard)) == 0 ? one(data.aws_region.this[*].name) : "", standard)
format("arn:%s:securityhub:%s::%s", one(data.aws_partition.this[*].partition), length(regexall("ruleset", standard)) == 0 ? one(data.aws_region.this[*].name) : "", standard) if local.enabled
])
}

Expand Down

0 comments on commit 02d0954

Please sign in to comment.