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.
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
optional
Whether to include shadow metadata in the meta field of each record in the response. See Shadowed records.
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"
include_shadow_metadata = true
}
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.
Filters to records at or below the given NS delegation name, excluding the NS records that form the delegation itself. The value must be a subdomain of the zone; the zone apex is not accepted. Requires include_shadow_metadata=true. See Shadowed records.
Returns NS records that shadow the given name, searching at the name itself and each of its ancestor names within the zone, excluding the zone apex. The value must be a subdomain of the zone; the zone apex is not accepted. See Shadowed records.
Whether to include shadow metadata in the meta field of each record in the response. See Shadowed records.
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"
shadowed_by_name = "sub.example.com"
shadowing_name = "www.sub.example.com"
tag = {
absent = "important"
contains = "greeting:ello, worl"
endswith = "greeting:o, world"
exact = "greeting:Hello, world"
present = "important"
startswith = "greeting:Hello, w"
}
type = "A"
}