I want to create a endpoint like user/<user_id>/info through aws_api_gateway using terraform
I am able to create endpoint till /user/<user_id>
But how to include <user_id> in the resource for "info"
Here is the code for "info" part:
resource "aws_api_gateway_resource" "info" {
rest_api_id = aws_api_gateway_rest_api.app.id
parent_id = aws_api_gateway_resource.user.id
path_part = "info"
}
resource "aws_api_gateway_method" "info" {
rest_api_id = aws_api_gateway_rest_api.app.id
resource_id = aws_api_gateway_resource.info.id
http_method = "GET"
authorization = "NONE"
}
resource "aws_api_gateway_integration" "info" {
rest_api_id = aws_api_gateway_rest_api.app.id
resource_id = aws_api_gateway_resource.info.id
http_method = aws_api_gateway_method.info.http_method
type = "HTTP_PROXY"
uri = "http://root_api/user/<user_id>/info"
When I try this, the url for info resolves to http://root_api/user/<user_id>/info. Any help on how to inject <user_id> in this url ??
Thanks