Skip to content

Commit

Permalink
fix(DMVP-5181): fix sqs policy
Browse files Browse the repository at this point in the history
  • Loading branch information
SarhadMeta committed Dec 24, 2024
1 parent c3ccea4 commit 660a6b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions event-notifications.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ data "aws_iam_policy_document" "queue" {
}

actions = ["sqs:SendMessage"]
resources = ["arn:aws:sqs:*:*:${var.name}${var.event_notification_config.name_suffix}}"]
resources = ["arn:aws:sqs:*:*:${replace("${var.name}-${var.event_notification_config.name_suffix}", "/\\W+/", "_")}"]

condition {
test = "ArnEquals"
Expand All @@ -23,7 +23,7 @@ data "aws_iam_policy_document" "queue" {
resource "aws_sqs_queue" "queue" {
count = var.event_notification_config.target_type == "sqs" ? 1 : 0

name = replace("${var.name}${var.event_notification_config.name_suffix}", "/\\W+/", "_")
name = replace("${var.name}-${var.event_notification_config.name_suffix}", "/\\W+/", "_")
policy = data.aws_iam_policy_document.queue[0].json
}

Expand Down

0 comments on commit 660a6b4

Please sign in to comment.