mirror of
https://github.com/karpathy/nanochat.git
synced 2026-05-09 17:30:14 +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>
45 lines
904 B
HCL
45 lines
904 B
HCL
terraform {
|
|
required_version = ">= 1.5.0"
|
|
required_providers {
|
|
aws = {
|
|
source = "hashicorp/aws"
|
|
version = ">= 5.0"
|
|
}
|
|
}
|
|
}
|
|
|
|
locals {
|
|
cluster_tag_key = "kubernetes.io/cluster/${var.cluster_name}"
|
|
}
|
|
|
|
module "vpc" {
|
|
source = "terraform-aws-modules/vpc/aws"
|
|
version = "~> 5.0"
|
|
|
|
name = "${var.name}-vpc"
|
|
cidr = var.cidr
|
|
|
|
azs = var.azs
|
|
private_subnets = var.private_subnets
|
|
public_subnets = var.public_subnets
|
|
|
|
enable_nat_gateway = true
|
|
single_nat_gateway = var.single_nat_gateway
|
|
one_nat_gateway_per_az = !var.single_nat_gateway
|
|
|
|
enable_dns_hostnames = true
|
|
enable_dns_support = true
|
|
|
|
public_subnet_tags = {
|
|
"kubernetes.io/role/elb" = "1"
|
|
(local.cluster_tag_key) = "shared"
|
|
}
|
|
|
|
private_subnet_tags = {
|
|
"kubernetes.io/role/internal-elb" = "1"
|
|
(local.cluster_tag_key) = "shared"
|
|
}
|
|
|
|
tags = var.tags
|
|
}
|