Files
lunarfront-infra/terraform/postgres.tf
Ryan Moon 3471374cb6
Some checks failed
Terraform / terraform (push) Failing after 32s
Test / test (push) Successful in 1s
feat: add DOKS, managed postgres/redis, WAF rules, external-dns
2026-04-02 17:25:13 -05:00

24 lines
743 B
HCL

# ─── Managed PostgreSQL cluster ───────────────────────────────────────────────
# Shared across all customers — each customer gets their own database.
resource "digitalocean_database_cluster" "postgres" {
name = "lunarfront-postgres"
engine = "pg"
version = "16"
size = var.postgres_size
region = var.region
node_count = 1
tags = ["lunarfront", "postgres"]
}
# Restrict access to the DOKS cluster only
resource "digitalocean_database_firewall" "postgres" {
cluster_id = digitalocean_database_cluster.postgres.id
rule {
type = "k8s"
value = digitalocean_kubernetes_cluster.main.id
}
}