GetProjects
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
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
var staging = Output.Create(DigitalOcean.GetProjects.InvokeAsync(new DigitalOcean.GetProjectsArgs
{
Filters =
{
new DigitalOcean.Inputs.GetProjectsFilterArgs
{
Key = "environment",
Values =
{
"Staging",
},
},
},
}));
}
}
Coming soon!
import pulumi
import pulumi_digitalocean as digitalocean
staging = digitalocean.get_projects(filters=[{
"key": "environment",
"values": ["Staging"],
}])import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";
const staging = pulumi.output(digitalocean.getProjects({
filters: [{
key: "environment",
values: ["Staging"],
}],
}, { async: true }));Using GetProjects
function getProjects(args: GetProjectsArgs, opts?: InvokeOptions): Promise<GetProjectsResult>function get_projects(filters=None, sorts=None, opts=None)func GetProjects(ctx *Context, args *GetProjectsArgs, opts ...InvokeOption) (*GetProjectsResult, error)public static class GetProjects {
public static Task<GetProjectsResult> InvokeAsync(GetProjectsArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
- Filters
List<Pulumi.
Digital Ocean. Inputs. Get Projects Filter Args> Filter the results. The
filterblock is documented below.- Sorts
List<Pulumi.
Digital Ocean. Inputs. Get Projects Sort Args> Sort the results. The
sortblock is documented below.
- Filters
[]Get
Projects Filter Filter the results. The
filterblock is documented below.- Sorts
[]Get
Projects Sort Sort the results. The
sortblock is documented below.
- filters
Get
Projects Filter[] Filter the results. The
filterblock is documented below.- sorts
Get
Projects Sort[] Sort the results. The
sortblock is documented below.
- filters
List[Get
Projects Filter] Filter the results. The
filterblock is documented below.- sorts
List[Get
Projects Sort] Sort the results. The
sortblock is documented below.
GetProjects Result
The following output properties are available:
- Id string
The provider-assigned unique ID for this managed resource.
- Projects
List<Pulumi.
Digital Ocean. Outputs. Get Projects Project> A set of projects satisfying any
filterandsortcriteria. Each project has the following attributes: -id- The ID of the project -name- The name of the project -description- The description of the project -purpose- The purpose of the project (Default: “Web Application”) -environment- The environment of the project’s resources. The possible values are:Development,Staging,Production. -resources- A set of uniform resource names (URNs) for the resources associated with the project -owner_uuid- The unique universal identifier of the project owner -owner_id- The ID of the project owner -created_at- The date and time when the project was created, (ISO8601) -updated_at- The date and time when the project was last updated, (ISO8601)- Filters
List<Pulumi.
Digital Ocean. Outputs. Get Projects Filter> - Sorts
List<Pulumi.
Digital Ocean. Outputs. Get Projects Sort>
- Id string
The provider-assigned unique ID for this managed resource.
- Projects
[]Get
Projects Project A set of projects satisfying any
filterandsortcriteria. Each project has the following attributes: -id- The ID of the project -name- The name of the project -description- The description of the project -purpose- The purpose of the project (Default: “Web Application”) -environment- The environment of the project’s resources. The possible values are:Development,Staging,Production. -resources- A set of uniform resource names (URNs) for the resources associated with the project -owner_uuid- The unique universal identifier of the project owner -owner_id- The ID of the project owner -created_at- The date and time when the project was created, (ISO8601) -updated_at- The date and time when the project was last updated, (ISO8601)- Filters
[]Get
Projects Filter - Sorts
[]Get
Projects Sort
- id string
The provider-assigned unique ID for this managed resource.
- projects
Get
Projects Project[] A set of projects satisfying any
filterandsortcriteria. Each project has the following attributes: -id- The ID of the project -name- The name of the project -description- The description of the project -purpose- The purpose of the project (Default: “Web Application”) -environment- The environment of the project’s resources. The possible values are:Development,Staging,Production. -resources- A set of uniform resource names (URNs) for the resources associated with the project -owner_uuid- The unique universal identifier of the project owner -owner_id- The ID of the project owner -created_at- The date and time when the project was created, (ISO8601) -updated_at- The date and time when the project was last updated, (ISO8601)- filters
Get
Projects Filter[] - sorts
Get
Projects Sort[]
- id str
The provider-assigned unique ID for this managed resource.
- projects
List[Get
Projects Project] A set of projects satisfying any
filterandsortcriteria. Each project has the following attributes: -id- The ID of the project -name- The name of the project -description- The description of the project -purpose- The purpose of the project (Default: “Web Application”) -environment- The environment of the project’s resources. The possible values are:Development,Staging,Production. -resources- A set of uniform resource names (URNs) for the resources associated with the project -owner_uuid- The unique universal identifier of the project owner -owner_id- The ID of the project owner -created_at- The date and time when the project was created, (ISO8601) -updated_at- The date and time when the project was last updated, (ISO8601)- filters
List[Get
Projects Filter] - sorts
List[Get
Projects Sort]
Supporting Types
GetProjectsFilter
- Key string
Filter the projects by this key. This may be one of
name,purpose,description,environment, oris_default.- Values List<string>
A list of values to match against the
keyfield. Only retrieves projects where thekeyfield takes on one or more of the values provided here.
GetProjectsProject
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
GetProjectsSort
Package Details
- Repository
- https://github.com/pulumi/pulumi-digitalocean
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
digitaloceanTerraform Provider.