diff --git a/docs/DOCUMENTATION.md b/docs/DOCUMENTATION.md index 7af69cd..3771f7f 100644 --- a/docs/DOCUMENTATION.md +++ b/docs/DOCUMENTATION.md @@ -72,7 +72,7 @@ terraform apply ### Key flows -- **DNS:** Terraform looks up your current IP (`https://api.myip.com/`) and creates `A` records on Cloudflare for every zone/record in `domain_mappings` (unless an IP is pinned). +- **DNS:** Terraform looks up your current IP (`https://api.ipify.org?format=json`) and creates `A` records on Cloudflare for every zone/record in `domain_mappings` (unless an IP is pinned via `myip`, in which case the lookup is skipped). - **Plugins:** Terraform uses the `k8s-helm-charts` module to install `external-secrets`, `metallb`, `cert-manager`, `argo-cd`, `tailscale-operator`, and `traefik`. Each lands in its own `plugin-` namespace. - **Infrastructure:** Terraform deploys `charts/infrastructure`, which creates the Argo CD repo credentials, `AppProject main`, the ApplicationSet that watches `charts/apps/*`, the MetalLB IP address pool, and External Secrets ClusterSecretStores. - **GitOps:** The ApplicationSet automatically creates an Argo CD Application for each folder under `charts/apps/`, syncing it to its own namespace. Value files `values.yaml` + `values-.yaml` are merged per deployment environment. diff --git a/tf-dns.tf b/tf-dns.tf index a0d3f31..94df453 100644 --- a/tf-dns.tf +++ b/tf-dns.tf @@ -1,9 +1,10 @@ data "http" "myip" { - url = "https://api.myip.com/" + count = var.myip == "" ? 1 : 0 + url = "https://api.ipify.org?format=json" } locals { - myip = var.myip != "" ? var.myip : jsondecode(data.http.myip.response_body)["ip"] + myip = var.myip != "" ? var.myip : jsondecode(data.http.myip[0].response_body)["ip"] } data "cloudflare_zone" "this" { for_each = var.domain_mappings