# ============================================================================= # AI Software Factory — Terraform variables # ============================================================================= variable "aws_region" { description = "AWS region to deploy into." type = string default = "us-east-1" } variable "project" { description = "Project prefix used in all resource names." type = string default = "factory" } variable "environment" { description = "Environment name (dev/staging/prod) — used in resource names and tags." type = string default = "dev" } variable "node_count" { description = "Desired number of nodes per application node group (web/api/worker/realtime). Min size for ASGs is derived from this." type = number default = 2 } variable "instance_type_web" { description = "EC2 instance type for web (Next.js) nodes." type = string default = "t3.large" } variable "instance_type_api" { description = "EC2 instance type for api (NestJS) nodes." type = string default = "t3.large" } variable "instance_type_worker" { description = "EC2 instance type for worker (BullMQ) nodes." type = string default = "t3.medium" } variable "instance_type_realtime" { description = "EC2 instance type for realtime (WebSocket) nodes." type = string default = "t3.medium" } variable "vpc_cidr" { description = "CIDR block for the VPC (must fit public + private subnets for 2 AZs)." type = string default = "10.42.0.0/16" } variable "public_subnet_cidrs" { description = "CIDR blocks for the public subnets (one per AZ)." type = list(string) default = ["10.42.0.0/20", "10.42.16.0/20"] } variable "private_subnet_cidrs" { description = "CIDR blocks for the private subnets (one per AZ; RDS + app private workload)." type = list(string) default = ["10.42.32.0/20", "10.42.48.0/20"] } variable "db_instance_class" { description = "RDS PostgreSQL instance class." type = string default = "db.r6g.large.multi-az" } variable "db_allocated_storage_gb" { description = "Initial RDS storage in GB." type = number default = 100 } variable "db_name" { description = "Initial database name (matches POSTGRES_DB in .env.example)." type = string default = "factory" } variable "redis_node_type" { description = "ElastiCache Redis node type." type = string default = "cache.t4g.large" } variable "opensearch_node_type" { description = "OpenSearch data node instance type (3-node domain)." type = string default = "t3.small.search" } variable "opensearch_volume_gb" { description = "OpenSearch EBS volume size per node (GB)." type = number default = 50 } variable "s3_bucket_name" { description = "Uploads S3 bucket name. Must be globally unique; defaults to --factory-uploads." type = string default = null } variable "public_url" { description = "Public base URL of the deployment (used in outputs + docs; set to your domain)." type = string default = "https://factory.example.com" } variable "allowed_ssh_cidrs" { description = "CIDR ranges allowed to reach the EC2 nodes over SSH (ops only; tighten in prod)." type = list(string) default = ["0.0.0.0/0"] } variable "tags" { description = "Extra tags applied to every resource (merged with Project/ManagedBy/Environment)." type = map(string) default = {} }