DigitalOcean
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",
},
},
},
}));
}
}
package main
import (
"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := digitalocean.GetProjects(ctx, &GetProjectsArgs{
Filters: []GetProjectsFilter{
GetProjectsFilter{
Key: "environment",
Values: []string{
"Staging",
},
},
},
}, nil)
if err != nil {
return err
}
return nil
})
}
Coming soon!
import pulumi
import pulumi_digitalocean as digitalocean
staging = digitalocean.get_projects(filters=[digitalocean.GetProjectsFilterArgs(
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"],
}],
}));
Coming soon!
Using getProjects
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getProjects(args: GetProjectsArgs, opts?: InvokeOptions): Promise<GetProjectsResult>
function getProjectsOutput(args: GetProjectsOutputArgs, opts?: InvokeOptions): Output<GetProjectsResult>
def get_projects(filters: Optional[Sequence[GetProjectsFilter]] = None,
sorts: Optional[Sequence[GetProjectsSort]] = None,
opts: Optional[InvokeOptions] = None) -> GetProjectsResult
def get_projects_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetProjectsFilterArgs]]]] = None,
sorts: Optional[pulumi.Input[Sequence[pulumi.Input[GetProjectsSortArgs]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetProjectsResult]
func GetProjects(ctx *Context, args *GetProjectsArgs, opts ...InvokeOption) (*GetProjectsResult, error)
func GetProjectsOutput(ctx *Context, args *GetProjectsOutputArgs, opts ...InvokeOption) GetProjectsResultOutput
> Note: This function is named GetProjects
in the Go SDK.
public static class GetProjects
{
public static Task<GetProjectsResult> InvokeAsync(GetProjectsArgs args, InvokeOptions? opts = null)
public static Output<GetProjectsResult> Invoke(GetProjectsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetProjectsResult> getProjects(GetProjectsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
Function: digitalocean:index/getProjects:getProjects
Arguments:
# Arguments dictionary
The following arguments are supported:
- Filters
List<Pulumi.
Digital Ocean. Inputs. Get Projects Filter> Filter the results. The
filter
block is documented below.- Sorts
List<Pulumi.
Digital Ocean. Inputs. Get Projects Sort> Sort the results. The
sort
block is documented below.
- Filters
[]Get
Projects Filter Filter the results. The
filter
block is documented below.- Sorts
[]Get
Projects Sort Sort the results. The
sort
block is documented below.
- filters
List
Projects Filter> Filter the results. The
filter
block is documented below.- sorts
List
Projects Sort> Sort the results. The
sort
block is documented below.
- filters
Get
Projects Filter[] Filter the results. The
filter
block is documented below.- sorts
Get
Projects Sort[] Sort the results. The
sort
block is documented below.
- filters
Sequence[Get
Projects Filter] Filter the results. The
filter
block is documented below.- sorts
Sequence[Get
Projects Sort] 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.
Digital Ocean. Outputs. Get Projects Project> A set of projects satisfying any
filter
andsort
criteria. Each project has the following attributes:- 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
filter
andsort
criteria. Each project has the following attributes:- Filters
[]Get
Projects Filter - Sorts
[]Get
Projects Sort
- id String
The provider-assigned unique ID for this managed resource.
- projects
List
Projects Project> A set of projects satisfying any
filter
andsort
criteria. Each project has the following attributes:- filters
List
Projects Filter> - sorts
List
Projects Sort>
- id string
The provider-assigned unique ID for this managed resource.
- projects
Get
Projects Project[] A set of projects satisfying any
filter
andsort
criteria. Each project has the following attributes:- filters
Get
Projects Filter[] - sorts
Get
Projects Sort[]
- id str
The provider-assigned unique ID for this managed resource.
- projects
Sequence[Get
Projects Project] A set of projects satisfying any
filter
andsort
criteria. Each project has the following attributes:- filters
Sequence[Get
Projects Filter] - sorts
Sequence[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
key
field. Only retrieves projects where thekey
field takes on one or more of the values provided here.- All bool
Set to
true
to require that a field match all of thevalues
instead of just one or more of them. This is useful when matching against multi-valued fields such as lists or sets where you want to ensure that all of thevalues
are present in the list or set.- Match
By string One of
exact
(default),re
, orsubstring
. For string-typed fields, specifyre
to match by using thevalues
as regular expressions, or specifysubstring
to match by treating thevalues
as substrings to find within the string field.
- Key string
Filter the projects by this key. This may be one of
name
,purpose
,description
,environment
, oris_default
.- Values []string
A list of values to match against the
key
field. Only retrieves projects where thekey
field takes on one or more of the values provided here.- All bool
Set to
true
to require that a field match all of thevalues
instead of just one or more of them. This is useful when matching against multi-valued fields such as lists or sets where you want to ensure that all of thevalues
are present in the list or set.- Match
By string One of
exact
(default),re
, orsubstring
. For string-typed fields, specifyre
to match by using thevalues
as regular expressions, or specifysubstring
to match by treating thevalues
as substrings to find within the string field.
- key String
Filter the projects by this key. This may be one of
name
,purpose
,description
,environment
, oris_default
.- values
List
A list of values to match against the
key
field. Only retrieves projects where thekey
field takes on one or more of the values provided here.- all Boolean
Set to
true
to require that a field match all of thevalues
instead of just one or more of them. This is useful when matching against multi-valued fields such as lists or sets where you want to ensure that all of thevalues
are present in the list or set.- match
By String One of
exact
(default),re
, orsubstring
. For string-typed fields, specifyre
to match by using thevalues
as regular expressions, or specifysubstring
to match by treating thevalues
as substrings to find within the string field.
- key string
Filter the projects by this key. This may be one of
name
,purpose
,description
,environment
, oris_default
.- values string[]
A list of values to match against the
key
field. Only retrieves projects where thekey
field takes on one or more of the values provided here.- all boolean
Set to
true
to require that a field match all of thevalues
instead of just one or more of them. This is useful when matching against multi-valued fields such as lists or sets where you want to ensure that all of thevalues
are present in the list or set.- match
By string One of
exact
(default),re
, orsubstring
. For string-typed fields, specifyre
to match by using thevalues
as regular expressions, or specifysubstring
to match by treating thevalues
as substrings to find within the string field.
- key str
Filter the projects by this key. This may be one of
name
,purpose
,description
,environment
, oris_default
.- values Sequence[str]
A list of values to match against the
key
field. Only retrieves projects where thekey
field takes on one or more of the values provided here.- all bool
Set to
true
to require that a field match all of thevalues
instead of just one or more of them. This is useful when matching against multi-valued fields such as lists or sets where you want to ensure that all of thevalues
are present in the list or set.- match_
by str One of
exact
(default),re
, orsubstring
. For string-typed fields, specifyre
to match by using thevalues
as regular expressions, or specifysubstring
to match by treating thevalues
as substrings to find within the string field.
- key String
Filter the projects by this key. This may be one of
name
,purpose
,description
,environment
, oris_default
.- values
List
A list of values to match against the
key
field. Only retrieves projects where thekey
field takes on one or more of the values provided here.- all Boolean
Set to
true
to require that a field match all of thevalues
instead of just one or more of them. This is useful when matching against multi-valued fields such as lists or sets where you want to ensure that all of thevalues
are present in the list or set.- match
By String One of
exact
(default),re
, orsubstring
. For string-typed fields, specifyre
to match by using thevalues
as regular expressions, or specifysubstring
to match by treating thevalues
as substrings to find within the string field.
GetProjectsProject
- Created
At string The date and time when the project was created, (ISO8601)
- Description string
The description of the project
- Environment string
The environment of the project's resources. The possible values are:
Development
,Staging
,Production
.- Id string
The ID of the project
- Is
Default bool - Name string
The name of the project
- Owner
Id int The ID of the project owner
- Owner
Uuid string The unique universal identifier of the project owner
- Purpose string
The purpose of the project (Default: "Web Application")
- Resources List<string>
A set of uniform resource names (URNs) for the resources associated with the project
- Updated
At string The date and time when the project was last updated, (ISO8601)
- Created
At string The date and time when the project was created, (ISO8601)
- Description string
The description of the project
- Environment string
The environment of the project's resources. The possible values are:
Development
,Staging
,Production
.- Id string
The ID of the project
- Is
Default bool - Name string
The name of the project
- Owner
Id int The ID of the project owner
- Owner
Uuid string The unique universal identifier of the project owner
- Purpose string
The purpose of the project (Default: "Web Application")
- Resources []string
A set of uniform resource names (URNs) for the resources associated with the project
- Updated
At string The date and time when the project was last updated, (ISO8601)
- created
At String The date and time when the project was created, (ISO8601)
- description String
The description of the project
- environment String
The environment of the project's resources. The possible values are:
Development
,Staging
,Production
.- id String
The ID of the project
- is
Default Boolean - name String
The name of the project
- owner
Id Integer The ID of the project owner
- owner
Uuid String The unique universal identifier of the project owner
- purpose String
The purpose of the project (Default: "Web Application")
- resources
List
A set of uniform resource names (URNs) for the resources associated with the project
- updated
At String The date and time when the project was last updated, (ISO8601)
- created
At string The date and time when the project was created, (ISO8601)
- description string
The description of the project
- environment string
The environment of the project's resources. The possible values are:
Development
,Staging
,Production
.- id string
The ID of the project
- is
Default boolean - name string
The name of the project
- owner
Id number The ID of the project owner
- owner
Uuid string The unique universal identifier of the project owner
- purpose string
The purpose of the project (Default: "Web Application")
- resources string[]
A set of uniform resource names (URNs) for the resources associated with the project
- updated
At string The date and time when the project was last updated, (ISO8601)
- created_
at str The date and time when the project was created, (ISO8601)
- description str
The description of the project
- environment str
The environment of the project's resources. The possible values are:
Development
,Staging
,Production
.- id str
The ID of the project
- is_
default bool - name str
The name of the project
- owner_
id int The ID of the project owner
- owner_
uuid str The unique universal identifier of the project owner
- purpose str
The purpose of the project (Default: "Web Application")
- resources Sequence[str]
A set of uniform resource names (URNs) for the resources associated with the project
- updated_
at str The date and time when the project was last updated, (ISO8601)
- created
At String The date and time when the project was created, (ISO8601)
- description String
The description of the project
- environment String
The environment of the project's resources. The possible values are:
Development
,Staging
,Production
.- id String
The ID of the project
- is
Default Boolean - name String
The name of the project
- owner
Id Number The ID of the project owner
- owner
Uuid String The unique universal identifier of the project owner
- purpose String
The purpose of the project (Default: "Web Application")
- resources
List
A set of uniform resource names (URNs) for the resources associated with the project
- updated
At String The date and time when the project was last updated, (ISO8601)
GetProjectsSort
Package Details
- Repository
- https://github.com/pulumi/pulumi-digitalocean
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
digitalocean
Terraform Provider.