Configuration Reference
This page documents all Terraform variables for the thinkwork-ai/thinkwork/aws module. Variables are grouped by category, and every variable has a sensible default — a full dev deployment needs only four variables set (stage, region, account, DB password), and a production deployment typically adds a domain, Google OAuth credentials, and HA overrides.
How to choose values
Section titled “How to choose values”A short orientation before the tables:
- Dev stacks favor cost and speed. Aurora Serverless v2 at the minimum capacity, single NAT gateway, hosted Hindsight Brain memory, and Claude Haiku as the default model. You can stand up and tear down these stacks in minutes.
- Production stacks favor availability and safety. HA across AZs, reserved concurrency on AgentCore, domain + ACM, Google OAuth enabled, and Hindsight sized for tenant memory load. Expect the first deploy to take 15–20 minutes.
- Shared-infrastructure stacks use the
create_*boolean flags to adopt an existing VPC, database, or Cognito pool instead of creating new ones. Everyexisting_*field is required if its correspondingcreate_*isfalse. See BYO Infrastructure for the full story. - Enterprise customer stacks should use a customer-owned Enterprise Deployment Repo rather than forking the ThinkWork source repository. Bootstrap creates the repo, state backend, artifact bucket, GitHub OIDC trust, and per-stage CI environment; after that, GitHub Actions deploys pinned releases and applies customer overlays.
Defaults are chosen for dev correctness. Don’t set every value explicitly — set the ones that matter for your deployment shape and let the rest fall to defaults.
Required variables
Section titled “Required variables”These must be set in every deployment. There are no defaults.
| Variable | Type | Description |
|---|---|---|
stage | string | Deployment stage name (e.g. dev, staging, prod). Used as a prefix for all resource names. |
region | string | AWS region (e.g. us-east-1). Must match your AWS_REGION environment. |
account_id | string | AWS account ID (12-digit string). Used in IAM policies and resource ARNs. |
db_password | string | Master password for the Aurora Postgres database. Minimum 16 characters. Stored in Secrets Manager. |
Core options
Section titled “Core options”| Variable | Type | Default | Description |
|---|---|---|---|
database_engine | string | "aurora-serverless" | aurora-serverless (Aurora Serverless v2) or rds-postgres (provisioned RDS). Use aurora-serverless for dev/staging and variable workloads. |
enable_hindsight | bool | true | Deploy the Hindsight ECS service used as the hosted Brain memory substrate for user memory, Space memory, retained documents, recall/reflect, and evidence. |
memory_engine | string | "" | Active memory engine. Empty selects Hindsight. Use "agentcore" only for explicit low-cost/development compatibility. |
enable_workspace_orchestration | bool | false | Deploy S3 EventBridge/SQS routing and the workspace event dispatcher for async folder-native agent work. Also enable tenants.workspace_orchestration_enabled per tenant after migration. |
default_model_id | string | "anthropic.claude-3-5-sonnet-20241022-v2:0" | Bedrock model ID for the default Agent Template created on first deploy. |
log_retention_days | number | 30 | CloudWatch log group retention in days. Set to 0 for never expire (not recommended for production). |
Networking
Section titled “Networking”| Variable | Type | Default | Description |
|---|---|---|---|
create_vpc | bool | true | Whether to create a new VPC. Set false to use an existing VPC. |
vpc_cidr | string | "10.0.0.0/16" | CIDR block for the new VPC. Ignored if create_vpc = false. |
availability_zones | list(string) | [] | AZs to use. Defaults to the first 2 AZs in the region. |
existing_vpc_id | string | "" | Required if create_vpc = false. |
existing_private_subnet_ids | list(string) | [] | Required if create_vpc = false. Minimum 2 subnets. |
existing_public_subnet_ids | list(string) | [] | Required if create_vpc = false. Minimum 2 subnets. |
create_vpc_endpoints | bool | false | Create VPC Interface endpoints for AWS services. Recommended for production or no-NAT configurations. |
single_nat_gateway | bool | true | Use one NAT gateway for all AZs (cost optimization). Set false for HA in production. |
Database
Section titled “Database”| Variable | Type | Default | Description |
|---|---|---|---|
create_database | bool | true | Whether to create a new database. |
db_name | string | "thinkwork" | Database name. |
db_username | string | "thinkwork" | Master username. |
aurora_min_capacity | number | 0.5 | Minimum ACUs for Aurora Serverless v2. Set 0.5 for dev (scales to zero when idle after 5 min). |
aurora_max_capacity | number | 16 | Maximum ACUs for Aurora Serverless v2. |
rds_instance_class | string | "db.t3.medium" | Instance class when database_engine = "rds-postgres". |
rds_allocated_storage | number | 20 | Initial storage in GB when database_engine = "rds-postgres". |
existing_db_host | string | "" | Required if create_database = false. |
existing_db_port | number | 5432 | Database port. Used if create_database = false. |
existing_db_name | string | "" | Database name. Required if create_database = false. |
existing_db_username | string | "" | Database username. Required if create_database = false. |
existing_db_security_group_id | string | "" | SG to allow Lambda access. Required if create_database = false. |
Auth (Cognito)
Section titled “Auth (Cognito)”| Variable | Type | Default | Description |
|---|---|---|---|
create_cognito | bool | true | Whether to create a new Cognito User Pool and Identity Pool. |
cognito_domain_prefix | string | "" | Cognito hosted UI domain prefix (e.g. thinkwork-dev → thinkwork-dev.auth.us-east-1.amazoncognito.com). Defaults to thinkwork-{stage}. |
cognito_callback_urls | list(string) | [] | OAuth callback URLs for the Cognito app client. Add your web app URLs. |
cognito_logout_urls | list(string) | [] | OAuth logout URLs. |
google_oauth_client_id | string | "" | Google OAuth client ID for Google identity provider. Leave empty to disable Google sign-in. |
google_oauth_client_secret | string | "" | Google OAuth client secret. Stored in Secrets Manager. |
existing_user_pool_id | string | "" | Required if create_cognito = false. |
existing_user_pool_arn | string | "" | Required if create_cognito = false. |
existing_identity_pool_id | string | "" | Required if create_cognito = false. |
mfa_configuration | string | "OFF" | Cognito MFA setting: OFF, OPTIONAL, or ON. |
Domain and DNS
Section titled “Domain and DNS”| Variable | Type | Default | Description |
|---|---|---|---|
domain_name | string | "" | Root domain for the deployment (e.g. thinkwork.example.com). Leave empty to use CloudFront domains. |
hosted_zone_id | string | "" | Route53 hosted zone ID for domain_name. Required if domain_name is set. |
admin_app_subdomain | string | "app" | Subdomain for the web app (e.g. app.thinkwork.example.com). |
api_subdomain | string | "api" | Subdomain for API Gateway (e.g. api.thinkwork.example.com). |
Memory
Section titled “Memory”Hosted ThinkWork uses Hindsight as the canonical Brain memory substrate. The runtime retains learned context into Hindsight after turns and uses direct Hindsight recall/reflect for user and Space memory. AgentCore managed memory can still be provisioned as an explicit compatibility path, but it is not the hosted default.
| Variable | Type | Default | Description |
|---|---|---|---|
agentcore_memory_id | string | "" | Optional pre-existing AgentCore Memory resource ID to reuse for explicit managed-memory compatibility mode. |
enable_hindsight | bool | true | Deploy the Hindsight ECS service used by hosted Brain memory. |
hindsight_image_tag | string | "0.5.0" | Hindsight Docker image tag. Only used when enable_hindsight = true. |
hindsight_retain_interval_hours | number | 1 | How often (hours) Hindsight runs the retain step. Only used when enable_hindsight = true. |
hindsight_reflect_interval_hours | number | 24 | How often (hours) Hindsight runs the reflect/synthesis step. |
hindsight_task_cpu | number | 512 | ECS Fargate CPU units for Hindsight tasks. |
hindsight_task_memory | number | 1024 | ECS Fargate memory (MB) for Hindsight tasks. |
When Hindsight is active, the agent runtime uses Hindsight recall/reflect for durable memory and the post-turn retain pipeline writes learned context back to Hindsight. Do not configure dual default memory products unless you are performing a deliberate compatibility migration.
Email (SES)
Section titled “Email (SES)”| Variable | Type | Default | Description |
|---|---|---|---|
ses_parent_domain | string | "" | Parent domain for tenant-scoped Space email addresses (e.g. thinkwork.example.com). Leave empty to skip SES inbound resources. |
ses_tenant_slugs | set(string) | [] | Tenant slugs to provision as SES receiving subdomains under ses_parent_domain, one identity per tenant slug. |
ses_inbound_domain | string | "" | Legacy delegated inbound domain (e.g. agents.thinkwork.example.com). Keep configured until legacy-address retirement ends. |
ses_from_address | string | "" | From address for non-Space outbound email. Must be verified in SES. |
ses_configuration_set | string | "thinkwork-{stage}" | SES configuration set name for email event tracking. |
ses_inbound_enabled | bool | false | Whether to configure SES inbound email (creates EMAIL- threads from inbound mail). |
Legacy Knowledge Base
Section titled “Legacy Knowledge Base”Hindsight-backed Brain Sources are the default document-memory path. Bedrock Knowledge Bases remain available for explicit legacy compatibility and external document-retrieval experiments.
ThinkWork provisions an IAM service role that lets Bedrock Knowledge Bases read from the KB S3 bucket, invoke amazon.titan-embed-text-v2:0 for embeddings, and write vectors into Aurora Postgres via the RDS Data API. There is no OpenSearch Serverless collection — the vector index lives in the same Aurora cluster as the rest of your data (pgvector), so there is no separate vector-store cost line.
Legacy Knowledge Base configuration (chunking strategy, data source wiring, sync schedule) is managed at runtime through the Knowledge module, not through terraform variables.
AgentCore
Section titled “AgentCore”| Variable | Type | Default | Description |
|---|---|---|---|
agentcore_memory_mb | number | 3008 | Lambda memory for AgentCore. Increasing memory also increases vCPU allocation. |
agentcore_timeout_seconds | number | 900 | Lambda timeout (max 900 = 15 min). |
agentcore_reserved_concurrency | number | -1 | Reserved concurrency for AgentCore Lambda. -1 means unreserved (uses account limit). Set a value to cap concurrent invocations. |
agentcore_container_tag | string | "latest" | ECR image tag for the AgentCore container. Override to pin to a specific version. |
Workspace orchestration
Section titled “Workspace orchestration”Workspace orchestration is the S3-backed event layer that turns files like work/inbox/*.md, review/*, and work/runs/*/events/*.json into canonical agent-work events. It is disabled by default so operators can roll it out tenant by tenant.
| Variable | Type | Default | Description |
|---|---|---|---|
enable_workspace_orchestration | bool | false | Enables workspace bucket EventBridge notifications, EventBridge rules, SQS queues, DLQs, and the workspace-event-dispatcher Lambda event source mapping. |
After Terraform apply, enable the tenant row:
UPDATE tenantsSET workspace_orchestration_enabled = trueWHERE slug = 'acme';See Workspace Orchestration for target routing, protected prefixes, runtime environment variables, and operational troubleshooting.
| Variable | Type | Default | Description |
|---|---|---|---|
tags | map(string) | {} | Additional tags applied to all resources. Merged with ThinkWork’s default tags (Stage, ManagedBy: thinkwork). |
Example: minimal dev config
Section titled “Example: minimal dev config”stage = "dev"region = "us-east-1"account_id = "123456789012"db_password = "dev-password-change-me"Example: production config
Section titled “Example: production config”stage = "prod"region = "us-east-1"account_id = "123456789012"db_password = var.db_password # From CI secret
domain_name = "agents.example.com"hosted_zone_id = "Z1234567890ABC"
database_engine = "aurora-serverless"aurora_min_capacity = 1aurora_max_capacity = 32
enable_hindsight = true # hosted Hindsight Brain memory
single_nat_gateway = false # HA: one NAT per AZ
create_vpc_endpoints = true
cognito_callback_urls = [ "https://app.agents.example.com/callback", "https://agents.example.com/callback"]
google_oauth_client_id = "abc.apps.googleusercontent.com"google_oauth_client_secret = var.google_oauth_secret
ses_from_address = "system@thinkwork.example.com"ses_inbound_enabled = trueses_inbound_domain = "agents.thinkwork.example.com" # legacy retirement noticesses_parent_domain = "thinkwork.example.com"ses_tenant_slugs = ["acme", "support"]
agentcore_reserved_concurrency = 50
tags = { Team = "platform" CostCenter = "engineering" Environment = "production"}Related pages
Section titled “Related pages”- Enterprise Deployment Repo — recommended enterprise deployment path
- Customer Overlay Contract — eval, skill, workspace default, seed, and branding packs
- Greenfield AWS Deploy — end-to-end walkthrough with these variables in context
- BYO Infrastructure — adopting an existing VPC, database, or Cognito pool
- Getting Started — the 15-minute dev deploy
- Architecture — what each tier of resources does
- Concepts: Control — the production-readiness concerns these variables touch (guardrails, budgets, audit)