Skip to content

jb-is-batman/terraform-websocket-chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS WebSocket API Echo Server

This repository contains the Terraform configuration and Lambda function code (Python) for setting up a simple WebSocket API using AWS API Gateway. The Lambda function is designed to echo back messages sent by clients, demonstrating basic WebSocket functionality.

Overview

The project sets up:

  • AWS API Gateway WebSocket API
  • Lambda functions for connection management (connect, disconnect) and message echoing (sendmessage)
  • IAM roles and policies for Lambda and API Gateway

Prerequisites

  • AWS Account
  • Terraform installed
  • AWS CLI configured with appropriate permissions
  • Basic knowledge of AWS services (Lambda, API Gateway, IAM)
  • Pyton 3.10

Setup and Deployment

  1. Clone the Repository
git clone https://github.com/jb-is-batman/terraform-websocket-chat
cd terraform-websocket-chat
  1. Initialize Terraform
terraform init
  1. Apply Terraform Configuration
terraform apply

Using the WebSocket API

  • Connect to the WebSocket URL provided by API Gateway after deployment.
  • Send a message in JSON format, e.g., {"action": "sendmessage", "message": "Hello World"}.
  • The sendmessage Lambda function will echo the message back to you.

Future Enhancements

  • Implement authentication and authorization (e.g., using Amazon Cognito or Lambda Authorizers).
  • Add more complex message handling and business logic.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published