@pulumi/digitalocean
Version:
A Pulumi package for creating and managing DigitalOcean cloud resources.
78 lines • 2.64 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.getRecordsOutput = exports.getRecords = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* 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);
* ```
*/
function getRecords(args, opts) {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("digitalocean:index/getRecords:getRecords", {
"domain": args.domain,
"filters": args.filters,
"sorts": args.sorts,
}, opts);
}
exports.getRecords = getRecords;
/**
* 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);
* ```
*/
function getRecordsOutput(args, opts) {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invokeOutput("digitalocean:index/getRecords:getRecords", {
"domain": args.domain,
"filters": args.filters,
"sorts": args.sorts,
}, opts);
}
exports.getRecordsOutput = getRecordsOutput;
//# sourceMappingURL=getRecords.js.map