Resource
dcloud_dns_record
One record set (name + type) in a hosted zone.
Example Usage
resource "dcloud_dns_record" "www" {
zone_id = dcloud_dns_zone.acme.id
name = "www"
type = "A"
ttl = 300
values = ["192.0.2.10"]
}
# An ALIAS follows an app's address.
resource "dcloud_dns_record" "apex" {
zone_id = dcloud_dns_zone.acme.id
name = "@"
type = "ALIAS"
app_id = dcloud_app.web.id
}Schema
Required
name(String) Name relative to the zone (www,@for the apex) or fully qualified. Changing it replaces the resource.type(String) Record type. ALIAS is the platform type that answers with the address of an app, load balancer, bucket website or CDN distribution. Writing a set replaces the one at the same name and type One of:A,AAAA,CNAME,MX,TXT,NS,SRV,CAA,ALIAS. Changing it replaces the resource.zone_id(String) The id of the parent resource ({id}in the path). Changing it replaces the resource.
Optional
app_id(String) For anALIASrecord: the app whose address it follows.bucket(String) ALIAS: a bucket name; the name answers with the bucket's static websitedistribution_id(String) For anALIASrecord: the CDN distribution whose edge nodes answer it (the zone apex, where a CNAME cannot be). List the name among the distribution'saliasestoo, for its certificate.failover_values(List of String) Answered instead of values while the health check is downhealth_check_id(String) A, AAAA, CNAME: an uptime check; null removes it. A UUID.load_balancer_id(String) ALIAS: a load balancer, answered with its IPv4 (A) and IPv6 (AAAA). A UUID.routing(String) Weighted ({policy:"weighted", variants:[{id, weight 0-255, values, healthCheckId?}]}) or geolocation ({policy:"geo", variants:[{id, country|continent, values, healthCheckId?}]}) routing; null removes it. For geo, values are the default answer.ttl(Number) Seconds resolvers may cache the set, 1 to 604800. Absent: 300 in the API (the console form starts at 3600). A set with a health check or routed variant checks is served with at most 60. From 1 to 604800.values(List of String) The record data in presentation format, one entry per value, at most 100 of at most 4096 characters each: A "203.0.113.7", MX "10 mail.example.com", SRV "10 5 5060 sip.example.com", CAA "0 issue letsencrypt.org", TXT the text. Duplicates are merged. A CNAME takes exactly one. Required (400 "At least one value is required") unless the type is ALIAS or routing supplies them, when a routed set takes the first variant's values
Read-Only
fqdn(String) The fully qualified name.id(String) The resource's id.
Import
Import is supported using the following syntax:
The terraform import command can be used, for example:
# After an import, name is the stored fully qualified name.
terraform import dcloud_dns_record.www <zone-id>/<record-id>Generated from the provider's schema.
Related