DnsRecordArgs

data class DnsRecordArgs(val domain: Output<String>? = null, val flags: Output<Int>? = null, val name: Output<String>? = null, val port: Output<Int>? = null, val priority: Output<Int>? = null, val tag: Output<String>? = null, val ttl: Output<Int>? = null, val type: Output<Either<String, RecordType>>? = null, val value: Output<String>? = null, val weight: Output<Int>? = null) : ConvertibleToJava<DnsRecordArgs>

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>

Constructors

Link copied to clipboard
fun DnsRecordArgs(domain: Output<String>? = null, flags: Output<Int>? = null, name: Output<String>? = null, port: Output<Int>? = null, priority: Output<Int>? = null, tag: Output<String>? = null, ttl: Output<Int>? = null, type: Output<Either<String, RecordType>>? = null, value: Output<String>? = null, weight: Output<Int>? = null)

Functions

Link copied to clipboard
open override fun toJava(): DnsRecordArgs

Properties

Link copied to clipboard
val domain: Output<String>? = null

The domain to add the record to.

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

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

Link copied to clipboard
val name: Output<String>? = null

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

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

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>? = null

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

Link copied to clipboard
val tag: Output<String>? = null

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>? = null

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

Link copied to clipboard
val type: Output<Either<String, RecordType>>? = null

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

Link copied to clipboard
val value: Output<String>? = null

The value of the record.

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

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