Terraform: Support AWS APIGateway

Created on 28 Oct 2015  ยท  23Comments  ยท  Source: hashicorp/terraform

I would like to be able to use terraform to configure the AWS APIGateway.

It seems to be supported via aws-sdk-go now: https://github.com/aws/aws-sdk-go/issues/338

enhancement provideaws

Most helpful comment

Now that the API/CLI/SDKs support importing a rest API via swagger format, it would be pretty great to support that here as well. I'd rather not have to write a swagger-terraform translation step.

All 23 comments

Roger this. +1

+1

+1

+1. Pretty critical for a gateway + lambda setup on some services.

+1

+1

+1, this would be amazing. Thanks for all your hard work guys

:+1:

Another :+1:, if it helps!

Hi all :wave: ,
just FYI, support for most of the API Gateway resources have been merged as part of https://github.com/hashicorp/terraform/pull/4295 and will be part of the next release.

However I'm keeping this open as there's a few more resources left to be implemented for API Gateway:

- aws_api_gateway_authorizer

  • aws_api_gateway_base_path_mapping
  • aws_api_gateway_domain_name
  • aws_api_gateway_stage

and also caching support which was left out in the initial PR.

As of now, it looks like stage _is_ supported, right? that's what aws_api_gateway_deployment does?
Agreed that the base_path_mapping and domain_name would be really sweet to include.

The lack of custom authorizer support is really crushing, though. As far as I know, this means that I can't use terraform to update a stack where I implement them, because there's not even a way to specify authorizer_id in aws_api_gateway_method, the way there is in Amazon's API.

http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html

Now that the API/CLI/SDKs support importing a rest API via swagger format, it would be pretty great to support that here as well. I'd rather not have to write a swagger-terraform translation step.

Having spent a bit of time looking at the new import API, it seems like it would be non-trivial to support API importing. I looked to the aws_s3_bucket_object resource for inspiration, but the gateway API requires a stage for you to export the API json, and there don't appear to be any attributes (analogous to the etag on an s3 object) on the API resource that would serve as a test for the need to update.

Are there any other useful resource examples we could draw inspiration from? It doesn't seem reasonable to always update, especially with such a big resource.

+1 on @dustyburwell's request for importing via Swagger. Since that is already available in AWS, it would be very nice to see that here, too. Importing Swagger files seems simple to do via the AWS API, but I am not familiar with the Terraform code base to contribute a patch.

+1 for importing Swagger into API Gateway

+1 for importing Swagger into API Gateway for sure!

+1 for importing Swagger into API Gateway

+1 from me for importing swagger files as well. And now it seems cloudformation supports it :(

+1 I'll add to the chorus. Swagger into API Gateway would be very useful.

FYI I've created a separated issue for importing Swagger into API Gateway #11034

Hi all! Thanks for all the great discussion here around API Gateway features.

We (the Terraform team) are doing a bit of pruning of old issues that don't have a clear scope or short-term action plan. We'd love to support more features of API Gateway in addition to what was already added but we specifically don't currently have plans to implement these.

Since the scope of this issue is rather vague it's unclear that it could ever truly be "done" and so I'm going to close it. However, we'd be happy to review any PRs for specific enhancements to Terraform's API Gateway support.

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