1
0
Fork 0
home-stack-kustomize/terraform/modules/cloudflare_site/main.tf

26 lines
654 B
Terraform
Raw Permalink Normal View History

2024-02-17 06:41:51 +00:00
terraform {
required_providers {
cloudflare = {
source = "cloudflare/cloudflare"
version = "~> 4.0"
}
}
}
data "cloudflare_zone" "zone" {
name = var.dns_zone
}
resource "cloudflare_record" "records" {
count = length(var.dns_records)
zone_id = data.cloudflare_zone.zone.zone_id
name = var.dns_records[count.index].name
type = var.dns_records[count.index].type
value = var.dns_records[count.index].value
ttl = lookup(var.dns_records[count.index], "ttl", null)
priority = lookup(var.dns_records[count.index], "priority", null)
proxied = lookup(var.dns_records[count.index], "proxied", true)
}