Skip to content

Commit ab2b3dd

Browse files
committed
simplify lambda permission source arn and make flexible for multi regions
1 parent 5527d43 commit ab2b3dd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ resource "aws_lambda_permission" "apigw_lambda" {
7070
function_name = aws_lambda_function.lambda.function_name
7171
principal = "apigateway.amazonaws.com"
7272

73-
source_arn = "arn:aws:execute-api:us-west-2:${var.account-id}:${aws_api_gateway_rest_api.api.id}/*"
73+
source_arn = aws_api_gateway_rest_api.api.execution_arn
7474
}
7575

7676
resource "aws_api_gateway_domain_name" "api_domain" {

0 commit comments

Comments
 (0)