File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -253,13 +253,39 @@ resource "aws_iam_policy" "filenameprocessor_dynamo_access_policy" {
253253 })
254254}
255255
256+ # Kms policy setup on filenameprocessor lambda for dps cross account bucket access
257+ resource "aws_iam_policy" "filenameprocessor_dps_extended_attribute_kms_policy" {
258+ name = " ${ local . short_prefix } -filenameproc-dps-kms-policy"
259+ description = " Allow Lambda to use DPS KMS key for SSE-KMS encrypted S3 bucket access"
260+
261+ policy = jsonencode ({
262+ Version = " 2012-10-17"
263+ Statement = [
264+ {
265+ Effect = " Allow" ,
266+ Action = [
267+ " kms:Decrypt" ,
268+ " kms:GenerateDataKey" ,
269+ " kms:DescribeKey"
270+ ],
271+ Resource = " arn:aws:kms:eu-west-2:${ var . dspp_account_id } :key/*"
272+ }
273+ ]
274+ })
275+ }
256276
257277# Attach the execution policy to the Lambda role
258278resource "aws_iam_role_policy_attachment" "filenameprocessor_lambda_exec_policy_attachment" {
259279 role = aws_iam_role. filenameprocessor_lambda_exec_role . name
260280 policy_arn = aws_iam_policy. filenameprocessor_lambda_exec_policy . arn
261281}
262282
283+ # Attach the dps kms policy to the Lambda role
284+ resource "aws_iam_role_policy_attachment" "filenameprocessor_lambda_dps_kms_ea_policy_attachment" {
285+ role = aws_iam_role. filenameprocessor_lambda_exec_role . name
286+ policy_arn = aws_iam_policy. filenameprocessor_dps_extended_attribute_kms_policy
287+ }
288+
263289# Attach the SQS policy to the Lambda role
264290resource "aws_iam_role_policy_attachment" "filenameprocessor_lambda_sqs_policy_attachment" {
265291 role = aws_iam_role. filenameprocessor_lambda_exec_role . name
You can’t perform that action at this time.
0 commit comments