Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Apr 1, 2021
1 parent 2a0f559 commit 856d6d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions ses-domain/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -258,15 +258,17 @@ resource "aws_sns_topic" "ses_event" {
}

resource "aws_sns_topic_policy" "ses_event" {
count = local.enable_sns_events ? 1 : 0
arn = coalesce(aws_sns_topic.ses_event[*].arn...)
count = local.enable_sns_events ? 1 : 0
# arn = coalesce(aws_sns_topic.ses_event[*].arn...)
arn = concat(aws_sns_topic.ses_event[*].arn, [""])[0]
policy = data.aws_iam_policy_document.ses_event.json
}

resource "aws_ses_identity_notification_topic" "ses_event" {
for_each = toset(local.ses_event_types)
# topic_arn = aws_sns_topic.ses_event[0].arn
topic_arn = coalesce(aws_sns_topic.ses_event[*].arn...)
# topic_arn = coalesce(aws_sns_topic.ses_event[*].arn...)
topic_arn = concat(aws_sns_topic.ses_event[*].arn, [""])[0]
notification_type = title(each.key)
identity = aws_ses_domain_identity.this.domain
include_original_headers = true
Expand Down
2 changes: 1 addition & 1 deletion ses-domain/policies.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ data "aws_iam_policy_document" "ses_event" {
statement {
effect = "Alow"
actions = ["sns:Publish"]
resources = [aws_sns_topic.ses_event[0].arn]
resources = [concat(aws_sns_topic.ses_event[*].arn, [""])[0]]
principals {
type = "Service"
identifiers = ["ses.amazonaws.com"]
Expand Down

0 comments on commit 856d6d9

Please sign in to comment.