Skip to content

TheKeyholdingCompany/aws-websockets

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Websockets stuff

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.

Prerequisites

  • Terraform is installed
  • You have logged onto AWS using the aws sso login

Installation

  1. Clone the repository
  2. Navigate to the root of this repository
  3. Run ./package_redis.sh to package the Redis module for our lambda functions
  4. Navigate to the /terraform directory
  5. Run terraform init
  6. Run terraform workspace select <env> where env is one of testing, staging, or production.
  7. Run terraform apply --var-file=<env>.tfvars

Usage

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HCL 62.7%
  • Python 36.7%
  • Shell 0.6%