UNPKG

@pulumi/digitalocean

Version:

A Pulumi package for creating and managing DigitalOcean cloud resources.

205 lines (204 loc) 7.36 kB
import * as pulumi from "@pulumi/pulumi"; import * as enums from "./types/enums"; /** * Provides a DigitalOcean DNS record resource. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as digitalocean from "@pulumi/digitalocean"; * * const _default = new digitalocean.Domain("default", {name: "example.com"}); * // Add an A record to the domain for www.example.com. * const www = new digitalocean.DnsRecord("www", { * domain: _default.id, * type: digitalocean.RecordType.A, * name: "www", * value: "192.168.0.11", * }); * // Add a MX record for the example.com domain itself. * const mx = new digitalocean.DnsRecord("mx", { * domain: _default.id, * type: digitalocean.RecordType.MX, * name: "@", * priority: 10, * value: "mail.example.com.", * }); * export const wwwFqdn = www.fqdn; * export const mxFqdn = mx.fqdn; * ``` * * ## Import * * Records can be imported using the domain name and record `id` when joined with a comma. See the following example: * * ```sh * $ pulumi import digitalocean:index/dnsRecord:DnsRecord example_record example.com,12345678 * ``` * * ~> You find the `id` of the records [using the DigitalOcean API](https://docs.digitalocean.com/reference/api/digitalocean/#tag/Domain-Records/operation/domains_list_records) or CLI. Run the follow command to list the IDs for all DNS records on a domain: `doctl compute domain records list <domain.name>` */ export declare class DnsRecord extends pulumi.CustomResource { /** * Get an existing DnsRecord resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: DnsRecordState, opts?: pulumi.CustomResourceOptions): DnsRecord; /** * Returns true if the given object is an instance of DnsRecord. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is DnsRecord; /** * The domain to add the record to. */ readonly domain: pulumi.Output<string>; /** * The flags of the record. Only valid when type is `CAA`. Must be between 0 and 255. */ readonly flags: pulumi.Output<number | undefined>; /** * The FQDN of the record */ readonly fqdn: pulumi.Output<string>; /** * The hostname of the record. Use `@` for records on domain's name itself. */ readonly name: pulumi.Output<string>; /** * The port of the record. Only valid when type is `SRV`. Must be between 1 and 65535. */ readonly port: pulumi.Output<number | undefined>; /** * The priority of the record. Only valid when type is `MX` or `SRV`. Must be between 0 and 65535. */ readonly priority: pulumi.Output<number | undefined>; /** * The tag of the record. Only valid when type is `CAA`. Must be one of `issue`, `issuewild`, or `iodef`. */ readonly tag: pulumi.Output<string | undefined>; /** * The time to live for the record, in seconds. Must be at least 0. Defaults to 1800. */ readonly ttl: pulumi.Output<number>; /** * The type of record. Must be one of `A`, `AAAA`, `CAA`, `CNAME`, `MX`, `NS`, `TXT`, or `SRV`. */ readonly type: pulumi.Output<string>; /** * The value of the record. */ readonly value: pulumi.Output<string>; /** * The weight of the record. Only valid when type is `SRV`. Must be between 0 and 65535. */ readonly weight: pulumi.Output<number | undefined>; /** * Create a DnsRecord resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: DnsRecordArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering DnsRecord resources. */ export interface DnsRecordState { /** * The domain to add the record to. */ domain?: pulumi.Input<string>; /** * The flags of the record. Only valid when type is `CAA`. Must be between 0 and 255. */ flags?: pulumi.Input<number>; /** * The FQDN of the record */ fqdn?: pulumi.Input<string>; /** * The hostname of the record. Use `@` for records on domain's name itself. */ name?: pulumi.Input<string>; /** * The port of the record. Only valid when type is `SRV`. Must be between 1 and 65535. */ port?: pulumi.Input<number>; /** * The priority of the record. Only valid when type is `MX` or `SRV`. Must be between 0 and 65535. */ priority?: pulumi.Input<number>; /** * The tag of the record. Only valid when type is `CAA`. Must be one of `issue`, `issuewild`, or `iodef`. */ tag?: pulumi.Input<string>; /** * The time to live for the record, in seconds. Must be at least 0. Defaults to 1800. */ ttl?: pulumi.Input<number>; /** * The type of record. Must be one of `A`, `AAAA`, `CAA`, `CNAME`, `MX`, `NS`, `TXT`, or `SRV`. */ type?: pulumi.Input<string | enums.RecordType>; /** * The value of the record. */ value?: pulumi.Input<string>; /** * The weight of the record. Only valid when type is `SRV`. Must be between 0 and 65535. */ weight?: pulumi.Input<number>; } /** * The set of arguments for constructing a DnsRecord resource. */ export interface DnsRecordArgs { /** * The domain to add the record to. */ domain: pulumi.Input<string>; /** * The flags of the record. Only valid when type is `CAA`. Must be between 0 and 255. */ flags?: pulumi.Input<number>; /** * The hostname of the record. Use `@` for records on domain's name itself. */ name?: pulumi.Input<string>; /** * The port of the record. Only valid when type is `SRV`. Must be between 1 and 65535. */ port?: pulumi.Input<number>; /** * The priority of the record. Only valid when type is `MX` or `SRV`. Must be between 0 and 65535. */ priority?: pulumi.Input<number>; /** * The tag of the record. Only valid when type is `CAA`. Must be one of `issue`, `issuewild`, or `iodef`. */ tag?: pulumi.Input<string>; /** * The time to live for the record, in seconds. Must be at least 0. Defaults to 1800. */ ttl?: pulumi.Input<number>; /** * The type of record. Must be one of `A`, `AAAA`, `CAA`, `CNAME`, `MX`, `NS`, `TXT`, or `SRV`. */ type: pulumi.Input<string | enums.RecordType>; /** * The value of the record. */ value: pulumi.Input<string>; /** * The weight of the record. Only valid when type is `SRV`. Must be between 0 and 65535. */ weight?: pulumi.Input<number>; }