Skip to content

Commit 8185e13

Browse files
committed
eli-306 adding kms grant for lambda to decrypt s3
1 parent 624931e commit 8185e13

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

infrastructure/stacks/api-layer/iam_policies.tf

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ data "aws_iam_policy_document" "kms_key_policy" {
135135
type = "AWS"
136136
identifiers = ["arn:aws:iam::${data.aws_caller_identity.current.account_id}:root"]
137137
}
138-
actions = ["kms:*"]
138+
actions = ["kms:*"]
139139
resources = [
140140
module.eligibility_status_table.dynamodb_kms_key_arn,
141141
module.s3_rules_bucket.storage_bucket_kms_key_arn,
@@ -178,7 +178,7 @@ data "aws_iam_policy_document" "kms_key_policy" {
178178
"kms:DescribeKey"
179179
]
180180
resources = [
181-
module.s3_audit_bucket.storage_bucket_kms_key_arn
181+
module.s3_audit_bucket.storage_bucket_kms_key_arn,
182182
]
183183
}
184184
}
@@ -188,3 +188,10 @@ resource "aws_kms_key_policy" "kms_key" {
188188
key_id = module.eligibility_status_table.dynamodb_kms_key_id
189189
policy = data.aws_iam_policy_document.kms_key_policy.json
190190
}
191+
192+
resource "aws_kms_grant" "lambda_s3_decrypt" {
193+
name = "lambda-s3-decrypt"
194+
key_id = module.s3_rules_bucket.storage_bucket_kms_key_arn
195+
grantee_principal = aws_iam_role.eligibility_lambda_role.arn
196+
operations = ["Decrypt"]
197+
}

0 commit comments

Comments
 (0)