@pulumi/digitalocean
Version:
A Pulumi package for creating and managing DigitalOcean cloud resources.
82 lines • 3.03 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.getDomainsOutput = exports.getDomains = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Get information on domains for use in other resources, with the ability to filter and sort the results.
* If no filters are specified, all domains will be returned.
*
* This data source is useful if the domains in question are not managed by this provider or you need to
* utilize any of the domains' data.
*
* Note: You can use the `digitalocean.Domain` data source to obtain metadata
* about a single domain if you already know the `name`.
*
* ## Example Usage
*
* Use the `filter` block with a `key` string and `values` list to filter domains. (This example
* also uses the regular expression `matchBy` mode in order to match domains by suffix.)
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as digitalocean from "@pulumi/digitalocean";
*
* const examples = digitalocean.getDomains({
* filters: [{
* key: "name",
* values: ["example\\.com$"],
* matchBy: "re",
* }],
* });
* ```
*/
function getDomains(args, opts) {
args = args || {};
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("digitalocean:index/getDomains:getDomains", {
"filters": args.filters,
"sorts": args.sorts,
}, opts);
}
exports.getDomains = getDomains;
/**
* Get information on domains for use in other resources, with the ability to filter and sort the results.
* If no filters are specified, all domains will be returned.
*
* This data source is useful if the domains in question are not managed by this provider or you need to
* utilize any of the domains' data.
*
* Note: You can use the `digitalocean.Domain` data source to obtain metadata
* about a single domain if you already know the `name`.
*
* ## Example Usage
*
* Use the `filter` block with a `key` string and `values` list to filter domains. (This example
* also uses the regular expression `matchBy` mode in order to match domains by suffix.)
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as digitalocean from "@pulumi/digitalocean";
*
* const examples = digitalocean.getDomains({
* filters: [{
* key: "name",
* values: ["example\\.com$"],
* matchBy: "re",
* }],
* });
* ```
*/
function getDomainsOutput(args, opts) {
args = args || {};
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invokeOutput("digitalocean:index/getDomains:getDomains", {
"filters": args.filters,
"sorts": args.sorts,
}, opts);
}
exports.getDomainsOutput = getDomainsOutput;
//# sourceMappingURL=getDomains.js.map