-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aws_apigatewayv2_route is missing support for request parameters #18387
Comments
Given the structure of the underlying AWS API, I suggest a slightly more complex configuration syntax: resource "aws_apigatewayv2_route" "connect" {
api_id = aws_apigatewayv2_api.example.id
route_key = "$connect"
route_response_selection_expression = "$default"
request_parameter {
request_parameter_key = "route.request.header.authorization"
required = true
}
target = "integrations/${aws_apigatewayv2_integration.connect.id}"
} |
Looks perfectly fine to me. My suggestion was based on this one https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/api_gateway_method#request_parameters but to be honest I wouldn't be able to say if it fits or not - was mainly for consistency sake. |
The underlying problem is that the current Plugin SDK does not support maps with values anything other than simple types: AWS has the map value for a request parameter as a |
This has been released in version 3.35.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Description
aws_apigatewayv2_route is missing the ability to configure request parameters as can be seen in this example: https://docs.aws.amazon.com/apigateway/latest/developerguide/websocket-api-data-mapping.html#websocket-data-mapping-examples
This makes forwarding headers (like Authorization) to an HTTP_PROXY integration fail with following error:
Error: error updating API Gateway v2 integration: BadRequestException: Error while validating the connection between the integration <integration_id> and the route <route_id>: Invalid mapping expression parameter specified: route.request.header.authorization
The only way to get this to work is by temporarily apply the configuration without the header forwarding request parameters, manually add the request parameters to the route using something like
aws apigatewayv2 update-route --route-id <route-id>--api-id <api-id> --request-parameters '{"route.request.header.authorization": {"Required": false}}'
and then re-apply the configuration with the header forwarding in place.New or Affected Resource(s)
Potential Terraform Configuration
References
The text was updated successfully, but these errors were encountered: