mirror of
https://github.com/karpathy/nanochat.git
synced 2026-05-09 01:10:10 +00:00
Add reusable Terraform modules and per-environment configs (dev/uat/prod) in us-west-2 covering: VPC (3 AZ public/private), EKS 1.29 with IRSA and ALB/EBS/EFS CSI add-ons, RDS PostgreSQL 15, four ECR repos, IAM roles (EKS node, ALB controller IRSA, GitHub Actions OIDC), Route53 + ACM for samosachaat.art, and EFS for model weights. State backend on S3 (samosachaat-terraform-state) with DynamoDB lock table. terraform validate passes for dev, uat, and prod. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
74 lines
1.6 KiB
HCL
74 lines
1.6 KiB
HCL
variable "identifier" {
|
|
description = "DB instance identifier (also used as name prefix)."
|
|
type = string
|
|
}
|
|
|
|
variable "vpc_id" {
|
|
description = "VPC the database lives in."
|
|
type = string
|
|
}
|
|
|
|
variable "private_subnet_ids" {
|
|
description = "Private subnets for the DB subnet group (>= 2 AZs)."
|
|
type = list(string)
|
|
}
|
|
|
|
variable "eks_node_security_group_id" {
|
|
description = "Node SG that should be allowed inbound to PostgreSQL."
|
|
type = string
|
|
}
|
|
|
|
variable "instance_class" {
|
|
description = "RDS instance class (e.g. db.t3.micro for dev, db.t3.medium for prod)."
|
|
type = string
|
|
default = "db.t3.micro"
|
|
}
|
|
|
|
variable "db_name" {
|
|
description = "Initial database name."
|
|
type = string
|
|
default = "samosachaat"
|
|
}
|
|
|
|
variable "db_username" {
|
|
description = "Master username."
|
|
type = string
|
|
default = "samosachaat_admin"
|
|
}
|
|
|
|
variable "allocated_storage" {
|
|
description = "Initial storage (GB)."
|
|
type = number
|
|
default = 20
|
|
}
|
|
|
|
variable "max_allocated_storage" {
|
|
description = "Storage autoscaling cap (GB)."
|
|
type = number
|
|
default = 100
|
|
}
|
|
|
|
variable "multi_az" {
|
|
description = "Enable Multi-AZ (recommended for prod)."
|
|
type = bool
|
|
default = false
|
|
}
|
|
|
|
variable "skip_final_snapshot" {
|
|
description = "Skip the final snapshot when destroying (true for dev)."
|
|
type = bool
|
|
default = true
|
|
}
|
|
|
|
variable "deletion_protection" {
|
|
description = "Block accidental deletion (recommended for prod)."
|
|
type = bool
|
|
default = false
|
|
}
|
|
|
|
variable "tags" {
|
|
description = "Tags applied to every resource."
|
|
type = map(string)
|
|
default = {}
|
|
}
|