@@ -38,11 +38,12 @@ resource "aws_apigatewayv2_route" "http" {
38
38
}
39
39
40
40
resource "aws_apigatewayv2_integration" "http" {
41
- for_each = local. integrations
42
- api_id = aws_apigatewayv2_api. http . id
43
- integration_type = each. value . type
44
- integration_method = each. value . integration_method
45
- integration_uri = each. value . uri
41
+ for_each = local. integrations
42
+ api_id = aws_apigatewayv2_api. http . id
43
+ payload_format_version = " 2.0"
44
+ integration_type = each. value . type
45
+ integration_method = each. value . integration_method
46
+ integration_uri = each. value . uri
46
47
}
47
48
48
49
resource "aws_apigatewayv2_route" "http_proxy" {
@@ -55,11 +56,12 @@ resource "aws_apigatewayv2_route" "http_proxy" {
55
56
}
56
57
57
58
resource "aws_apigatewayv2_integration" "http_proxy" {
58
- for_each = local. integrations
59
- api_id = aws_apigatewayv2_api. http . id
60
- integration_type = each. value . type
61
- integration_method = each. value . integration_method
62
- integration_uri = each. value . type == " AWS_PROXY" ? each. value . uri : " ${ each . value . uri } /{proxy}"
59
+ for_each = local. integrations
60
+ api_id = aws_apigatewayv2_api. http . id
61
+ payload_format_version = " 2.0"
62
+ integration_type = each. value . type
63
+ integration_method = each. value . integration_method
64
+ integration_uri = each. value . type == " AWS_PROXY" ? each. value . uri : " ${ each . value . uri } /{proxy}"
63
65
request_parameters = {
64
66
" overwrite:path" = " $request.path.proxy"
65
67
}
@@ -113,8 +115,8 @@ resource "aws_apigatewayv2_authorizer" "http" {
113
115
}
114
116
115
117
resource "aws_apigatewayv2_api_mapping" "http" {
116
- count = var. domain == " " ? 0 : 1
117
- api_id = aws_apigatewayv2_api. http . id
118
- domain_name = var. domain
119
- stage = aws_apigatewayv2_stage. http_default . id
118
+ count = var. domain == " " ? 0 : 1
119
+ api_id = aws_apigatewayv2_api. http . id
120
+ domain_name = var. domain
121
+ stage = aws_apigatewayv2_stage. http_default . id
120
122
}
0 commit comments