DigitalOcean

v4.16.0 published on Wednesday, Sep 28, 2022 by Pulumi

Project

Provides a DigitalOcean Project resource.

Projects allow you to organize your resources into groups that fit the way you work. You can group resources (like Droplets, Spaces, Load Balancers, domains, and Floating IPs) in ways that align with the applications you host on DigitalOcean.

The following resource types can be associated with a project:

  • Database Clusters
  • Domains
  • Droplets
  • Floating IP
  • Kubernetes Cluster
  • Load Balancers
  • Spaces Bucket
  • Volume

Note: A provider managed project cannot be set as a default project.

Example Usage

using System.Collections.Generic;
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

return await Deployment.RunAsync(() => 
{
    var playground = new DigitalOcean.Project("playground", new()
    {
        Description = "A project to represent development resources.",
        Environment = "Development",
        Purpose = "Web Application",
    });

});
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.NewProject(ctx, "playground", &digitalocean.ProjectArgs{
			Description: pulumi.String("A project to represent development resources."),
			Environment: pulumi.String("Development"),
			Purpose:     pulumi.String("Web Application"),
		})
		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.Project;
import com.pulumi.digitalocean.ProjectArgs;
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) {
        var playground = new Project("playground", ProjectArgs.builder()        
            .description("A project to represent development resources.")
            .environment("Development")
            .purpose("Web Application")
            .build());

    }
}
import pulumi
import pulumi_digitalocean as digitalocean

playground = digitalocean.Project("playground",
    description="A project to represent development resources.",
    environment="Development",
    purpose="Web Application")
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";

const playground = new digitalocean.Project("playground", {
    description: "A project to represent development resources.",
    environment: "Development",
    purpose: "Web Application",
});
resources:
  playground:
    type: digitalocean:Project
    properties:
      description: A project to represent development resources.
      environment: Development
      purpose: Web Application

Create a Project Resource

new Project(name: string, args?: ProjectArgs, opts?: CustomResourceOptions);
@overload
def Project(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            environment: Optional[str] = None,
            is_default: Optional[bool] = None,
            name: Optional[str] = None,
            purpose: Optional[str] = None,
            resources: Optional[Sequence[str]] = None)
@overload
def Project(resource_name: str,
            args: Optional[ProjectArgs] = None,
            opts: Optional[ResourceOptions] = None)
func NewProject(ctx *Context, name string, args *ProjectArgs, opts ...ResourceOption) (*Project, error)
public Project(string name, ProjectArgs? args = null, CustomResourceOptions? opts = null)
public Project(String name, ProjectArgs args)
public Project(String name, ProjectArgs args, CustomResourceOptions options)
type: digitalocean:Project
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args ProjectArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args ProjectArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args ProjectArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ProjectArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args ProjectArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Project Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Project resource accepts the following input properties:

Description string

the description of the project

Environment string

the environment of the project's resources. The possible values are: Development, Staging, Production)

IsDefault bool

a boolean indicating whether or not the project is the default project. (Default: "false")

Name string

The name of the Project

Purpose string

the purpose of the project, (Default: "Web Application")

Resources List<string>

a list of uniform resource names (URNs) for the resources associated with the project

Description string

the description of the project

Environment string

the environment of the project's resources. The possible values are: Development, Staging, Production)

IsDefault bool

a boolean indicating whether or not the project is the default project. (Default: "false")

Name string

The name of the Project

Purpose string

the purpose of the project, (Default: "Web Application")

Resources []string

a list of uniform resource names (URNs) for the resources associated with the project

description String

the description of the project

environment String

the environment of the project's resources. The possible values are: Development, Staging, Production)

isDefault Boolean

a boolean indicating whether or not the project is the default project. (Default: "false")

name String

The name of the Project

purpose String

the purpose of the project, (Default: "Web Application")

resources List<String>

a list of uniform resource names (URNs) for the resources associated with the project

description string

the description of the project

environment string

the environment of the project's resources. The possible values are: Development, Staging, Production)

isDefault boolean

a boolean indicating whether or not the project is the default project. (Default: "false")

name string

The name of the Project

purpose string

the purpose of the project, (Default: "Web Application")

resources string[]

a list of uniform resource names (URNs) for the resources associated with the project

description str

the description of the project

environment str

the environment of the project's resources. The possible values are: Development, Staging, Production)

is_default bool

a boolean indicating whether or not the project is the default project. (Default: "false")

name str

The name of the Project

purpose str

the purpose of the project, (Default: "Web Application")

resources Sequence[str]

a list of uniform resource names (URNs) for the resources associated with the project

description String

the description of the project

environment String

the environment of the project's resources. The possible values are: Development, Staging, Production)

isDefault Boolean

a boolean indicating whether or not the project is the default project. (Default: "false")

name String

The name of the Project

purpose String

the purpose of the project, (Default: "Web Application")

resources List<String>

a list of uniform resource names (URNs) for the resources associated with the project

Outputs

All input properties are implicitly available as output properties. Additionally, the Project resource produces the following output properties:

CreatedAt string

the date and time when the project was created, (ISO8601)

Id string

The provider-assigned unique ID for this managed resource.

OwnerId int

the id of the project owner.

OwnerUuid string

the unique universal identifier of the project owner.

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)

Id string

The provider-assigned unique ID for this managed resource.

OwnerId int

the id of the project owner.

OwnerUuid string

the unique universal identifier of the project owner.

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)

id String

The provider-assigned unique ID for this managed resource.

ownerId Integer

the id of the project owner.

ownerUuid String

the unique universal identifier of the project owner.

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)

id string

The provider-assigned unique ID for this managed resource.

ownerId number

the id of the project owner.

ownerUuid string

the unique universal identifier of the project owner.

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)

id str

The provider-assigned unique ID for this managed resource.

owner_id int

the id of the project owner.

owner_uuid str

the unique universal identifier of the project owner.

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)

id String

The provider-assigned unique ID for this managed resource.

ownerId Number

the id of the project owner.

ownerUuid String

the unique universal identifier of the project owner.

updatedAt String

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

Look up an Existing Project Resource

Get an existing Project resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ProjectState, opts?: CustomResourceOptions): Project
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        created_at: Optional[str] = None,
        description: Optional[str] = None,
        environment: Optional[str] = None,
        is_default: Optional[bool] = None,
        name: Optional[str] = None,
        owner_id: Optional[int] = None,
        owner_uuid: Optional[str] = None,
        purpose: Optional[str] = None,
        resources: Optional[Sequence[str]] = None,
        updated_at: Optional[str] = None) -> Project
func GetProject(ctx *Context, name string, id IDInput, state *ProjectState, opts ...ResourceOption) (*Project, error)
public static Project Get(string name, Input<string> id, ProjectState? state, CustomResourceOptions? opts = null)
public static Project get(String name, Output<String> id, ProjectState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
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)

IsDefault bool

a boolean indicating whether or not the project is the default project. (Default: "false")

Name string

The name of the Project

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

IsDefault bool

a boolean indicating whether or not the project is the default project. (Default: "false")

Name string

The name of the Project

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

isDefault Boolean

a boolean indicating whether or not the project is the default project. (Default: "false")

name String

The name of the Project

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

isDefault boolean

a boolean indicating whether or not the project is the default project. (Default: "false")

name string

The name of the Project

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

is_default bool

a boolean indicating whether or not the project is the default project. (Default: "false")

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

isDefault Boolean

a boolean indicating whether or not the project is the default project. (Default: "false")

name String

The name of the Project

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

Import

Projects can be imported using the id returned from DigitalOcean, e.g.

 $ pulumi import digitalocean:index/project:Project myproject 245bcfd0-7f31-4ce6-a2bc-475a116cca97

Package Details

Repository
https://github.com/pulumi/pulumi-digitalocean
License
Apache-2.0
Notes

This Pulumi package is based on the digitalocean Terraform Provider.