Skip to content

Commit c03e28b

Browse files
committed
app kms key changes
1 parent ba50e5e commit c03e28b

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

infrastructure/terraform/components/app/module_kms.tf

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,35 @@ data "aws_iam_policy_document" "kms" {
106106
]
107107
}
108108
}
109+
110+
statement {
111+
sid = "AllowEventBridgeToEncryptSpecificQueue"
112+
effect = "Allow"
113+
114+
principals {
115+
type = "Service"
116+
identifiers = ["events.amazonaws.com"]
117+
}
118+
119+
actions = [
120+
"kms:GenerateDataKey*",
121+
"kms:Decrypt",
122+
]
123+
124+
resources = ["*"]
125+
126+
condition {
127+
test = "StringEquals"
128+
variable = "kms:ViaService"
129+
values = ["sqs.${var.region}.amazonaws.com"]
130+
}
131+
132+
condition {
133+
test = "StringEquals"
134+
variable = "kms:EncryptionContext:aws:sqs:arn"
135+
values = [
136+
module.sqs_validate_letter_template_files.sqs_queue_arn
137+
]
138+
}
139+
}
109140
}

0 commit comments

Comments
 (0)