1. Packages
  2. DigitalOcean
  3. API Docs
  4. getProject
DigitalOcean v4.22.0 published on Friday, Sep 22, 2023 by Pulumi

digitalocean.getProject

Explore with Pulumi AI

digitalocean logo
DigitalOcean v4.22.0 published on Friday, Sep 22, 2023 by Pulumi

    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

    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 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, nil, 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
    	})
    }
    
    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());
    
        }
    }
    
    import pulumi
    import pulumi_digitalocean as digitalocean
    
    default = digitalocean.get_project()
    staging = digitalocean.get_project(name="My Staging Project")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as digitalocean from "@pulumi/digitalocean";
    
    const default = digitalocean.getProject({});
    const staging = digitalocean.getProject({
        name: "My Staging Project",
    });
    
    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:

    Id string

    the ID of the project to retrieve

    Name string

    the name of the project to retrieve. The data source will raise an error if more than one project has the provided name or if no project has that name.

    Id string

    the ID of the project to retrieve

    Name string

    the name of the project to retrieve. The data source will raise an error if more than one project has the provided name or if no project has that name.

    id String

    the ID of the project to retrieve

    name String

    the name of the project to retrieve. The data source will raise an error if more than one project has the provided name or if no project has that name.

    id string

    the ID of the project to retrieve

    name string

    the name of the project to retrieve. The data source will raise an error if more than one project has the provided name or if no project has that name.

    id str

    the ID of the project to retrieve

    name str

    the name of the project to retrieve. The data source will raise an error if more than one project has the provided name or if no project has that name.

    id String

    the ID of the project to retrieve

    name String

    the name of the project to retrieve. The data source will raise an error if more than one project has the provided name or if no project has that name.

    getProject Result

    The following output properties are available:

    CreatedAt 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
    IsDefault bool
    Name string
    OwnerId int

    The ID of the project owner.

    OwnerUuid 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

    UpdatedAt string

    The date and time when the project was last updated, (ISO8601)

    CreatedAt 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
    IsDefault bool
    Name string
    OwnerId int

    The ID of the project owner.

    OwnerUuid 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

    UpdatedAt string

    The date and time when the project was last updated, (ISO8601)

    createdAt 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
    isDefault Boolean
    name String
    ownerId Integer

    The ID of the project owner.

    ownerUuid 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

    updatedAt String

    The date and time when the project was last updated, (ISO8601)

    createdAt 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
    isDefault boolean
    name string
    ownerId number

    The ID of the project owner.

    ownerUuid 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

    updatedAt 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)

    createdAt 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
    isDefault Boolean
    name String
    ownerId Number

    The ID of the project owner.

    ownerUuid 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

    updatedAt 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.

    digitalocean logo
    DigitalOcean v4.22.0 published on Friday, Sep 22, 2023 by Pulumi