Skip to content

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.

A short orientation before the tables:

  • Dev stacks favor cost and speed. Aurora Serverless v2 at the minimum capacity, single NAT gateway, no Hindsight, 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, Hindsight if the tenants need structured memory. 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. Every existing_* field is required if its corresponding create_* is false. 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.

These must be set in every deployment. There are no defaults.

VariableTypeDescription
stagestringDeployment stage name (e.g. dev, staging, prod). Used as a prefix for all resource names.
regionstringAWS region (e.g. us-east-1). Must match your AWS_REGION environment.
account_idstringAWS account ID (12-digit string). Used in IAM policies and resource ARNs.
db_passwordstringMaster password for the Aurora Postgres database. Minimum 16 characters. Stored in Secrets Manager.
VariableTypeDefaultDescription
database_enginestring"aurora-serverless"aurora-serverless (Aurora Serverless v2) or rds-postgres (provisioned RDS). Use aurora-serverless for dev/staging and variable workloads.
enable_hindsightboolfalseOptional Hindsight memory add-on (ECS Fargate + ALB for semantic + entity-graph retrieval). AgentCore managed memory with automatic per-turn retention is always on regardless of this setting — this flag only controls whether Hindsight is also deployed alongside it.
memory_enginestring""Deprecated. Use enable_hindsight instead. For backwards compatibility, setting this to "hindsight" is equivalent to enable_hindsight = true.
enable_workspace_orchestrationboolfalseDeploy 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_idstring"anthropic.claude-3-5-sonnet-20241022-v2:0"Bedrock model ID for the default Agent Template created on first deploy.
log_retention_daysnumber30CloudWatch log group retention in days. Set to 0 for never expire (not recommended for production).
VariableTypeDefaultDescription
create_vpcbooltrueWhether to create a new VPC. Set false to use an existing VPC.
vpc_cidrstring"10.0.0.0/16"CIDR block for the new VPC. Ignored if create_vpc = false.
availability_zoneslist(string)[]AZs to use. Defaults to the first 2 AZs in the region.
existing_vpc_idstring""Required if create_vpc = false.
existing_private_subnet_idslist(string)[]Required if create_vpc = false. Minimum 2 subnets.
existing_public_subnet_idslist(string)[]Required if create_vpc = false. Minimum 2 subnets.
create_vpc_endpointsboolfalseCreate VPC Interface endpoints for AWS services. Recommended for production or no-NAT configurations.
single_nat_gatewaybooltrueUse one NAT gateway for all AZs (cost optimization). Set false for HA in production.
VariableTypeDefaultDescription
create_databasebooltrueWhether to create a new database.
db_namestring"thinkwork"Database name.
db_usernamestring"thinkwork"Master username.
aurora_min_capacitynumber0.5Minimum ACUs for Aurora Serverless v2. Set 0.5 for dev (scales to zero when idle after 5 min).
aurora_max_capacitynumber16Maximum ACUs for Aurora Serverless v2.
rds_instance_classstring"db.t3.medium"Instance class when database_engine = "rds-postgres".
rds_allocated_storagenumber20Initial storage in GB when database_engine = "rds-postgres".
existing_db_hoststring""Required if create_database = false.
existing_db_portnumber5432Database port. Used if create_database = false.
existing_db_namestring""Database name. Required if create_database = false.
existing_db_usernamestring""Database username. Required if create_database = false.
existing_db_security_group_idstring""SG to allow Lambda access. Required if create_database = false.
VariableTypeDefaultDescription
create_cognitobooltrueWhether to create a new Cognito User Pool and Identity Pool.
cognito_domain_prefixstring""Cognito hosted UI domain prefix (e.g. thinkwork-devthinkwork-dev.auth.us-east-1.amazoncognito.com). Defaults to thinkwork-{stage}.
cognito_callback_urlslist(string)[]OAuth callback URLs for the Cognito app client. Add your admin app and end-user app URLs.
cognito_logout_urlslist(string)[]OAuth logout URLs.
google_oauth_client_idstring""Google OAuth client ID for Google identity provider. Leave empty to disable Google sign-in.
google_oauth_client_secretstring""Google OAuth client secret. Stored in Secrets Manager.
existing_user_pool_idstring""Required if create_cognito = false.
existing_user_pool_arnstring""Required if create_cognito = false.
existing_identity_pool_idstring""Required if create_cognito = false.
mfa_configurationstring"OFF"Cognito MFA setting: OFF, OPTIONAL, or ON.
VariableTypeDefaultDescription
domain_namestring""Root domain for the deployment (e.g. thinkwork.example.com). Leave empty to use CloudFront domains.
hosted_zone_idstring""Route53 hosted zone ID for domain_name. Required if domain_name is set.
admin_app_subdomainstring"app"Subdomain for the admin app (e.g. app.thinkwork.example.com).
api_subdomainstring"api"Subdomain for API Gateway (e.g. api.thinkwork.example.com).

ThinkWork always provisions an AWS Bedrock AgentCore Memory resource as part of module.thinkwork. The agent container emits a CreateEvent for every turn, and AgentCore’s built-in strategies (semantic, summarization, user-preference, episodic) extract facts in the background. Retention is automatic — you don’t need to configure anything or prompt the model to call remember().

VariableTypeDefaultDescription
agentcore_memory_idstring""Optional pre-existing AgentCore Memory resource ID to reuse. Leave empty to let the agentcore-memory module auto-provision one.
enable_hindsightboolfalseOptional add-on: also deploy the Hindsight ECS service for semantic + entity-graph retrieval alongside managed memory.
hindsight_image_tagstring"0.5.0"Hindsight Docker image tag. Only used when enable_hindsight = true.
hindsight_retain_interval_hoursnumber1How often (hours) Hindsight runs the retain step. Only used when enable_hindsight = true.
hindsight_reflect_interval_hoursnumber24How often (hours) Hindsight runs the reflect/synthesis step.
hindsight_task_cpunumber512ECS Fargate CPU units for Hindsight tasks.
hindsight_task_memorynumber1024ECS Fargate memory (MB) for Hindsight tasks.

When enable_hindsight = true, the agent container gains three additional tools (hindsight_retain, hindsight_recall, hindsight_reflect) alongside the always-on managed memory tools (remember, recall, forget). The remember() tool dual-writes to both backends so explicit memories land in both stores.

VariableTypeDefaultDescription
ses_parent_domainstring""Parent domain for tenant-scoped Space email addresses (e.g. thinkwork.example.com). Leave empty to skip SES inbound resources.
ses_tenant_slugsset(string)[]Tenant slugs to provision as SES receiving subdomains under ses_parent_domain, one identity per tenant slug.
ses_inbound_domainstring""Legacy delegated inbound domain (e.g. agents.thinkwork.example.com). Keep configured until legacy-address retirement ends.
ses_from_addressstring""From address for non-Space outbound email. Must be verified in SES.
ses_configuration_setstring"thinkwork-{stage}"SES configuration set name for email event tracking.
ses_inbound_enabledboolfalseWhether to configure SES inbound email (creates EMAIL- threads from inbound mail).

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.

Knowledge Base configuration (chunking strategy, data source wiring, sync schedule) is managed at runtime through the Knowledge module, not through terraform variables.

VariableTypeDefaultDescription
agentcore_memory_mbnumber3008Lambda memory for AgentCore. Increasing memory also increases vCPU allocation.
agentcore_timeout_secondsnumber900Lambda timeout (max 900 = 15 min).
agentcore_reserved_concurrencynumber-1Reserved concurrency for AgentCore Lambda. -1 means unreserved (uses account limit). Set a value to cap concurrent invocations.
agentcore_container_tagstring"latest"ECR image tag for the AgentCore container. Override to pin to a specific version.

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.

VariableTypeDefaultDescription
enable_workspace_orchestrationboolfalseEnables 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 tenants
SET workspace_orchestration_enabled = true
WHERE slug = 'acme';

See Workspace Orchestration for target routing, protected prefixes, runtime environment variables, and operational troubleshooting.

VariableTypeDefaultDescription
tagsmap(string){}Additional tags applied to all resources. Merged with ThinkWork’s default tags (Stage, ManagedBy: thinkwork).
stage = "dev"
region = "us-east-1"
account_id = "123456789012"
db_password = "dev-password-change-me"
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 = 1
aurora_max_capacity = 32
enable_hindsight = true # optional add-on alongside managed 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 = true
ses_inbound_domain = "agents.thinkwork.example.com" # legacy retirement notices
ses_parent_domain = "thinkwork.example.com"
ses_tenant_slugs = ["acme", "support"]
agentcore_reserved_concurrency = 50
tags = {
Team = "platform"
CostCenter = "engineering"
Environment = "production"
}