-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
API Gateway- Websocket #7004
Comments
I'd like to contribute to this, but have never done any development on this project before. Can we explain a little further the changes that are needed?
|
I suggested that it be _v2 to stay inline with AWS naming of the new resource. Link here |
I've created a fork and made some changes to support the first new 'v2' resource. Anyone care to review and let me know things I got wrong before implementing the rest? https://github.com/mbonig/terraform-provider-aws/tree/f-gatewayv2 Thanks! |
Additional affected resources:
|
Also affected: aws_api_gateway_domain_name - may need a new resource, I'm not familiar with the underlying api. |
I'm working on this, but on the route object I've come across an issue. I want the terraform to look like this:
as this seems to be the best representation of the underlying data. However, I can't seem to find a schema definition that will work with this. Does anybody have any tips, or can point me to an existing resource that has a similar setup? API reference: |
Has there been any update on this? I'm willing to help with testing PRs. |
I have had priorities shift so I haven't been able to work on it. Would be willing to give someone my branch if they want to continue my work... |
@mbonig I'd be happy to contribute. What's the turnaround time for PR / Testing / Approval? I need this feature actually in the next couple of weeks. |
Has there been any progress on this issue? It looks like it's the second most popular issue. @mbonig could you post your work so somebody else can pick up from it? (Is this it: https://github.com/mbonig/terraform-provider-aws/tree/f-gatewayv2?) |
I have made a start on this, based on the initial work from @mbonig. I think a separate PR for each new resource is best:
|
Is there an ETA when this will be released? |
I think we need to decide on the set of resources that comprise an "MVP" and focus on those - @rpstreef, what would be the minimal set of resources for your use case(s)? Thanks. |
I wont be using; When you use proxy integration, these are not needed Everything else is MVP in my opinion |
API Gateway v2 tagging added in AWS SDK v1.20.9. |
Tags are supported on:
|
for the MVP, do we have an ETA? |
OK, I think I have the resources for @rpstreef's MVP done. Phase 1
Phase 2
Phase 3
Phase 4
Phase 5
Phase 6
I will need to add to the Example Usage sections in the relevant documentation and provide full examples in https://github.com/terraform-providers/terraform-provider-aws/tree/master/examples. Added |
@ewbankkit many thanks for pushing all this through! do you happen to have a single branch where all the feature branches regarding api_gateway_v2 are all merged in ? |
Splendid ! |
hi @ewbankkit, @maryelizbeth, the module aws_apigatewayv2_api creates 3 routes by default (they actually get created automatically by aws) but the module does not export in its outputs the RouteId key for each of those routes, and we don't have a data source to retrieve them Hence, when the module aws_apigatewayv2_route will be released, we won't be able to update the default routes with their target integrations. How would you see the next step here?
|
@ebarault When a WebSocket API is created via Terraform those 3 routes aren't created implicitly: $ terraform apply
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
+ aws_apigatewayv2_api.test
id: <computed>
api_endpoint: <computed>
api_key_selection_expression: "$request.header.x-api-key"
arn: <computed>
execution_arn: <computed>
name: "example-ws-api"
protocol_type: "WEBSOCKET"
route_selection_expression: "$request.body.action"
Plan: 1 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
aws_apigatewayv2_api.test: Creating...
api_endpoint: "" => "<computed>"
api_key_selection_expression: "" => "$request.header.x-api-key"
arn: "" => "<computed>"
execution_arn: "" => "<computed>"
name: "" => "example-ws-api"
protocol_type: "" => "WEBSOCKET"
route_selection_expression: "" => "$request.body.action"
aws_apigatewayv2_api.test: Creation complete after 1s (ID: p5axu0jzmb)
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
kit@ub18043x64-dev:~/tmp/apigatewayv2$ aws --region us-west-2 apigatewayv2 get-routes --api-id p5axu0jzmb
{
"Items": []
} but they do show up in the AWS console (albeit subtly grayed out) and no doubt there will be many users who click on those routes, which does cause their implicit creation (and also additional integrations etc.). So, yes we should add data sources for all corresponding the API Gateway v2 resources - Phase 2 😄. |
I find the name |
@ewbankkit ohhhh that's twisted! i just destroyed my apigw_v2, recreated it, and a call to As soon as i click on one of those + signs, a route gets created: |
@Ludonope the name comes from aws: |
When I create a new "aws_apigatewayv2_api" and "aws_apigatewayv2_domain_name" I'm not given any hosted zone or domain name information like I do with version 1. How am I supposed to connect this api to a route53 record and use it? There doesn't appear to be any information in the documentation about how I could do this either. |
@christhomas Thanks for raising this - Route 53 hosted zone and API Gateway domain name are available from the underlying AWS |
cross-referencing the aforementioned issue: #12892 |
I also think this issue should be cross-referenced too: #12894 |
#9461 was the final PR for new resources. I think we'll need data sources corresponding to some of the API Gateway v2 resources, but @bflad, @maryelizbeth do you want to close this issue now and open separate issues for additional work? |
Hello everyone, All of the functionality linked to this Issue has either been released, or will be released as part of v2.59.0 later this week. Namely, the resource types
which support ApiGateway v2 WebSocket APIs. Follow #11148 for the enhancements needed for HTTP APIs. For further feature requests, documentation updates, or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks! |
I have had a couple of observations the last couple of days trying to implement API Gateway V2 in Terraform.
I created a functioniong API gateway in the console pointing to an internal ALB. I went to list all of the resources in the AWS cli. Everything was there except for the VPC link. I upgraded AWS cli to verison 1.18.41 and now the apigatewayv2 subcommand has references to vpc link. |
@jacktkeys |
@ewbankkit Thanks for pointing me to those. I look forward to the next release then. |
I really really really want api_mapping right now, it's what is causing my final problem on this ticket: #12892 When is the release date? |
There is an issue with deployments that I've found, it's a bit tricky to explain, I've created a ticket to try to get what I think is happening across: #12961 |
This has been released in version 2.59.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks! |
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! |
Community Note
Description
API Gateway now supports WebSocket connections. It would be great to be able to define this resource
New or Affected Resource(s)
Potential Terraform Configuration
References
Documentation
Announcement
The text was updated successfully, but these errors were encountered: