Skip to content

Commit

Permalink
PRMT-4391 (#51)
Browse files Browse the repository at this point in the history
* [PRMT-4391] - Added Terraform for ehr-hard-deletion-lambda

* [PRMT-4391] - Addressed PR Comments regarding renaming resources

* [PRMT-4391] - Fix Terraform errors

* [PRMT-4391] - Given permission to listBucket

* [PRMT-4391] - Increased lambda timeout to 5 minutes

* [PRMT-4391] - Missing comma.

* [PRMT-4391] - Terraform format

* [PRMT-4391] - Modified lambda_handler location
  • Loading branch information
MohammadIqbalAD-NHS authored Mar 15, 2024
1 parent 68783ae commit f11e9f1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions terraform/ehr_deletion_lambda.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ resource "aws_lambda_function" "ehr_hard_deletion" {
filename = var.ehr_hard_deletion_lambda_zip
function_name = "${var.environment}-ehr-hard-deletion-lambda"
role = aws_iam_role.ehr_hard_deletion_lambda.arn
handler = "main.lambda_handler"
handler = "EhrHardDeletion.lambda_handler"
source_code_hash = filebase64sha256(var.ehr_hard_deletion_lambda_zip)
runtime = "python3.12"
timeout = 15
timeout = 300
tags = {
Environment = var.environment
CreatedBy = var.repo_name
Expand Down Expand Up @@ -80,6 +80,11 @@ resource "aws_iam_policy" "lambda_s3_repo_object_deletion" {
"${data.aws_s3_bucket.ehr_repo_bucket.arn}/*",
],
},
{
"Effect" : "Allow",
"Action" : "s3:ListBucket",
"Resource" : data.aws_s3_bucket.ehr_repo_bucket.arn
},
],
})
}
Expand Down

0 comments on commit f11e9f1

Please sign in to comment.