This folder contains the AWS Lambda function for SentinelBot.
The Lambda:
- Receives requests from API Gateway
- Uses cache or Anthropic API to generate answers
- Logs all requests to DynamoDB
- AWS CLI installed
- AWS CLI configured with access keys
- Correct region set to us-east-1
- IAM user has permission for Lambda (AWSLambda_FullAccess)
From this folder, run:
chmod +x deploy.sh
./deploy.shWhat this does:
- Zips
index.jsintofunction.zip - Uploads the zip to AWS Lambda
- Updates the function code
Use AWS CLI:
aws lambda update-function-configuration \
--function-name sentinelbot-handler \
--region us-east-1 \
--environment "Variables={DYNAMO_TABLE=shieldbearer-sentinel-logs,ANTHROPIC_API_KEY=YOUR_KEY}"Notes:
- Do not include
SENTINEL_SYSTEM_PROMPT(now embedded in code) - Keep secrets out of source control
aws lambda get-function \
--function-name sentinelbot-handler \
--region us-east-1 \
--query 'Configuration.FunctionName'Expected output:
"sentinelbot-handler"
- Update
index.js - Run
./deploy.sh - Open website
- Ask SentinelBot a question
- Check DynamoDB logs
- Logging is best-effort and should not break the API
- Cached answers return instantly
- Anthropic answers may take 1-2 seconds
- Keep deployment package small for faster updates
- Add CI/CD pipeline (GitHub Actions)
- Move secrets to AWS Secrets Manager
- Add environment separation (dev/prod)
- Build admin UI for DynamoDB logs