-
Notifications
You must be signed in to change notification settings - Fork 925
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
New serverless pattern - apigw-websocket-api-vpclink #2391
base: main
Are you sure you want to change the base?
Conversation
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove extra lines here. Review all the files as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rename the folder as per the name of the pattern. You may find examples in the repository.
|
||
The SAM template deploys a websocket API Gateway and two Lambda functions required to run the application. This pattern deploys an Amazon API Gateway WebSocket API with a $connect route with a Lambda proxy integration which will invoke another Lambda function asynchronously and pass the Connection Id and the API Gateway stage URL to it. Then the Lambda function which got invoked asynchronously will check the validity of the connection. If the Connection Id is valid it will make an SDK API call to post a greeting to the client. | ||
|
||
Learn more about this pattern at Serverless Land Patterns: https://serverlessland.com/patterns/s3-lambda |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update the link
3. From the command line, use AWS SAM to build and deploy the AWS resources for the pattern as specified in the template.yml file: | ||
|
||
``` | ||
sam build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no requirements.txt file. Do you need this command?
3. Connect to your WebSocketURL by executing the following command: | ||
``` | ||
$ wscat -c <YOUR WEBSOCKET URL> | ||
``` | ||
|
||
4. To test the custom route and its associated function, send a JSON-formatted request like the following example. The Lambda function sends back the value of the "data" key using the callback URL: | ||
``` | ||
$ wscat -c <YOUR WEBSOCKET URL> | ||
connected (press CTRL+C to quit) | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you kindly explain this with an example for better clarity?
@@ -0,0 +1,75 @@ | |||
## Websocket API Gateway acknowledgement for $connect route. | |||
|
|||
The SAM template deploys a websocket API Gateway and two Lambda functions required to run the application. This pattern deploys an Amazon API Gateway WebSocket API with a $connect route with a Lambda proxy integration which will invoke another Lambda function asynchronously and pass the Connection Id and the API Gateway stage URL to it. Then the Lambda function which got invoked asynchronously will check the validity of the connection. If the Connection Id is valid it will make an SDK API call to post a greeting to the client. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The explanation in first 2 lines redundant. Could you please rephrase it?
Thanks for the contribution @manasvijain99. As this PR contains 2 new patterns, I'd request you to kindly update the PR to have just 1 pattern and have a new PR for another. |
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
We have created a pattern which deploys a SAM template to create an Amazon API Gateway Websocket API endpoint with a VPC Link integration.