Prerequisites
UNIX/Linux
Mac, Linux, or WSL2 on Windows
Docker
Docker Engine installed and running
Node.js
Node.js runtime environment
Installation
Configuration
Before deployment, configure your settings using one of two methods:Method 1: Using cdk.json (Traditional)
Edit thecdk/cdk.json file to set deployment parameters:
Method 2: Using parameter.ts (Recommended)
For better type safety and developer experience, use theparameter.ts file:
Existing users can continue using
cdk.json without changes. The parameter.ts approach is recommended for new deployments or when managing multiple environments.Key Configuration Options
Edit these values in your configuration:Required Settings
- bedrockRegion: AWS region where Bedrock is available (e.g.,
us-east-1)
Security Settings
- allowedIpV4AddressRanges: Array of allowed IPv4 CIDR blocks
- allowedIpV6AddressRanges: Array of allowed IPv6 CIDR blocks
- selfSignUpEnabled: Enable/disable user self-registration
- allowedSignUpEmailDomains: Restrict signup to specific email domains
- allowedCountries: Restrict access by country (ISO-3166 codes)
Performance Settings
- enableLambdaSnapStart: Enable Lambda SnapStart for faster cold starts
-
enableRagReplicas: Enable additional replicas for RAG (OpenSearch)
true: Higher availability, higher cost (production)false: Lower cost (development)
Model Configuration
-
globalAvailableModels: Array of model IDs to enable
- Empty array
[]: All models enabled - Specific models: Only listed models appear in UI
- Empty array
- defaultModel: Model pre-selected when users start a new chat
- titleModel: Model used for generating conversation titles
Branding
- logoPath: Relative path under
frontend/publicfor the logo
Supported Model IDs
The following model IDs are supported (ensure they’re enabled in Bedrock console): Claude Modelsclaude-v4-opus,claude-v4.1-opus,claude-v4.5-opusclaude-v4-sonnet,claude-v3.5-sonnet,claude-v3.5-sonnet-v2,claude-v3.7-sonnetclaude-v3.5-haiku,claude-v3-haiku,claude-v3-opus
amazon-nova-pro,amazon-nova-lite,amazon-nova-micro
mistral-7b-instruct,mixtral-8x7b-instruct,mistral-large,mistral-large-2
deepseek-r1
llama3-3-70b-instruct,llama3-2-1b-instruct,llama3-2-3b-instructllama3-2-11b-instruct,llama3-2-90b-instruct
Bootstrap CDK
Before deploying CDK for the first time in a region, run bootstrap:Bootstrap is only required once per AWS account and region.
Deploy
Deploy all stacks:Deployment Output
After successful deployment (approximately 10-20 minutes), you’ll see output similar to:CDK Stack Structure
Bedrock Chat deploys the following CloudFormation stacks:Main Stacks
-
BedrockChatStack: Main application stack containing:
- Frontend (CloudFront + S3)
- Backend API (API Gateway + Lambda)
- Database (DynamoDB)
- Authentication (Cognito)
- WebSocket API
- Embedding pipeline (Step Functions)
- Bot Store (if enabled)
- Usage analytics
- FrontendWafStack: WAF Web ACL for CloudFront (deployed in us-east-1)
Dynamic Stacks
These stacks are created at runtime when users create custom bots or publish APIs:- BrChatKbStack[BotId]: Custom Knowledge Base for a bot
- ApiPublishmentStack[ApiId]: Published API for a bot
CDK Commands
Useful CDK Commands
Watch Mode
For development, use watch mode to automatically redeploy on code changes:Project Structure
The CDK project is organized as follows:Environment Variables
CDK deployment doesn’t require environment variables for the main stack. However, dynamic stacks (custom bots, API publishing) use environment variables set by the application at runtime.Cleanup
To remove all deployed resources:- Go to CloudFormation
- Delete
BedrockChatStackin your deployment region - Switch to us-east-1 and delete
FrontendWafStack - Delete any remaining bot stacks (
BrChatKbStack*) or API stacks (ApiPublishmentStack*)
Troubleshooting
CDK Bootstrap Fails
Ensure you have sufficient IAM permissions to create:- S3 buckets
- IAM roles
- CloudFormation stacks
Docker Not Running
CDK requires Docker to build Lambda functions. Ensure Docker is running:Insufficient Disk Space
CDK downloads dependencies and builds assets locally. Ensure you have at least 10GB of free disk space.Stack Already Exists
If a stack with the same name already exists:Next Steps
Multi-Environment Setup
Deploy multiple environments
Local Development
Set up local development environment
Parameters Reference
Complete parameters documentation
Security Configuration
Configure security settings