Skip to content

Commit 1ce0dc7

Browse files
[PRMP-892] add staging bucket put permission to edge lambda
1 parent 577dc31 commit 1ce0dc7

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

infrastructure/lambda-edge-presign.tf

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,32 @@ module "edge-presign-lambda" {
7474
"arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole",
7575
aws_iam_policy.ssm_access_policy.arn,
7676
module.ndr-app-config.app_config_policy_arn,
77+
aws_iam_policy.staging_bucket_put.arn
7778
]
7879
providers = {
7980
aws = aws.us_east_1
8081
}
8182
bucket_names = [module.ndr-lloyd-george-store.bucket_id, module.ndr-document-pending-review-store.bucket_id, module.ndr-bulk-staging-store.bucket_id]
8283
table_name = module.cloudfront_edge_dynamodb_table.table_name
83-
}
84+
}
85+
86+
87+
88+
resource "aws_iam_policy" "staging_bucket_put" {
89+
name = "${terraform.workspace}_staging_bucket_put"
90+
policy = jsonencode({
91+
Version = "2012-10-17",
92+
Statement = [
93+
{
94+
Effect = "Allow",
95+
Action = [
96+
"s3:PutObject"
97+
],
98+
Resource = [
99+
module.ndr-bulk-staging-store.bucket_arn,
100+
"${module.ndr-bulk-staging-store.bucket_arn}/*",
101+
]
102+
}
103+
]
104+
})
105+
}

0 commit comments

Comments
 (0)