I am trying to create POST method using terraform at the root api gateway URL such as https://somehash.execute-api.us-east-1.amazonaws.com/dev which would include the stage. Here is part of the terraform plan of concern:
resource "aws_api_gateway_rest_api" "api" {
name = "submit-dev-gateway-api"
}
resource "aws_api_gateway_resource" "resource" {
rest_api_id = "${aws_api_gateway_rest_api.api.id}"
parent_id = "${aws_api_gateway_rest_api.api.root_resource_id}"
path_part = "submit"
}
resource "aws_api_gateway_method" "post_form" {
rest_api_id = "${aws_api_gateway_rest_api.api.id}"
resource_id = "${aws_api_gateway_resource.resource.id}"
http_method = "POST"
authorization = "NONE"
}
...
I tried changing the path_part to "/" but it did not work. I could not create a aws_api_gateway_method resource without aws_api_gateway_resource. I can create a POST at root manually without terraform which looks like this:

When I use the above terraform plan I get this:

How do I create POST at root with terraform?
path_part = "submit"from terraform script? - ChetanThe argument "path_part" is required, but no definition was found.- nealous3path_part = ""orpath_part = "\"- ChetanBadRequestException: Resource's path part must be specified."\"is same as"/". Doesn't work. - nealous3