This is a websockets project written in Terraform and Python. Your websocket client can connect, subscribe to a topic and receive messages sent to that topic.
- Terraform is installed
- You have logged onto AWS using the
aws sso login
- Clone the repository
- Navigate to the root of this repository
- Run
./package_redis.sh
to package the Redis module for our lambda functions - Navigate to the
/terraform
directory - Run
terraform init
- Run
terraform workspace select <env>
where env is one oftesting
,staging
, orproduction
. - Run
terraform apply --var-file=<env>.tfvars
To connect use the command wscat -c wss://<YOUR_API_GW_INVOKE_URL>
e.g. wscat -c wss://abc123.execute-api.eu-west-1.amazonaws.com/dev
Once connected, press enter and the default response will give instructions on usage.
TODO
- Authorization: query string
- Authorization: x-api-key header
- Storage: change dynamoDB to cache e.g. elastic cache
- PING/PONG request/response to prevent client connection timeout
- Redis connection pooling
- Create Github action workflow to do current manual task of packaging redis and deploying architecture through terraform