diff --git a/terraform/api-gateway/api-gateway.tf b/terraform/api-gateway/api-gateway.tf index 1bbd438..21daa19 100644 --- a/terraform/api-gateway/api-gateway.tf +++ b/terraform/api-gateway/api-gateway.tf @@ -22,7 +22,7 @@ resource "aws_apigatewayv2_integration" "geo" { resource "aws_apigatewayv2_route" "geo" { api_id = aws_apigatewayv2_api.geo.id - route_key = "GET /geographic-detail" + route_key = "GET /geographic-details" target = "integrations/${aws_apigatewayv2_integration.geo.id}" } \ No newline at end of file diff --git a/terraform/api-gateway/api-lambda.tf b/terraform/api-gateway/api-lambda.tf index f38ff16..8eb9fec 100644 --- a/terraform/api-gateway/api-lambda.tf +++ b/terraform/api-gateway/api-lambda.tf @@ -87,12 +87,12 @@ resource "aws_iam_role_policy_attachment" "api" { } resource "aws_lambda_permission" "api_permission" { - statement_id = "AllowMyDemoAPIInvoke" + statement_id = "AllowMy${terraform.workspace}APIInvoke" action = "lambda:InvokeFunction" function_name = aws_lambda_function.api.function_name principal = "apigateway.amazonaws.com" # The /* part allows invocation from any stage, method and resource path # within API Gateway. - source_arn = "${aws_apigatewayv2_api.geo.execution_arn}/${terraform.workspace}/GET/geographic-detail" + source_arn = "${aws_apigatewayv2_api.geo.execution_arn}/${terraform.workspace}/GET/geographic-details" } \ No newline at end of file