25 lines
417 B
Terraform
25 lines
417 B
Terraform
|
terraform {
|
||
|
required_providers {
|
||
|
cloudflare = {
|
||
|
source = "cloudflare/cloudflare"
|
||
|
version = "~> 3.0"
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
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
|
||
|
}
|
||
|
|
||
|
|