پرش به مطلب اصلی

arvancloud_cdn_domain_dns_record (Resource)

Domain's DNS Record.

Example Usage

resource "arvancloud_cdn_domain_dns_record " "a-example" {
domain = "cdn-terraform.ir"
name = "a-terraform"
ttl = 120
cloud = true
upstream_https = "https"
ip_filter_mode = {
count = "single"
order = "none"
geo_filter = "none"
}
type = "a"
value = {
a = [
{
ip = "1.1.1.1"
port = 1001
},
{
ip = "1.1.1.2"
weight = 101
}
]
}
}

resource "arvancloud_cdn_domain_dns_record " "aaaa-example" {
domain = "cdn-terraform.ir"
name = "aaaa-terraform"
ttl = 120
cloud = true
upstream_https = "https"
ip_filter_mode = {
count = "single"
order = "none"
geo_filter = "none"
}
type = "aaaa"
value = {
aaaa = [
{
ip = "2345:0425:2CA1:0000:0000:0567:5673:23B6"
port = 1001
},
{
ip = "2345:0425:2CA1:0000:0000:0567:5673:23b5"
weight = 101
}
]
}
}

resource "arvancloud_cdn_domain_dns_record " "cname-example" {
domain = "cdn-terraform.ir"
name = "cname-terraform"
ttl = 120
cloud = true
upstream_https = "https"
ip_filter_mode = {
count = "single"
order = "none"
geo_filter = "none"
}
type = "cname"
value = {
cname = {
host = "some-host.ir."
host_header = "source"
port = 443
upstream_https = "https"
ip_filter_mode = {
count = "single"
order = "none"
geo_filter = "none"
}
type = "txt"
value = {
txt = {
text = "some text"
}
}
}
}
}


resource "arvancloud_cdn_domain_dns_record " "aname-example" {
domain = "cdn-terraform.ir"
name = "aname-terraform"
ttl = 120
cloud = true
upstream_https = "https"
ip_filter_mode = {
count = "single"
order = "none"
geo_filter = "none"
}
type = "aname"
value = {
aname = {
location = "some-host.ir."
host_header = "source"
port = 443
}
}
}

resource "arvancloud_cdn_domain_dns_record " "txt-example" {
domain = "cdn-terraform.ir"
name = "txt-terraform"
ttl = 120
cloud = true
}

Schema

Required

  • cloud (Boolean) Whether this record is managed by Arvancloud.
  • domain (String) UUID or the name of the domain.
  • name (String) The name of the record.
  • ttl (Number)
  • type (String) The type of DNS record. Valid values are: a, aaaa, aname, cname, caa, dkim, spf, txt, tlsa, mx, ns, ptr, srv.
  • value (Attributes) The record value based on its type. (see below for nested schema)

Optional

  • id (String) UUID of the DNS record.
  • ip_filter_mode (Attributes) IP filter mode configuration. (see below for nested schema)
  • upstream_https (String) HTTPS configuration for the upstream server.

Read-Only

  • is_protected (Boolean) Whether this record is protected.
  • last_updated (String) Timestamp of the last update.

Nested Schema for value

Optional:

Nested Schema for value.a

Required:

  • ip (String) IPv4 address.

Optional:

  • country (String) Country code for geo-routing.
  • port (Number) Port number.
  • weight (Number) Weight for load balancing.

Nested Schema for value.aaaa

Required:

  • ip (String) IPv6 address.

Optional:

  • country (String) Country code for geo-routing.
  • port (Number) Port number.
  • weight (Number) Weight for load balancing.

Nested Schema for value.aname

Required:

  • host_header (String) Host header value.
  • location (String) Target location.

Optional:

  • port (Number) Port number.

Nested Schema for value.caa

Optional:

  • tag (String) CAA tag.
  • value (String) CAA value.

Nested Schema for value.cname

Required:

  • host (String) Target hostname.
  • host_header (String) Host header value.

Optional:

  • port (Number) Port number.

Nested Schema for value.dkim

Required:

  • text (String) DKIM record content.

Nested Schema for value.mx

Required:

  • host (String) Mail exchange server hostname.
  • priority (Number) Priority for mail exchange server.

Nested Schema for value.ns

Required:

  • host (String) Name server hostname.

Nested Schema for value.ptr

Required:

  • domain (String) Domain name for reverse lookup.

Nested Schema for value.spf

Required:

  • text (String) SPF record content.

Nested Schema for value.srv

Required:

  • target (String) Target hostname.

Optional:

  • port (Number) Target port.
  • priority (Number) Priority of the target host.
  • weight (Number) Relative weight for records with the same priority.

Nested Schema for value.tlsa

Required:

  • certificate (String) TLSA certificate data.
  • matching_type (String) TLSA matching type field.
  • selector (String) TLSA selector field.
  • usage (String) TLSA usage field.

Nested Schema for value.txt

Required:

  • text (String) TXT record content.

Nested Schema for ip_filter_mode

Optional:

  • count (String) Count mode for IP filtering.
  • geo_filter (String) Geo filter mode.
  • order (String) Order mode for IP filtering.

Import

Import is supported using the following syntax:

terraform import arvancloud_cdn_domain_dns_record.example cdn-terraform.ir,1a700f5a-acef-4786-9192-4960dcf18449