Skip to content

Commit 667086a

Browse files
CCM-10283: Remove KMS on receipt rule
1 parent d8229a9 commit 667086a

File tree

2 files changed

+23
-8
lines changed

2 files changed

+23
-8
lines changed

infrastructure/terraform/components/acct/module_sandbox_kms.tf

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ data "aws_iam_policy_document" "kms" {
5656
}
5757

5858
statement {
59-
sid = "AllowSES"
59+
sid = "AllowS3"
6060
effect = "Allow"
6161

6262
principals {
6363
type = "Service"
6464

6565
identifiers = [
66-
"ses.amazonaws.com",
66+
"s3.amazonaws.com",
6767
]
6868
}
6969

@@ -78,15 +78,31 @@ data "aws_iam_policy_document" "kms" {
7878
resources = [
7979
"*",
8080
]
81+
}
8182

82-
condition {
83-
test = "ArnLike"
84-
variable = "aws:SourceArn"
83+
statement {
84+
sid = "AllowSES"
85+
effect = "Allow"
8586

86-
values = [
87-
"arn:aws:ses:${var.region}:${var.aws_account_id}:receipt-rule-set:*",
87+
principals {
88+
type = "Service"
89+
90+
identifiers = [
91+
"ses.amazonaws.com",
8892
]
8993
}
94+
95+
actions = [
96+
"kms:Encrypt*",
97+
"kms:Decrypt*",
98+
"kms:ReEncrypt*",
99+
"kms:GenerateDataKey*",
100+
"kms:Describe*"
101+
]
102+
103+
resources = [
104+
"*",
105+
]
90106
}
91107

92108
statement {

infrastructure/terraform/modules/ses/ses_receipt_rule_set.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ resource "aws_ses_receipt_rule" "store_email" {
1818
position = 1
1919
bucket_name = module.s3bucket_ses.0.id
2020
object_key_prefix = "emails/"
21-
kms_key_arn = var.kms_key_arn
2221
iam_role_arn = aws_iam_role.ses_receipts.0.arn
2322
}
2423
}

0 commit comments

Comments
 (0)