File tree Expand file tree Collapse file tree
infrastructure/modules/sqs Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,35 +20,5 @@ data "aws_iam_policy_document" "sqs_queue" {
2020 }
2121 }
2222
23- dynamic "statement" {
24- for_each = var. sns_source_arn != null ? [1 ] : []
25-
26- content {
27- effect = " Allow"
28-
29- principals {
30- type = " Service"
31- identifiers = [
32- " sns.amazonaws.com"
33- ]
34- }
35-
36- actions = [
37- " sqs:SendMessage" ,
38- " sqs:SendMessageBatch" ,
39- ]
40-
41- condition {
42- test = " ArnEquals"
43- variable = " aws:SourceArn"
44- values = [
45- var . sns_source_arn
46- ]
47- }
48-
49- resources = [
50- aws_sqs_queue . sqs_queue . arn ,
51- ]
52- }
53- }
23+ override_policy_documents = [var . sqs_policy_overload ]
5424}
Original file line number Diff line number Diff line change @@ -2,3 +2,4 @@ resource "aws_sqs_queue_policy" "sqs_queue_policy" {
22 queue_url = aws_sqs_queue. sqs_queue . id
33 policy = data. aws_iam_policy_document . sqs_queue . json
44}
5+
Original file line number Diff line number Diff line change @@ -57,10 +57,10 @@ variable "sqs_kms_key_arn" {
5757 description = " ARN of the KMS key to encrypt SQS queue messages"
5858}
5959
60- variable "sns_source_arn " {
60+ variable "sqs_policy_overload " {
6161 type = string
62- description = " ARN of an sns resource allowed to send to this resource "
63- default = null
62+ description = " Optional additional policy to extend the SQS Resource Policy "
63+ default = " "
6464}
6565
6666variable "allowed_arns" {
You can’t perform that action at this time.
0 commit comments