File tree Expand file tree Collapse file tree 2 files changed +43
-1
lines changed
Expand file tree Collapse file tree 2 files changed +43
-1
lines changed Original file line number Diff line number Diff line change 11resource "aws_sns_topic" "batch_processor_errors" {
2- name = " ${ var . environment } -batch-processor-errors"
2+ name = " ${ var . environment } -batch-processor-errors"
3+ kms_master_key_id = aws_kms_key. batch_processor_errors_sns_encryption_key . arn
34}
45
56resource "aws_sns_topic_policy" "batch_processor_errors_topic_policy" {
Original file line number Diff line number Diff line change @@ -179,3 +179,44 @@ resource "aws_kms_alias" "id_sync_sqs_encryption" {
179179 target_key_id = aws_kms_key. id_sync_sqs_encryption . key_id
180180}
181181
182+ resource "aws_kms_key" "batch_processor_errors_sns_encryption_key" {
183+ description = " KMS key for encrypting the batch processor errors SNS Topic messages"
184+ deletion_window_in_days = 7
185+ enable_key_rotation = true
186+
187+ policy = jsonencode ({
188+ Version = " 2012-10-17"
189+ Statement = [
190+ local.policy_statement_allow_administration,
191+ {
192+ Effect = " Allow"
193+ Principal = {
194+ Service = " sns.amazonaws.com"
195+ }
196+ Action = [" kms:GenerateDataKey*" , " kms:Decrypt" ]
197+ Resource = " *"
198+ },
199+ {
200+ Effect = " Allow" ,
201+ Principal = {
202+ " Service" : " cloudwatch.amazonaws.com"
203+ },
204+ Action = [" kms:GenerateDataKey*" , " kms:Decrypt" ],
205+ Resource = " *"
206+ },
207+ {
208+ Effect = " Allow" ,
209+ Principal = {
210+ " Service" : " chatbot.amazonaws.com"
211+ },
212+ Action = [" kms:GenerateDataKey*" , " kms:Decrypt" ],
213+ Resource = " *"
214+ }
215+ ]
216+ })
217+ }
218+
219+ resource "aws_kms_alias" "batch_processor_errors_sns_encryption_key" {
220+ name = " alias/${ var . environment } -batch-processor-errors-imms-sns-encryption"
221+ target_key_id = aws_kms_key. batch_processor_errors_sns_encryption_key . key_id
222+ }
You can’t perform that action at this time.
0 commit comments