WebSocket API Gateway IAM Signer
MIT License
Authorize Access to WebSocket API Gateway with AWS Signature V4: Medium
Deploy CloudFormation stack and upload functions source code (note .mjs extension instead of .js deployed by CloudFormation by default) in Lambdas.
{
"Version": "2012-10-17",
"Statement": [
{
"Action": "execute-api:Invoke",
"Effect": "Allow",
"Resource": "arn:aws:execute-api:us-east-1:1234567890:abc123/$default/*"
}
]
}
Where:
us-east-1
- region,1234567890
- account,abc123
- API Gateway ID,$default
- stage.npm install -g wscat
wscat -c 'wss://abc123.execute-api.us-east-1.amazonaws.com/$default'