UNPKG

@pulumi/digitalocean

Version:

A Pulumi package for creating and managing DigitalOcean cloud resources.

112 lines (111 loc) 3.31 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * Retrieve information about all DNS records within a domain, with the ability to filter and sort the results. * If no filters are specified, all records will be returned. * * ## Example Usage * * Get data for all MX records in a domain: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as digitalocean from "@pulumi/digitalocean"; * import * as std from "@pulumi/std"; * * const example = digitalocean.getRecords({ * domain: "example.com", * filters: [{ * key: "type", * values: ["MX"], * }], * }); * export const mailServers = example.then(example => std.join({ * separator: ",", * input: example.records.map(__item => __item.value), * })).then(invoke => invoke.result); * ``` */ export declare function getRecords(args: GetRecordsArgs, opts?: pulumi.InvokeOptions): Promise<GetRecordsResult>; /** * A collection of arguments for invoking getRecords. */ export interface GetRecordsArgs { /** * The domain name to search for DNS records */ domain: string; /** * Filter the results. * The `filter` block is documented below. */ filters?: inputs.GetRecordsFilter[]; /** * Sort the results. * The `sort` block is documented below. */ sorts?: inputs.GetRecordsSort[]; } /** * A collection of values returned by getRecords. */ export interface GetRecordsResult { /** * Domain of the DNS record. */ readonly domain: string; readonly filters?: outputs.GetRecordsFilter[]; /** * The provider-assigned unique ID for this managed resource. */ readonly id: string; readonly records: outputs.GetRecordsRecord[]; readonly sorts?: outputs.GetRecordsSort[]; } /** * Retrieve information about all DNS records within a domain, with the ability to filter and sort the results. * If no filters are specified, all records will be returned. * * ## Example Usage * * Get data for all MX records in a domain: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as digitalocean from "@pulumi/digitalocean"; * import * as std from "@pulumi/std"; * * const example = digitalocean.getRecords({ * domain: "example.com", * filters: [{ * key: "type", * values: ["MX"], * }], * }); * export const mailServers = example.then(example => std.join({ * separator: ",", * input: example.records.map(__item => __item.value), * })).then(invoke => invoke.result); * ``` */ export declare function getRecordsOutput(args: GetRecordsOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetRecordsResult>; /** * A collection of arguments for invoking getRecords. */ export interface GetRecordsOutputArgs { /** * The domain name to search for DNS records */ domain: pulumi.Input<string>; /** * Filter the results. * The `filter` block is documented below. */ filters?: pulumi.Input<pulumi.Input<inputs.GetRecordsFilterArgs>[]>; /** * Sort the results. * The `sort` block is documented below. */ sorts?: pulumi.Input<pulumi.Input<inputs.GetRecordsSortArgs>[]>; }