DigitalOcean v4.35.0 published on Tuesday, Nov 19, 2024 by Pulumi
digitalocean.getProject
Explore with Pulumi AI
Get information on a single DigitalOcean project. If neither the id
nor name
attributes are provided,
then this data source returns the default project.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";
const default = digitalocean.getProject({});
const staging = digitalocean.getProject({
name: "My Staging Project",
});
import pulumi
import pulumi_digitalocean as digitalocean
default = digitalocean.get_project()
staging = digitalocean.get_project(name="My Staging Project")
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.LookupProject(ctx, &digitalocean.LookupProjectArgs{}, nil)
if err != nil {
return err
}
_, err = digitalocean.LookupProject(ctx, &digitalocean.LookupProjectArgs{
Name: pulumi.StringRef("My Staging Project"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
return await Deployment.RunAsync(() =>
{
var @default = DigitalOcean.GetProject.Invoke();
var staging = DigitalOcean.GetProject.Invoke(new()
{
Name = "My Staging Project",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.digitalocean.DigitaloceanFunctions;
import com.pulumi.digitalocean.inputs.GetProjectArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var default = DigitaloceanFunctions.getProject();
final var staging = DigitaloceanFunctions.getProject(GetProjectArgs.builder()
.name("My Staging Project")
.build());
}
}
variables:
default:
fn::invoke:
Function: digitalocean:getProject
Arguments: {}
staging:
fn::invoke:
Function: digitalocean:getProject
Arguments:
name: My Staging Project
Using getProject
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 getProject(args: GetProjectArgs, opts?: InvokeOptions): Promise<GetProjectResult>
function getProjectOutput(args: GetProjectOutputArgs, opts?: InvokeOptions): Output<GetProjectResult>
def get_project(id: Optional[str] = None,
name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetProjectResult
def get_project_output(id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetProjectResult]
func LookupProject(ctx *Context, args *LookupProjectArgs, opts ...InvokeOption) (*LookupProjectResult, error)
func LookupProjectOutput(ctx *Context, args *LookupProjectOutputArgs, opts ...InvokeOption) LookupProjectResultOutput
> Note: This function is named LookupProject
in the Go SDK.
public static class GetProject
{
public static Task<GetProjectResult> InvokeAsync(GetProjectArgs args, InvokeOptions? opts = null)
public static Output<GetProjectResult> Invoke(GetProjectInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetProjectResult> getProject(GetProjectArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: digitalocean:index/getProject:getProject
arguments:
# arguments dictionary
The following arguments are supported:
getProject Result
The following output properties are available:
- 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
- Is
Default bool - Name string
- 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
- Is
Default bool - Name string
- 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
- is
Default Boolean - name String
- 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<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
- is
Default boolean - name string
- 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
- is_
default bool - name str
- 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
- is
Default Boolean - name String
- 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<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)
Package Details
- Repository
- DigitalOcean pulumi/pulumi-digitalocean
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
digitalocean
Terraform Provider.