Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amazon API Gateway HTTP APIs #11148

Closed
ewbankkit opened this issue Dec 5, 2019 · 25 comments
Closed

Amazon API Gateway HTTP APIs #11148

ewbankkit opened this issue Dec 5, 2019 · 25 comments
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service.

Comments

@ewbankkit
Copy link
Contributor

ewbankkit commented Dec 5, 2019

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Amazon API Gateway offers faster, cheaper, simpler APIs using HTTP APIs.

The API Gateway HTTP API is in preview.

New or Affected Resource(s)

Potential Terraform Configuration

resource "aws_api_gateway_v2_api" "example" {
  protocol_type = "HTTP"
}

References

Announcement.
Blog post.
Developer guide.

Requires AWS SDK v1.25.48:

Related:

@ewbankkit ewbankkit added the enhancement Requests to existing resources that expand the functionality or scope. label Dec 5, 2019
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Dec 5, 2019
@rpstreef
Copy link

rpstreef commented Dec 5, 2019

This is an apigatewayv2 resource just like the websockets API

@ewbankkit ewbankkit changed the title Amazon API Gateway HTTP APIs Amazon API Gateway HTTP APIs (preview) Dec 5, 2019
@ghost ghost added the service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service. label Dec 5, 2019
@bflad bflad removed the needs-triage Waiting for first response or review from a maintainer. label Dec 5, 2019
@bionicles
Copy link

bionicles commented Dec 10, 2019

here is the line of code which designates the api type:
https://github.com/aws/aws-sdk-go/blob/2dfbfbc3d3a60ab6ef72537b890eff246f6cb1f2/models/apis/apigatewayv2/2018-11-29/api-2.json#L4575

seems like a big job to build this, but users (self included) would appreciate websockets and cheaper/faster/simpler api

I am interested to contribute but not sure where to start ... how do you decide what counts as a data source, resource, etc?

@ewbankkit
Copy link
Contributor Author

ewbankkit commented Mar 12, 2020

HTTP APIs are now GA.

Announcement.
Blog post.

Requires AWS SDK v1.29.23:

@ewbankkit ewbankkit changed the title Amazon API Gateway HTTP APIs (preview) Amazon API Gateway HTTP APIs Mar 12, 2020
@AlienHoboken
Copy link

AlienHoboken commented Mar 12, 2020

@ewbankkit looking at this it seems that your other PRs with the constituent resources to build on top of the gateway are still pending. Is there any help that you need on those? I haven't contributed here yet but definitely willing to.

Thanks for the great PR and getting this out there day 1 of GA. Many people are looking forward to leveraging HTTP APIs and your work helps make this possible 🎉

@ewbankkit
Copy link
Contributor Author

ewbankkit commented Mar 14, 2020

Preview functionality:

GA functionality:

@vincenting
Copy link
Contributor

Hi, any idea on providing a body attribute for the aws_api_gateway_v2_api resource. It has similar behaviour to the body attribute in resource_aws_api_gateway_rest_api.go, but here we have to call different API to create (ImportApi) and update(ReImportApi) the API.

Is there any plan for that, it will help the developers like me who want to migrate the RestAPIGateway based infra to the new version. (I haven't developed GoLang for a long while, I will try to create an MR for that too)

@ewbankkit
Copy link
Contributor Author

@vincenting My initial thinking around this was to recommend using the instructions in the developer guide to import the API using the AWS CLI and then use terraform import to adopt the API into Terraform. Either way I think you would have to write the HCL code for the resource.

@AleksandarTokarev
Copy link

AleksandarTokarev commented Mar 31, 2020

Sorry for the comment, but i am trying to understanding some things,
I want to use Terraform to create resources for HTTP API Gateway (which got in GA recently).
Is that supported in terraform yet? If so what version of terraform i need for that?
I am using 0.11.2 atm
Thanks a lot

@ewbankkit
Copy link
Contributor Author

@AleksandarTokarev The ability to manage the base HTTP API resource was released in v2.53.0.
See this comment on support for the additional relevant resources.

@tomaszdudek7
Copy link

@AleksandarTokarev There are no required resources from this comment in Terraform yet. AWS is working on it, but WebSockets are higher on the priority list(as they said in the comment linked in above comment). I wouldn't expect HTTP API to be available in the next few months.

@podrezo
Copy link

podrezo commented Apr 21, 2020

Hi there, I'm currently having an issue with the aws_apigatewayv2_stage resource type, used for an HTTP API, where on initial create it succeeds but when trying to make any kind of change to any resource (not necessarily even this resource) it tries to update the logging_level property to "OFF" (which is the default) but it doesn't succeed because of error "Execution logs are not supported on protocolType HTTP". Should I open an issue for this problem or will this be fixed as part of this PR? Is there any workaround for this? Thanks!

@LaurenceGA
Copy link

@podrezo
See this issue: #12893
There is a PR open too.

@podrezo
Copy link

podrezo commented Apr 21, 2020

@LaurenceGA amazing - thanks so much!

@ewbankkit
Copy link
Contributor Author

@podrezo @LaurenceGA Please upvote the linked issue if you haven't already.

@luneo7
Copy link

luneo7 commented Apr 24, 2020

I am also having issues with aws_apigatewayv2_integration, when creating it is ok, but when updating it is always trying to set passthrough_behavior = WHEN_NO_MATCH when doing integration with VPC_LINK

@luneo7
Copy link

luneo7 commented Apr 24, 2020

To bypass the aws_apigatewayv2_stage error I had to add:

lifecycle {
    ignore_changes = [deployment_id, default_route_settings]
  }

And to also stop receiving changes to passthrough_behavior in aws_apigatewayv2_integration had to add:

lifecycle {
    ignore_changes = [passthrough_behavior]
  }

@shouze
Copy link

shouze commented Apr 24, 2020

@luneo7 same thing for us with the passthrough_behavior on each update.

@acburdine
Copy link
Contributor

Created #13062 to address the passthrough_behavior issue 😄

@warrenstephens
Copy link

I have to use an ignore_changes block on my aws_apigatewayv2_stage resource with AWS provider 2.70.0 -- this has no other fix currently?

lifecycle { ignore_changes = [deployment_id] }

@ewbankkit
Copy link
Contributor Author

@warrenstephens The issue with perpetual diffs on deployment_id has been raised in #13633 and fixed in #13644 - scheduled to be released in v3.0.0 of the provider.

@warrenstephens
Copy link

@ewbankkit Thank you. I have my first stabilized aws_apigatewayv2_api with WEBSOCKET protocol -- after a few days of ramping up on AWS gateway.

I was happy to learn that I can get JSON responses from both my $default route and named route despite the AWS docs that seemed to hint otherwise.

@warrenstephens
Copy link

@ewbankkit I have been fighting for a week since my post above to get my aws_apigatewayv2_api with WEBSOCKET protocol working with Cognito (OAuth "client_credentials") having no luck, only 403 errors -- is there some sample code having that integration available somewhere? I am willing to clean gutters, chop firewood, etc, to get it working!

@warrenstephens
Copy link

I found the fix. The "Action" part of the policy that is returned by the authorizer lambda must be an array of string, not a single string. Like this:

"Action": [ "execute-api:Invoke" ],

@ewbankkit
Copy link
Contributor Author

With the merge of #12567, scheduled for release with v3.3.0 of the Terraform AWS Provider, I am going to close this original API Gateway HTTP APIs issue.
Please open new issues for any feature requests or bug reports.

@ghost
Copy link

ghost commented Sep 17, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Sep 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service.
Projects
None yet
Development

No branches or pull requests