digitalocean_record

Get information on a DNS record. This data source provides the name, TTL, and zone file as configured on your DigitalOcean account. This is useful if the record in question is not managed by Terraform.

An error is triggered if the provided domain name or record are not managed with your DigitalOcean account.

Example Usage

Get data from a DNS record:

data "digitalocean_record" "example" {
  domain = "example.com"
  name   = "test"
}

output "record_type" {
  value = data.digitalocean_record.example.type
}

output "record_ttl" {
  value = data.digitalocean_record.example.ttl
}
  $ terraform apply

data.digitalocean_record.example: Refreshing state...

Apply complete! Resources: 0 added, 0 changed, 0 destroyed.

Outputs:

record_ttl = 3600
record_type = A

Argument Reference

The following arguments are supported:

Attributes Reference

The following attributes are exported: