In AWS API Gateway, I have a endpoint defined as /users/{userId}/someAction
, and I'm trying to recreate this with terraform
I would start having some sort of linked gateway_resource chain like so...
resource "aws_api_gateway_resource" "Users" {
rest_api_id = "${var.rest_api_id}"
parent_id = "${var.parent_id}"
path_part = "users"
}
//{userId} here?
resource "aws_api_gateway_resource" "SomeAction" {
rest_api_id = "${var.rest_api_id}"
parent_id = "${aws_api_gateway_resource.UserIdReference.id}"
path_part = "someAction"
}
In which I then define the aws_api_gateway_method
and everything else.
How do I define this endpoint in terraform? The terraform documentation and examples don't cover this use case.