AWS CloudFormation Expert Needed for CloudFront and Lambda Integration

Job ID: 39384913

Budget: $30 – $250 USD

This project involves setting up a WebSocket API via API Gateway, Lambda functions for WebSocket connection handling, and hosting a static HTML+JavaScript page on S3 — all served through a unified CloudFront distribution.

Infrastructure Overview:
You will create a single CloudFormation YAML template that provisions the entire stack. Once the CloudFormation stack is deployed, uploading the index.html file to the S3 bucket should result in a working website accessible via the CloudFront domain.

Browser


CloudFront Distribution
├── /static → S3 (index.html)
└── /wss → API Gateway (WebSocket)

Key Components to Deliver- exactly two files:
#1: CloudFormation Template (YAML)
This single template must provision the following:

S3 Bucket configured for static website hosting (private only accessible from cloudfront),
WebSocket API (API Gateway) with routes
$connect: logs new connections.
$disconnect: logs disconnections.
$default: echoes any string received.
ping: just log it and respond success.

CloudFront Distribution that:

Routes /static/* requests to the S3 bucket.
Routes /wss to the WebSocket API endpoint using API Gateway integration.

#2: index.html File
A self-contained HTML+JavaScript file that:
Loads over CloudFront via /static/index.html.
Connects to the WebSocket via /wss on the CloudFront domain (not the API Gateway domain).
Sends a test message and displays the echo response.
Handles all standard WebSocket events: open, message, error, close.

Success Criteria
* The entire infrastructure is created from one CloudFormation stack.
* Uploading the provided index.html to the S3 bucket (aws s3 cp is fine) results in a functional site accessible via CloudFront.
* JavaScript in the HTML file must connect to the WebSocket using the CloudFront domain, not directly to the API Gateway endpoint.
* Deliver in 1 week or less (welcome to use ChatGPT/Cursor etc. to create code - but has to be clean and succinct)
* We already have working code for this - probably wont use the resulting code - so please try to do your best code if awarded

Feel free to google this: Setting Up Real-Time Communication with WebSockets Using AWS API Gateway v2 and Amazon CloudFront
Related categories: Linux Amazon Web Services Node.js