Files
coder/scaletest/terraform/action/cf_dns.tf
T
Ethan 5145cd002d chore(scaletest): add tls to infrastructure (#19412)
Closes https://github.com/coder/internal/issues/850

This PR has the scaletest infrastructure retrieve and use TLS certificates from the persistent observability cluster.

To support creating multiple instances of the infrastructure simultaneously, `var.name` can be set to `alpha`, `bravo` or `charlie`, which retrieves the corresponding certificates.

Also:
- Adds support for wildcard apps.
- Retrieves the Cloudflare token from GCP secrets.
2025-08-25 12:25:09 +10:00

22 lines
608 B
Terraform

data "cloudflare_zone" "domain" {
name = var.cloudflare_domain
}
resource "cloudflare_record" "coder" {
for_each = local.deployments
zone_id = data.cloudflare_zone.domain.zone_id
name = "${each.value.subdomain}.${var.cloudflare_domain}"
content = google_compute_address.coder[each.key].address
type = "A"
ttl = 3600
}
resource "cloudflare_record" "coder_wildcard" {
for_each = local.deployments
zone_id = data.cloudflare_zone.domain.id
name = each.value.wildcard_subdomain
content = cloudflare_record.coder[each.key].name
type = "CNAME"
ttl = 3600
}