You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
create_api_gateway = false # to control creation of API Gateway
72
-
create_api_domain_name = false # to control creation of API Gateway Domain Name
73
-
create_default_stage = false # to control creation of "$default" stage
74
-
create_default_stage_api_mapping = false # to control creation of "$default" stage and API mapping
75
-
create_routes_and_integrations = false # to control creation of routes and integrations
76
-
create_vpc_link = false # to control creation of VPC link
67
+
create_api_gateway = false # to control creation of API Gateway
68
+
create_api_domain_name = false # to control creation of API Gateway Domain Name
69
+
create_stage = false # to control creation of "$default" stage
70
+
create_stage_api_mapping = false # to control creation of "$default" stage and API mapping
71
+
create_routes_and_integrations = false # to control creation of routes and integrations
72
+
create_vpc_link = false # to control creation of VPC link
77
73
78
74
# ... omitted
79
75
}
@@ -87,6 +83,7 @@ module "api_gateway" {
87
83
88
84
-[Complete HTTP](https://github.com/terraform-aws-modules/terraform-aws-apigateway-v2/tree/master/examples/complete-http) - Create API Gateway, authorizer, domain name, stage and other resources in various combinations
89
85
-[HTTP with VPC Link](https://github.com/terraform-aws-modules/terraform-aws-apigateway-v2/tree/master/examples/vpc-link-http) - Create API Gateway with VPC link and integration with resources in VPC (eg. ALB)
86
+
-[Websocket](https://github.com/terraform-aws-modules/terraform-aws-apigateway-v2/tree/master/examples/websocket) - Create Websocket API
90
87
91
88
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
92
89
## Requirements
@@ -173,13 +170,13 @@ No modules.
173
170
| <aname="output_apigatewayv2_domain_name_id"></a> [apigatewayv2\_domain\_name\_id](#output\_apigatewayv2\_domain\_name\_id)| The domain name identifier |
174
171
| <aname="output_apigatewayv2_domain_name_target_domain_name"></a> [apigatewayv2\_domain\_name\_target\_domain\_name](#output\_apigatewayv2\_domain\_name\_target\_domain\_name)| The target domain name |
175
172
| <aname="output_apigatewayv2_route"></a> [apigatewayv2\_route](#output\_apigatewayv2\_route)| Map containing the routes created and their attributes |
173
+
| <aname="output_apigatewayv2_stage_arn"></a> [apigatewayv2\_stage\_arn](#output\_apigatewayv2\_stage\_arn)| The stage ARN |
174
+
| <aname="output_apigatewayv2_stage_domain_name"></a> [apigatewayv2\_stage\_domain\_name](#output\_apigatewayv2\_stage\_domain\_name)| Domain name of the stage (useful for CloudFront distribution) |
175
+
| <aname="output_apigatewayv2_stage_execution_arn"></a> [apigatewayv2\_stage\_execution\_arn](#output\_apigatewayv2\_stage\_execution\_arn)| The ARN prefix to be used in an aws\_lambda\_permission's source\_arn attribute or in an aws\_iam\_policy to authorize access to the @connections API. |
176
+
| <aname="output_apigatewayv2_stage_id"></a> [apigatewayv2\_stage\_id](#output\_apigatewayv2\_stage\_id)| The stage identifier |
177
+
| <aname="output_apigatewayv2_stage_invoke_url"></a> [apigatewayv2\_stage\_invoke\_url](#output\_apigatewayv2\_stage\_invoke\_url)| The URL to invoke the API pointing to the stage |
176
178
| <aname="output_apigatewayv2_vpc_link_arn"></a> [apigatewayv2\_vpc\_link\_arn](#output\_apigatewayv2\_vpc\_link\_arn)| The map of VPC Link ARNs |
177
179
| <aname="output_apigatewayv2_vpc_link_id"></a> [apigatewayv2\_vpc\_link\_id](#output\_apigatewayv2\_vpc\_link\_id)| The map of VPC Link identifiers |
178
-
| <aname="output_default_apigatewayv2_stage_arn"></a> [default\_apigatewayv2\_stage\_arn](#output\_default\_apigatewayv2\_stage\_arn)| The default stage ARN |
179
-
| <aname="output_default_apigatewayv2_stage_domain_name"></a> [default\_apigatewayv2\_stage\_domain\_name](#output\_default\_apigatewayv2\_stage\_domain\_name)| Domain name of the stage (useful for CloudFront distribution) |
180
-
| <aname="output_default_apigatewayv2_stage_execution_arn"></a> [default\_apigatewayv2\_stage\_execution\_arn](#output\_default\_apigatewayv2\_stage\_execution\_arn)| The ARN prefix to be used in an aws\_lambda\_permission's source\_arn attribute or in an aws\_iam\_policy to authorize access to the @connections API. |
181
-
| <aname="output_default_apigatewayv2_stage_id"></a> [default\_apigatewayv2\_stage\_id](#output\_default\_apigatewayv2\_stage\_id)| The default stage identifier |
182
-
| <aname="output_default_apigatewayv2_stage_invoke_url"></a> [default\_apigatewayv2\_stage\_invoke\_url](#output\_default\_apigatewayv2\_stage\_invoke\_url)| The URL to invoke the API pointing to the stage |
Copy file name to clipboardExpand all lines: examples/websocket/README.md
+47-4Lines changed: 47 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
-
# Websocket AWS API Gateway examples
2
-
3
-
Configuration in this directory creates AWS API Gateway with Domain Name, ACM Certificate, and integrates it with Lambda and Step Function and shows the variety of supported features.
1
+
# AWS Websocket API example
4
2
3
+
Configuration in this directory creates an AWS Websocket API.
4
+
This example is based off of https://github.com/aws-samples/simple-websockets-chat-app
5
5
6
6
## Usage
7
7
@@ -15,13 +15,40 @@ $ terraform apply
15
15
16
16
Note that this example may create resources which cost money. Run `terraform destroy` when you don't need these resources.
17
17
18
+
## Testing the chat API
19
+
20
+
To test the WebSocket API, you can use [wscat](https://github.com/websockets/wscat), an open-source command line tool.
21
+
22
+
1.[Install NPM](https://www.npmjs.com/get-npm).
23
+
2. Install wscat:
24
+
25
+
```bash
26
+
$ npm install -g wscat
27
+
```
28
+
29
+
3. On the console, connect to your published API endpoint by executing the following command:
| <aname="output_apigatewayv2_api_api_endpoint"></a> [apigatewayv2\_api\_api\_endpoint](#output\_apigatewayv2\_api\_api\_endpoint)| The URI of the API |
89
+
| <aname="output_apigatewayv2_api_arn"></a> [apigatewayv2\_api\_arn](#output\_apigatewayv2\_api\_arn)| The ARN of the API |
90
+
| <aname="output_apigatewayv2_api_execution_arn"></a> [apigatewayv2\_api\_execution\_arn](#output\_apigatewayv2\_api\_execution\_arn)| The ARN prefix to be used in an aws\_lambda\_permission's source\_arn attribute or in an aws\_iam\_policy to authorize access to the @connections API. |
91
+
| <aname="output_apigatewayv2_api_id"></a> [apigatewayv2\_api\_id](#output\_apigatewayv2\_api\_id)| The API identifier |
92
+
| <aname="output_apigatewayv2_api_mapping_id"></a> [apigatewayv2\_api\_mapping\_id](#output\_apigatewayv2\_api\_mapping\_id)| The API mapping identifier |
93
+
| <aname="output_apigatewayv2_domain_name_api_mapping_selection_expression"></a> [apigatewayv2\_domain\_name\_api\_mapping\_selection\_expression](#output\_apigatewayv2\_domain\_name\_api\_mapping\_selection\_expression)| The API mapping selection expression for the domain name |
94
+
| <aname="output_apigatewayv2_domain_name_arn"></a> [apigatewayv2\_domain\_name\_arn](#output\_apigatewayv2\_domain\_name\_arn)| The ARN of the domain name |
95
+
| <aname="output_apigatewayv2_domain_name_configuration"></a> [apigatewayv2\_domain\_name\_configuration](#output\_apigatewayv2\_domain\_name\_configuration)| The domain name configuration |
96
+
| <aname="output_apigatewayv2_domain_name_hosted_zone_id"></a> [apigatewayv2\_domain\_name\_hosted\_zone\_id](#output\_apigatewayv2\_domain\_name\_hosted\_zone\_id)| The Amazon Route 53 Hosted Zone ID of the endpoint |
97
+
| <aname="output_apigatewayv2_domain_name_id"></a> [apigatewayv2\_domain\_name\_id](#output\_apigatewayv2\_domain\_name\_id)| The domain name identifier |
98
+
| <aname="output_apigatewayv2_domain_name_target_domain_name"></a> [apigatewayv2\_domain\_name\_target\_domain\_name](#output\_apigatewayv2\_domain\_name\_target\_domain\_name)| The target domain name |
99
+
| <aname="output_apigatewayv2_route"></a> [apigatewayv2\_route](#output\_apigatewayv2\_route)| Map containing the routes created and their attributes |
100
+
| <aname="output_apigatewayv2_stage_arn"></a> [apigatewayv2\_stage\_arn](#output\_apigatewayv2\_stage\_arn)| The default stage ARN |
101
+
| <aname="output_apigatewayv2_stage_domain_name"></a> [apigatewayv2\_stage\_domain\_name](#output\_apigatewayv2\_stage\_domain\_name)| Domain name of the stage (useful for CloudFront distribution) |
102
+
| <aname="output_apigatewayv2_stage_execution_arn"></a> [apigatewayv2\_stage\_execution\_arn](#output\_apigatewayv2\_stage\_execution\_arn)| The ARN prefix to be used in an aws\_lambda\_permission's source\_arn attribute or in an aws\_iam\_policy to authorize access to the @connections API. |
103
+
| <aname="output_apigatewayv2_stage_id"></a> [apigatewayv2\_stage\_id](#output\_apigatewayv2\_stage\_id)| The default stage identifier |
104
+
| <aname="output_apigatewayv2_stage_invoke_url"></a> [apigatewayv2\_stage\_invoke\_url](#output\_apigatewayv2\_stage\_invoke\_url)| The URL to invoke the API pointing to the stage |
0 commit comments