1# ============================================================================= 2# AI Software Factory — Terraform variables 3# ============================================================================= 4 5variable "aws_region" { 6 description = "AWS region to deploy into." 7 type = string 8 default = "us-east-1" 9} 10 11variable "project" { 12 description = "Project prefix used in all resource names." 13 type = string 14 default = "factory" 15} 16 17variable "environment" { 18 description = "Environment name (dev/staging/prod) — used in resource names and tags." 19 type = string 20 default = "dev" 21} 22 23variable "node_count" { 24 description = "Desired number of nodes per application node group (web/api/worker/realtime). Min size for ASGs is derived from this." 25 type = number 26 default = 2 27} 28 29variable "instance_type_web" { 30 description = "EC2 instance type for web (Next.js) nodes." 31 type = string 32 default = "t3.large" 33} 34 35variable "instance_type_api" { 36 description = "EC2 instance type for api (NestJS) nodes." 37 type = string 38 default = "t3.large" 39} 40 41variable "instance_type_worker" { 42 description = "EC2 instance type for worker (BullMQ) nodes." 43 type = string 44 default = "t3.medium" 45} 46 47variable "instance_type_realtime" { 48 description = "EC2 instance type for realtime (WebSocket) nodes." 49 type = string 50 default = "t3.medium" 51} 52 53variable "vpc_cidr" { 54 description = "CIDR block for the VPC (must fit public + private subnets for 2 AZs)." 55 type = string 56 default = "10.42.0.0/16" 57} 58 59variable "public_subnet_cidrs" { 60 description = "CIDR blocks for the public subnets (one per AZ)." 61 type = list(string) 62 default = ["10.42.0.0/20", "10.42.16.0/20"] 63} 64 65variable "private_subnet_cidrs" { 66 description = "CIDR blocks for the private subnets (one per AZ; RDS + app private workload)." 67 type = list(string) 68 default = ["10.42.32.0/20", "10.42.48.0/20"] 69} 70 71variable "db_instance_class" { 72 description = "RDS PostgreSQL instance class." 73 type = string 74 default = "db.r6g.large.multi-az" 75} 76 77variable "db_allocated_storage_gb" { 78 description = "Initial RDS storage in GB." 79 type = number 80 default = 100 81} 82 83variable "db_name" { 84 description = "Initial database name (matches POSTGRES_DB in .env.example)." 85 type = string 86 default = "factory" 87} 88 89variable "redis_node_type" { 90 description = "ElastiCache Redis node type." 91 type = string 92 default = "cache.t4g.large" 93} 94 95variable "opensearch_node_type" { 96 description = "OpenSearch data node instance type (3-node domain)." 97 type = string 98 default = "t3.small.search" 99} 100 101variable "opensearch_volume_gb" { 102 description = "OpenSearch EBS volume size per node (GB)." 103 type = number 104 default = 50 105} 106 107variable "s3_bucket_name" { 108 description = "Uploads S3 bucket name. Must be globally unique; defaults to <project>-<env>-factory-uploads." 109 type = string 110 default = null 111} 112 113variable "public_url" { 114 description = "Public base URL of the deployment (used in outputs + docs; set to your domain)." 115 type = string 116 default = "https://factory.example.com" 117} 118 119variable "allowed_ssh_cidrs" { 120 description = "CIDR ranges allowed to reach the EC2 nodes over SSH (ops only; tighten in prod)." 121 type = list(string) 122 default = ["0.0.0.0/0"] 123} 124 125variable "tags" { 126 description = "Extra tags applied to every resource (merged with Project/ManagedBy/Environment)." 127 type = map(string) 128 default = {} 129} 130