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.DigitalOcean.Inputs.GetProjectsFilterArgs>

Filter the results. The filter block is documented below.

Sorts List<Pulumi.DigitalOcean.Inputs.GetProjectsSortArgs>

Sort the results. The sort block is documented below.

Filters []GetProjectsFilter

Filter the results. The filter block is documented below.

Sorts []GetProjectsSort

Sort the results. The sort block is documented below.

filters GetProjectsFilter[]

Filter the results. The filter block is documented below.

sorts GetProjectsSort[]

Sort the results. The sort block is documented below.

filters List[GetProjectsFilter]

Filter the results. The filter block is documented below.

sorts List[GetProjectsSort]

Sort the results. The sort block 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.DigitalOcean.Outputs.GetProjectsProject>

A set of projects satisfying any filter and sort criteria. 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.DigitalOcean.Outputs.GetProjectsFilter>
Sorts List<Pulumi.DigitalOcean.Outputs.GetProjectsSort>
Id string

The provider-assigned unique ID for this managed resource.

Projects []GetProjectsProject

A set of projects satisfying any filter and sort criteria. 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 []GetProjectsFilter
Sorts []GetProjectsSort
id string

The provider-assigned unique ID for this managed resource.

projects GetProjectsProject[]

A set of projects satisfying any filter and sort criteria. 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 GetProjectsFilter[]
sorts GetProjectsSort[]
id str

The provider-assigned unique ID for this managed resource.

projects List[GetProjectsProject]

A set of projects satisfying any filter and sort criteria. 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[GetProjectsFilter]
sorts List[GetProjectsSort]

Supporting Types

GetProjectsFilter

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Key string

Filter the projects by this key. This may be one of name, purpose, description, environment, or is_default.

Values List<string>

A list of values to match against the key field. Only retrieves projects where the key field takes on one or more of the values provided here.

Key string

Filter the projects by this key. This may be one of name, purpose, description, environment, or is_default.

Values []string

A list of values to match against the key field. Only retrieves projects where the key field takes on one or more of the values provided here.

key string

Filter the projects by this key. This may be one of name, purpose, description, environment, or is_default.

values string[]

A list of values to match against the key field. Only retrieves projects where the key field takes on one or more of the values provided here.

key str

Filter the projects by this key. This may be one of name, purpose, description, environment, or is_default.

values List[str]

A list of values to match against the key field. Only retrieves projects where the key field 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.

CreatedAt string
Description string
Environment string
Id string
IsDefault bool
Name string
OwnerId int
OwnerUuid string
Purpose string
Resources List<string>
UpdatedAt string
CreatedAt string
Description string
Environment string
Id string
IsDefault bool
Name string
OwnerId int
OwnerUuid string
Purpose string
Resources []string
UpdatedAt string
createdAt string
description string
environment string
id string
isDefault boolean
name string
ownerId number
ownerUuid string
purpose string
resources string[]
updatedAt string
created_at str
description str
environment str
id str
is_default bool
name str
owner_id float
owner_uuid str
purpose str
resources List[str]
updated_at str

GetProjectsSort

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Key string

Sort the projects by this key. This may be one of name, purpose, description, or environment.

Direction string

The sort direction. This may be either asc or desc.

Key string

Sort the projects by this key. This may be one of name, purpose, description, or environment.

Direction string

The sort direction. This may be either asc or desc.

key string

Sort the projects by this key. This may be one of name, purpose, description, or environment.

direction string

The sort direction. This may be either asc or desc.

key str

Sort the projects by this key. This may be one of name, purpose, description, or environment.

direction str

The sort direction. This may be either asc or desc.

Package Details

Repository
https://github.com/pulumi/pulumi-digitalocean
License
Apache-2.0
Notes
This Pulumi package is based on the digitalocean Terraform Provider.