@pulumi/digitalocean
Version:
A Pulumi package for creating and managing DigitalOcean cloud resources.
149 lines (148 loc) • 4.3 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* Retrieve information about all supported DigitalOcean regions, with the ability to
* filter and sort the results. If no filters are specified, all regions will be returned.
*
* Note: You can use the `digitalocean.getRegion` data source
* to obtain metadata about a single region if you already know the `slug` to retrieve.
*
* ## Example Usage
*
* Use the `filter` block with a `key` string and `values` list to filter regions.
*
* For example to find all available regions:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as digitalocean from "@pulumi/digitalocean";
*
* const available = digitalocean.getRegions({
* filters: [{
* key: "available",
* values: ["true"],
* }],
* });
* ```
*
* You can filter on multiple fields and sort the results as well:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as digitalocean from "@pulumi/digitalocean";
*
* const available = digitalocean.getRegions({
* filters: [
* {
* key: "available",
* values: ["true"],
* },
* {
* key: "features",
* values: ["private_networking"],
* },
* ],
* sorts: [{
* key: "name",
* direction: "desc",
* }],
* });
* ```
*/
export declare function getRegions(args?: GetRegionsArgs, opts?: pulumi.InvokeOptions): Promise<GetRegionsResult>;
/**
* A collection of arguments for invoking getRegions.
*/
export interface GetRegionsArgs {
/**
* Filter the results.
* The `filter` block is documented below.
*/
filters?: inputs.GetRegionsFilter[];
/**
* Sort the results.
* The `sort` block is documented below.
*/
sorts?: inputs.GetRegionsSort[];
}
/**
* A collection of values returned by getRegions.
*/
export interface GetRegionsResult {
readonly filters?: outputs.GetRegionsFilter[];
/**
* The provider-assigned unique ID for this managed resource.
*/
readonly id: string;
/**
* A set of regions satisfying any `filter` and `sort` criteria. Each region has the following attributes:
*/
readonly regions: outputs.GetRegionsRegion[];
readonly sorts?: outputs.GetRegionsSort[];
}
/**
* Retrieve information about all supported DigitalOcean regions, with the ability to
* filter and sort the results. If no filters are specified, all regions will be returned.
*
* Note: You can use the `digitalocean.getRegion` data source
* to obtain metadata about a single region if you already know the `slug` to retrieve.
*
* ## Example Usage
*
* Use the `filter` block with a `key` string and `values` list to filter regions.
*
* For example to find all available regions:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as digitalocean from "@pulumi/digitalocean";
*
* const available = digitalocean.getRegions({
* filters: [{
* key: "available",
* values: ["true"],
* }],
* });
* ```
*
* You can filter on multiple fields and sort the results as well:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as digitalocean from "@pulumi/digitalocean";
*
* const available = digitalocean.getRegions({
* filters: [
* {
* key: "available",
* values: ["true"],
* },
* {
* key: "features",
* values: ["private_networking"],
* },
* ],
* sorts: [{
* key: "name",
* direction: "desc",
* }],
* });
* ```
*/
export declare function getRegionsOutput(args?: GetRegionsOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetRegionsResult>;
/**
* A collection of arguments for invoking getRegions.
*/
export interface GetRegionsOutputArgs {
/**
* Filter the results.
* The `filter` block is documented below.
*/
filters?: pulumi.Input<pulumi.Input<inputs.GetRegionsFilterArgs>[]>;
/**
* Sort the results.
* The `sort` block is documented below.
*/
sorts?: pulumi.Input<pulumi.Input<inputs.GetRegionsSortArgs>[]>;
}