2022-05-08 15:51:41 +02:00
|
|
|
terraform {
|
|
|
|
required_providers {
|
|
|
|
cloudflare = {
|
|
|
|
source = "cloudflare/cloudflare"
|
2023-02-28 18:04:34 +01:00
|
|
|
version = "~> 4.0"
|
2022-05-08 15:51:41 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
provider "cloudflare" {
|
|
|
|
api_token = var.api_token
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "cloudflare_record" "exact" {
|
|
|
|
zone_id = var.zone_id
|
|
|
|
for_each = { for record in var.records : record.name => record }
|
|
|
|
|
|
|
|
name = each.value.name
|
|
|
|
value = each.value.ip
|
|
|
|
type = each.value.ip_type
|
|
|
|
ttl = 3600
|
|
|
|
}
|
|
|
|
|
|
|
|
|