Websocket
AWS websocket reference implementation based of the following architecture:
https://aws.amazon.com/blogs/compute/announcing-websocket-apis-in-amazon-api-gateway/
It is a golang rendition of the Node.js example alongside terraform configurations.
_ All components have been implemented here except the web socket api component it is still being added to the aws provider functionalies in terraform. _
TODO
- Create API Gateway REST API v2
- Broadcast message wend send-message function is invoked.
Usage
Usage assumes you already have terraform (v0.12) and awscli (v2.42) setup and you are in the websocket folder.
Execute the following:
make init
make package
make run
To test on-connect
, provide the following as params to the function in the AWS UI and inspect the Dynamo DB to confirm a record is inserted:
{
"connection_id": "fd991532-23b2-11ea-978f-2e728ce88125"
}
To test on-disconnect
, provide the following as params to the function in the AWS UI and inspect the Dynamo DB to confirm the initially created record is removed:
{
"connection_id": "fd991532-23b2-11ea-978f-2e728ce88125"
}
To cleanup everything, run:
make destroy