Records
resource cloudflare_dns_record
required
optional
Required for MX and URI records; ignored for other record types (but may still be returned by the API). Records with lower priorities are preferred. This field is to be deprecated in favor of the priority field within the data map.
computed
cloudflare_dns_record
resource "cloudflare_dns_record" "example_dns_record" {
zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
name = "example.com"
ttl = 3600
type = "A"
comment = "Domain verification record"
content = "198.51.100.4"
private_routing = true
proxied = true
settings = {
ipv4_only = true
ipv6_only = true
}
tags = ["owner:dns-team"]
}
data cloudflare_dns_record
computed
Required for MX and URI records; ignored for other record types (but may still be returned by the API). Records with lower priorities are preferred. This field is to be deprecated in favor of the priority field within the data map.
cloudflare_dns_record
data "cloudflare_dns_record" "example_dns_record" {
zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
dns_record_id = "023e105f4ecef8ad9ca31a8372d0c353"
}
data cloudflare_dns_records
optional
Allows searching in multiple properties of a DNS record simultaneously. This parameter is intended for human users, not automation. Its exact behavior is intentionally left unspecified and is subject to change in the future. This parameter works independently of the match setting. For automated searches, please use the other available parameters.
Whether to match all search requirements or at least one (any). If set to all, acts like a logical AND between filters. If set to any, acts like a logical OR instead. Note that the interaction between tag filters is controlled by the tag-match parameter instead.
Whether to match all tag search requirements or at least one (any). If set to all, acts like a logical AND between tag filters. If set to any, acts like a logical OR instead. Note that the regular match parameter is still used to combine the resulting condition with other filters that aren't related to tags.
cloudflare_dns_records
data "cloudflare_dns_records" "example_dns_records" {
zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
comment = {
absent = "absent"
contains = "ello, worl"
endswith = "o, world"
exact = "Hello, world"
present = "present"
startswith = "Hello, w"
}
content = {
contains = "7.0.0."
endswith = ".0.1"
exact = "127.0.0.1"
startswith = "127.0."
}
name = {
contains = "w.example."
endswith = ".example.com"
exact = "www.example.com"
startswith = "www.example"
}
search = "www.cloudflare.com"
tag = {
absent = "important"
contains = "greeting:ello, worl"
endswith = "greeting:o, world"
exact = "greeting:Hello, world"
present = "important"
startswith = "greeting:Hello, w"
}
type = "A"
}