Terraform: Unable to create Proxy resource in API gateway with aws_api_gateway_resource

Created on 1 Feb 2017  ·  4Comments  ·  Source: hashicorp/terraform

aws_api_gateway_resource is missing functionality to be able to create a proxy resource as well as to enable API gateway CORS on a resource...

Terraform Version

0.8.5

Affected Resource(s)

  • aws_api_gateway_resource

Terraform Configuration Files

resource "aws_api_gateway_resource" "stage_proxy_api_resource" {
rest_api_id = "${aws_api_gateway_rest_api.MyAapp_stage_api.id}"
parent_id = "${aws_api_gateway_resource.stage_MyApp_api_resource.id}"
path_part = "{proxy+}"
}

Expected Behavior

There is no option to specify this is a proxy resource (At least in the current documentation) nor is there one to specify "Enable API Gateway CORS" either

enhancement provideaws

Most helpful comment

@djandruczyk I've successfully created a proxy resource using the path_part {proxy+} when combined with a proxy integration_http_method. Agreed there is no way to enable CORS. If you click the [Enable CORS] in the console its just running multiple actions to enable an OPTIONS method and req/resp templates. You could replicate this with your own methods.

All 4 comments

@djandruczyk I've successfully created a proxy resource using the path_part {proxy+} when combined with a proxy integration_http_method. Agreed there is no way to enable CORS. If you click the [Enable CORS] in the console its just running multiple actions to enable an OPTIONS method and req/resp templates. You could replicate this with your own methods.

Excellent, thanks!

-- David

On Feb 1, 2017, at 7:31 PM, Adam notifications@github.com wrote:

@djandruczyk I've successfully created a proxy resource using the path_part {proxy+} when combined with a proxy integration_http_method. Agreed there is no way to enable CORS. If you click the [Enable CORS] in the console its just running multiple actions to enable an OPTIONS method and req/resp templates. You could replicate this with your own methods.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

I had trouble getting to work, but this stackexchange question/answer solved it for me.

http://stackoverflow.com/questions/39040739/in-terraform-how-do-you-specify-an-api-gateway-endpoint-with-a-variable-in-the

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

phinze picture phinze  ·  86Comments

kklipsch picture kklipsch  ·  95Comments

dupuy picture dupuy  ·  61Comments

radeksimko picture radeksimko  ·  80Comments

felnne picture felnne  ·  133Comments