UNPKG

@pulumi/digitalocean

Version:

A Pulumi package for creating and managing DigitalOcean cloud resources.

121 lines (120 loc) 3.62 kB
import * as pulumi from "@pulumi/pulumi"; /** * 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 the provider. * * 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: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as digitalocean from "@pulumi/digitalocean"; * * const example = digitalocean.getRecord({ * domain: "example.com", * name: "test", * }); * export const recordType = example.then(example => example.type); * export const recordTtl = example.then(example => example.ttl); * ``` */ export declare function getRecord(args: GetRecordArgs, opts?: pulumi.InvokeOptions): Promise<GetRecordResult>; /** * A collection of arguments for invoking getRecord. */ export interface GetRecordArgs { /** * The domain name of the record. */ domain: string; /** * The name of the record. */ name: string; } /** * A collection of values returned by getRecord. */ export interface GetRecordResult { /** * Variable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the domain name of the CA being granted permission to issue certificates. */ readonly data: string; readonly domain: string; /** * An unsigned integer between 0-255 used for CAA records. */ readonly flags: number; /** * The provider-assigned unique ID for this managed resource. */ readonly id: string; readonly name: string; /** * The port for SRV records. */ readonly port: number; /** * The priority for SRV and MX records. */ readonly priority: number; /** * The parameter tag for CAA records. */ readonly tag: string; /** * This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested. */ readonly ttl: number; /** * The type of the DNS record. */ readonly type: string; /** * The weight for SRV records. */ readonly weight: number; } /** * 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 the provider. * * 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: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as digitalocean from "@pulumi/digitalocean"; * * const example = digitalocean.getRecord({ * domain: "example.com", * name: "test", * }); * export const recordType = example.then(example => example.type); * export const recordTtl = example.then(example => example.ttl); * ``` */ export declare function getRecordOutput(args: GetRecordOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetRecordResult>; /** * A collection of arguments for invoking getRecord. */ export interface GetRecordOutputArgs { /** * The domain name of the record. */ domain: pulumi.Input<string>; /** * The name of the record. */ name: pulumi.Input<string>; }