Terraform: aws_api_gateway_method: support ANY method

Created on 4 Oct 2016  ยท  7Comments  ยท  Source: hashicorp/terraform

Terraform Version

0.7.4

Affected Resource(s)

aws_api_gateway_method and related

Terraform Configuration Files

resource "aws_api_gateway_method" "tf-demo-api-method" {
  rest_api_id = "${aws_api_gateway_rest_api.tf-demo-api.id}"
  resource_id = "${aws_api_gateway_resource.tf-demo-api-resource.id}"
  http_method = "ANY"
  authorization = "NONE"
}

Debug Output

N/A

Expected Behavior

AWS API Gateway service accepts the ANY method specifier when constructing a method on a resource, so terraform plan should as well.

Actual Behavior

terraform plan produces the following error:

There are warnings and/or errors related to your configuration. Please
fix these before continuing.

Errors:

  * aws_api_gateway_method.tf-demo-api-method: "http_method" must be one of 'GET', 'HEAD', 'OPTIONS', 'PUT', 'POST', 'PATCH', 'DELETE'

More information

This may be a result of the Terraform's strict adherence to the AWS Go SDK, but passing ANY is permitted in the Ruby SDK and via the AWS console.

bug provideaws

All 7 comments

This checks for validhttpmethod https://github.com/hashicorp/terraform/blob/master/builtin/providers/aws/validators.go#L344-L351 i don't thin go-aws-sdk have any validation on httpmethod.

@dayglojesus and @optimisticanshul hi there! Thank you for getting in touch about this.

Indeed, the ANY method was added recently, as per:

https://aws.amazon.com/blogs/aws/api-gateway-update-new-features-simplify-api-development/

I will fix it shortly for you.

@kwilczynski happy to send PR if this will be the fix..

@optimisticanshul one is coming already #9205. Sorry about the delay.

@kwilczynski Thanks for the amazing response! Let me know if you some testing.

This was released in Terraform 0.7.5 today

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

radeksimko picture radeksimko  ยท  80Comments

ncraike picture ncraike  ยท  77Comments

mirogta picture mirogta  ยท  74Comments

nevir picture nevir  ยท  82Comments

dupuy picture dupuy  ยท  61Comments