Overview
Bedrock Chat uses a schema-based parameter system powered by Zod for validation. Parameters can be configured incdk.json (context) or parameter.ts (environment-specific).
Configuration Files
cdk.json
Default parameters for the “default” environment. Located atcdk/cdk.json.
parameter.ts
Environment-specific parameters with type safety. Located atcdk/parameter.ts.
Base Parameters
Common across all stacks.Environment name (max 10 chars, alphanumeric starting with letter).
Used as suffix for stack names and resource prefixes.
Automatically derived from
envName. Empty for “default”, otherwise equals envName.AWS region where Amazon Bedrock is available.Common regions:
us-east-1, us-west-2, eu-west-1, ap-northeast-1Enable Bedrock’s global inference routing for automatic model failover.
Allow Bedrock to use models from multiple regions for higher availability.
Bedrock Chat Parameters
Main application parameters forBedrockChatStack.
Frontend & Security
Deploy Web ACL for CloudFront distribution.Important: Requires
us-east-1 deployment capability. Set to false if you cannot deploy to us-east-1.Enable IPv6 for CloudFront distribution.
Allowed IPv4 CIDR ranges for frontend access (enforced by WAF if enabled).Default: All IPv4 addresses allowedExample:
["203.0.113.0/24", "198.51.100.0/24"]Allowed IPv6 CIDR ranges for frontend access.Default: All IPv6 addresses allowed
ISO 3166-1 alpha-2 country codes for geo-restriction.Empty array: No geo-restrictionExample:
["US", "CA", "GB"]Allowed IPv4 ranges for published bot APIs.
Allowed IPv6 ranges for published bot APIs.
Authentication
Array of identity provider configurations for SSO.Format:Secrets Manager format:
- Google:
{"clientId": "...", "clientSecret": "..."} - OIDC:
{"clientId": "...", "clientSecret": "...", "issuerUrl": "..."}
Cognito domain prefix for hosted UI. Required if
identityProviders is configured.Format: Lowercase alphanumeric and hyphensExample: bedrock-chat-devEmail domains allowed for self-signup.Empty array: All email domains allowedExample:
["example.com", "acme.org"]Cognito groups users automatically join after signup.Available groups:
Admin, CreatingBotAllowed, PublishAllowedAllow users to self-register. Disabled if identity providers are configured.
Cognito ID token validity in minutes.Range: 5 minutes to 24 hours
Performance & Availability
Enable standby replicas for OpenSearch Serverless collections (Knowledge Bases).Impact: Higher availability, ~2x cost
Enable Lambda SnapStart for faster cold starts on API and WebSocket handlers.Supported runtimes: Java, Python (3.13+)
Custom Domain
Custom domain for the frontend (e.g.,
chat.example.com).Requirements: Valid ACM certificate will be auto-created in us-east-1Route53 hosted zone ID for DNS record creation. Required if
alternateDomainName is set.Bot Store
Enable bot store for discovering and sharing bots.
Enable standby replicas for bot store OpenSearch collection.
Language for bot store text analysis.Options:
en, de, fr, es, ja, ko, zhhans, zhhant, it, nb, th, id, msModel Configuration
Restrict available models to specific model IDs.Empty array: All Bedrock models availableExample:
["anthropic.claude-3-5-sonnet-20241022-v2:0", "anthropic.claude-3-5-haiku-20241022-v1:0"]Model ID selected by default when users first visit the app.Example:
"anthropic.claude-3-5-sonnet-20241022-v2:0"Model used for generating conversation titles.Default: Falls back to
defaultModel, then hardcoded defaultBranding
Path to custom logo file for frontend branding.Format: Relative path from frontend build directory
S3 Configuration
Prefix for all S3 bucket names.Format: Lowercase alphanumeric and hyphens onlyExample:
"mycompany" creates buckets like mycompany-access-logs, mycompany-frontend-assetsDevelopment
IAM role ARN for developer access to OpenSearch collections.Format:
arn:aws:iam::123456789012:role/DeveloperRoleGrants: aoss:* permissions for bot store debuggingAPI Publish Parameters
Parameters forApiPublishmentStack (passed via CodeBuild environment variables).
Steady-state requests per second.Example:
100Burst capacity for request handling.Example:
200Maximum requests per quota period.Example:
10000Quota period for rate limiting.
API Gateway deployment stage name.
Existing API ID to update (used for redeployment).
JSON array of allowed CORS origins.Example:
'["https://app.example.com", "https://admin.example.com"]'Custom Bot Parameters
Parameters forBedrockCustomBotStack (passed via CodeBuild environment variables).
User ID of the bot creator.
Unique bot identifier (UUID).
S3 bucket name containing bot documents.
JSON-encoded knowledge configuration.Format:
JSON-encoded Knowledge Base configuration.Format:
JSON-encoded guardrails configuration.Format:Thresholds: 0 (disabled), 1 (low), 2 (medium), 3 (high)
Enable replicas for this bot’s Knowledge Base.Values:
"true" or "false" (string)Shared Knowledge Bases Parameters
Parameters forBedrockSharedKnowledgeBasesStack (passed via CodeBuild environment variables).
JSON-encoded array of shared Knowledge Base configurations.Format:
S3 bucket containing shared documents.
Enable replicas for shared Knowledge Bases.
Parameter Validation
All parameters are validated using Zod schemas incdk/lib/utils/parameter-models.ts.
Validation rules:
envName: Max 10 chars, alphanumeric, starts with letterbucketPrefix: Lowercase alphanumeric + hyphens, suitable for S3 naming- IP ranges: Valid CIDR notation
- Model IDs: String format (not validated against Bedrock catalog)
Environment Variables
Runtime environment variables are automatically set by CDK for Lambda functions and CodeBuild projects. These are not user-configurable parameters. Common Lambda environment variables:CONVERSATION_TABLE_NAMEBOT_TABLE_NAMEBEDROCK_REGIONDOCUMENT_BUCKETUSER_POOL_IDTABLE_ACCESS_ROLE_ARNENABLE_BEDROCK_GLOBAL_INFERENCEENABLE_BEDROCK_CROSS_REGION_INFERENCE