@@ -10,7 +10,7 @@ resource "aws_apigatewayv2_authorizer" "lambda_authorizer_client" {
1010 authorizer_type = " REQUEST"
1111 authorizer_uri = aws_lambda_function. authorizer_client . invoke_arn
1212 identity_sources = [" $request.header.Authorization" ]
13- name = " SOAT-TC_Lambda_Authorizer_Client "
13+ name = " SOAT-TC_API_Gateway_Authorizer__Lambda_Authorizer_Client "
1414
1515 authorizer_payload_format_version = " 2.0"
1616 enable_simple_responses = true
@@ -30,20 +30,20 @@ resource "aws_apigatewayv2_integration" "lambda_identification_nationalid" {
3030}
3131
3232// ----- Routes -----
33+ // Routes should be declared on terraform-network whenever possible. The routes below
34+ // depend on terraform-computing resources, they are declared here to avoid cyclic dependencies.
3335
3436resource "aws_apigatewayv2_route" "client_identification" {
3537 api_id = local. api_id
3638 route_key = " POST /identification/clients/identification"
3739
38- // Identification Lambda integration
3940 target = " integrations/${ aws_apigatewayv2_integration . lambda_identification_nationalid . id } "
4041}
4142
4243resource "aws_apigatewayv2_route" "order_checkout_and_listing" {
4344 api_id = local. api_id
4445 route_key = " ANY /order/orders" // due to Servlet Filter urlPatterns not supporting specific HTTP methods
4546
46- // Client Lambda Authorizer authorization
4747 authorizer_id = aws_apigatewayv2_authorizer. lambda_authorizer_client . id
4848 authorization_type = " CUSTOM"
4949 target = " integrations/${ local . proxy_to_alb_id } "
@@ -53,7 +53,8 @@ resource "aws_apigatewayv2_route" "order_confirmation" {
5353 api_id = local. api_id
5454 route_key = " POST /payment/payments/initialize"
5555
56- // Client Lambda Authorizer authorization
57- target = " integrations/${ local . proxy_to_alb_id } "
56+ authorizer_id = aws_apigatewayv2_authorizer. lambda_authorizer_client . id
57+ authorization_type = " CUSTOM"
58+ target = " integrations/${ local . proxy_to_alb_id } "
5859
5960}
0 commit comments