@pulumi/digitalocean
Version:
A Pulumi package for creating and managing DigitalOcean cloud resources.
154 lines (153 loc) • 4.5 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* Retrieve information about all DigitalOcean projects associated with an account, with
* the ability to filter and sort the results. If no filters are specified, all projects
* will be returned.
*
* Note: You can use the `digitalocean.Project` data source to
* obtain metadata about a single project if you already know the `id` to retrieve or the unique
* `name` of the project.
*
* ## Example Usage
*
* Use the `filter` block with a `key` string and `values` list to filter projects.
*
* For example to find all staging environment projects:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as digitalocean from "@pulumi/digitalocean";
*
* const staging = digitalocean.getProjects({
* filters: [{
* key: "environment",
* values: ["Staging"],
* }],
* });
* ```
*
* 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 non_default_production = digitalocean.getProjects({
* filters: [
* {
* key: "environment",
* values: ["Production"],
* },
* {
* key: "is_default",
* values: ["false"],
* },
* ],
* sorts: [{
* key: "name",
* direction: "asc",
* }],
* });
* ```
*/
export declare function getProjects(args?: GetProjectsArgs, opts?: pulumi.InvokeOptions): Promise<GetProjectsResult>;
/**
* A collection of arguments for invoking getProjects.
*/
export interface GetProjectsArgs {
/**
* Filter the results.
* The `filter` block is documented below.
*/
filters?: inputs.GetProjectsFilter[];
/**
* Sort the results.
* The `sort` block is documented below.
*/
sorts?: inputs.GetProjectsSort[];
}
/**
* A collection of values returned by getProjects.
*/
export interface GetProjectsResult {
readonly filters?: outputs.GetProjectsFilter[];
/**
* The provider-assigned unique ID for this managed resource.
*/
readonly id: string;
/**
* A set of projects satisfying any `filter` and `sort` criteria. Each project has
* the following attributes:
*/
readonly projects: outputs.GetProjectsProject[];
readonly sorts?: outputs.GetProjectsSort[];
}
/**
* Retrieve information about all DigitalOcean projects associated with an account, with
* the ability to filter and sort the results. If no filters are specified, all projects
* will be returned.
*
* Note: You can use the `digitalocean.Project` data source to
* obtain metadata about a single project if you already know the `id` to retrieve or the unique
* `name` of the project.
*
* ## Example Usage
*
* Use the `filter` block with a `key` string and `values` list to filter projects.
*
* For example to find all staging environment projects:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as digitalocean from "@pulumi/digitalocean";
*
* const staging = digitalocean.getProjects({
* filters: [{
* key: "environment",
* values: ["Staging"],
* }],
* });
* ```
*
* 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 non_default_production = digitalocean.getProjects({
* filters: [
* {
* key: "environment",
* values: ["Production"],
* },
* {
* key: "is_default",
* values: ["false"],
* },
* ],
* sorts: [{
* key: "name",
* direction: "asc",
* }],
* });
* ```
*/
export declare function getProjectsOutput(args?: GetProjectsOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetProjectsResult>;
/**
* A collection of arguments for invoking getProjects.
*/
export interface GetProjectsOutputArgs {
/**
* Filter the results.
* The `filter` block is documented below.
*/
filters?: pulumi.Input<pulumi.Input<inputs.GetProjectsFilterArgs>[]>;
/**
* Sort the results.
* The `sort` block is documented below.
*/
sorts?: pulumi.Input<pulumi.Input<inputs.GetProjectsSortArgs>[]>;
}