DnsRecord

class DnsRecord : KotlinCustomResource

Provides a DigitalOcean DNS record resource.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.digitalocean.Domain;
import com.pulumi.digitalocean.DomainArgs;
import com.pulumi.digitalocean.DnsRecord;
import com.pulumi.digitalocean.DnsRecordArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var default_ = new Domain("default", DomainArgs.builder()
.name("example.com")
.build());
var www = new DnsRecord("www", DnsRecordArgs.builder()
.domain(default_.id())
.type("A")
.value("192.168.0.11")
.build());
var mx = new DnsRecord("mx", DnsRecordArgs.builder()
.domain(default_.id())
.type("MX")
.priority(10)
.value("mail.example.com.")
.build());
ctx.export("wwwFqdn", www.fqdn());
ctx.export("mxFqdn", mx.fqdn());
}
}

Import

Records can be imported using the domain name and record id when joined with a comma. See the following example

$ pulumi import digitalocean:index/dnsRecord:DnsRecord example_record example.com,12345678

~> You find the id of the records using the DigitalOcean API or CLI. Run the follow command to list the IDs for all DNS records on a domaindoctl compute domain records list <domain.name>

Properties

Link copied to clipboard
val domain: Output<String>

The domain to add the record to.

Link copied to clipboard
val flags: Output<Int>?

The flags of the record. Only valid when type is CAA. Must be between 0 and 255.

Link copied to clipboard
val fqdn: Output<String>

The FQDN of the record

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val name: Output<String>

The hostname of the record. Use @ for records on domain's name itself.

Link copied to clipboard
val port: Output<Int>?

The port of the record. Only valid when type is SRV. Must be between 1 and 65535.

Link copied to clipboard
val priority: Output<Int>?

The priority of the record. Only valid when type is MX or SRV. Must be between 0 and 65535.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val tag: Output<String>?

The tag of the record. Only valid when type is CAA. Must be one of issue, issuewild, or iodef.

Link copied to clipboard
val ttl: Output<Int>

The time to live for the record, in seconds. Must be at least 0. Defaults to 1800.

Link copied to clipboard
val type: Output<String>

The type of record. Must be one of A, AAAA, CAA, CNAME, MX, NS, TXT, or SRV.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val value: Output<String>

The value of the record.

Link copied to clipboard
val weight: Output<Int>?

The weight of the record. Only valid when type is SRV. Must be between 0 and 65535.