Skip to content

Commit 015e9a2

Browse files
authored
fix: update function URL permissions (#1388)
Update the Lambda function permissions with the new actions required by AWS when function URLs are used for public access.
1 parent f1df701 commit 015e9a2

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

terragrunt/aws/api/lambda.tf

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,25 @@ resource "aws_lambda_function_url" "scan_files" {
105105
qualifier = each.key == "api-provisioned" ? aws_lambda_alias.api_provisioned_latest.name : null
106106
}
107107

108+
resource "aws_lambda_permission" "scan_files_invoke_function_url" {
109+
for_each = toset(local.scan_files_api_functions)
110+
111+
statement_id = "AllowPublicInvokeFunctionUrl-${each.key}"
112+
action = "lambda:InvokeFunctionUrl"
113+
function_name = module.scan_files[each.key].function_name
114+
function_url_auth_type = "NONE"
115+
principal = "*"
116+
}
117+
118+
resource "aws_lambda_permission" "scan_files_invoke_function" {
119+
for_each = toset(local.scan_files_api_functions)
120+
121+
statement_id = "AllowPublicInvokeFunction-${each.key}"
122+
action = "lambda:InvokeFunction"
123+
function_name = module.scan_files[each.key].function_name
124+
principal = "*"
125+
}
126+
108127
#
109128
# Setup provisioned concurency for the api-provisioned lambda
110129
# This function will be used for synchronous requests

0 commit comments

Comments
 (0)