A CloudFormation-based AWS Bedrock chatbot starter that is now structured to be consumed as a Backstage platform product.
┌─────────────┐
│ │
│ API Gateway│
│ │
└──────┬──────┘
│
│ Invokes
▼
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ │ │ │ │ │
│ DynamoDB │◄─────Writes──────┤ Lambda ├─────Calls───────►│ Bedrock │
│ │ │ │ │ │
└─────────────┘ └─────────────┘ └─────────────┘
This repository now includes:
catalog-info.yamlfor Backstage catalog registrationmkdocs.ymlanddocs/for TechDocs-ready documentationtemplates/create-bedrock-chatbot/template.yamlas a Backstage Scaffolder templatedocs/backlog.mdas the implementation backlog for the IDP transition
This template creates the following AWS resources:
- DynamoDB Table: Stores conversation history
- Lambda Function: Processes requests and calls Bedrock
- API Gateway: Provides HTTP endpoint for the chatbot
- IAM Roles: Necessary permissions for Lambda
- AWS CLI installed and configured
- AWS account with access to Bedrock, Lambda, API Gateway, and DynamoDB
aws cloudformation create-stack \
--stack-name bedrock-chatbot \
--template-body file://template.yaml \
--parameters \
ParameterKey=DynamoDBTableName,ParameterValue=chatbot-history \
ParameterKey=BedrockModelId,ParameterValue=anthropic.claude-v2 \
--capabilities CAPABILITY_IAMaws cloudformation describe-stacks --stack-name bedrock-chatbotnpm testnode validate-template.jsnpm install
node visualize-services.js template.yamlOnce deployed, you can interact with the chatbot by sending POST requests to the API Gateway endpoint:
curl -X POST \
https://{api-id}.execute-api.{region}.amazonaws.com/prod/chat \
-H 'Content-Type: application/json' \
-d '{"input": "Hello, how to test cloudformation template?"}'To delete all resources:
aws cloudformation delete-stack --stack-name bedrock-chatbot