File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -27,12 +27,13 @@ resource "aws_api_gateway_integration" "integration" {
27
27
}
28
28
29
29
resource "aws_lambda_permission" "apigw_lambda" {
30
- statement_id = " AllowLambdaExecutionForAPIGateway-${ var . api_name } "
30
+ count = length (var. http_methods )
31
+ statement_id = " AllowLambdaExecutionForAPIGateway-${ var . api_name } -${ var . http_methods [count . index ]} "
31
32
action = " lambda:InvokeFunction"
32
33
function_name = aws_lambda_function. lambda . function_name
33
34
principal = " apigateway.amazonaws.com"
34
35
35
- source_arn = " arn:aws:execute-api:${ var . region } :${ local . account_id } :${ aws_api_gateway_rest_api . api . id } /*/* "
36
+ source_arn = " arn:aws:execute-api:${ var . region } :${ local . account_id } :${ aws_api_gateway_rest_api . api . id } /*/${ aws_api_gateway_method . method [ count . index ] . http_method } ${ aws_api_gateway_resource . resource . path } "
36
37
}
37
38
38
39
resource "aws_api_gateway_deployment" "deployment" {
You can’t perform that action at this time.
0 commit comments