digitalocean.Project
Explore with Pulumi AI
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:
- App Platform Apps
- Database Clusters
- Domains
- Droplets
- Floating IPs
- Kubernetes Clusters
- Load Balancers
- Spaces Buckets
- Volumes
Note: A provider managed project cannot be set as a default project.
Example Usage
The following example demonstrates the creation of an empty project:
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";
const playground = new digitalocean.Project("playground", {
name: "playground",
description: "A project to represent development resources.",
purpose: "Web Application",
environment: "Development",
});
import pulumi
import pulumi_digitalocean as digitalocean
playground = digitalocean.Project("playground",
name="playground",
description="A project to represent development resources.",
purpose="Web Application",
environment="Development")
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{
Name: pulumi.String("playground"),
Description: pulumi.String("A project to represent development resources."),
Purpose: pulumi.String("Web Application"),
Environment: pulumi.String("Development"),
})
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 playground = new DigitalOcean.Project("playground", new()
{
Name = "playground",
Description = "A project to represent development resources.",
Purpose = "Web Application",
Environment = "Development",
});
});
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()
.name("playground")
.description("A project to represent development resources.")
.purpose("Web Application")
.environment("Development")
.build());
}
}
resources:
playground:
type: digitalocean:Project
properties:
name: playground
description: A project to represent development resources.
purpose: Web Application
environment: Development
The following example demonstrates the creation of a project with a Droplet resource:
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";
const foobar = new digitalocean.Droplet("foobar", {
name: "example",
size: digitalocean.DropletSlug.DropletS1VCPU1GB,
image: "ubuntu-22-04-x64",
region: digitalocean.Region.NYC3,
});
const playground = new digitalocean.Project("playground", {
name: "playground",
description: "A project to represent development resources.",
purpose: "Web Application",
environment: "Development",
resources: [foobar.dropletUrn],
});
import pulumi
import pulumi_digitalocean as digitalocean
foobar = digitalocean.Droplet("foobar",
name="example",
size=digitalocean.DropletSlug.DROPLET_S1_VCPU1_GB,
image="ubuntu-22-04-x64",
region=digitalocean.Region.NYC3)
playground = digitalocean.Project("playground",
name="playground",
description="A project to represent development resources.",
purpose="Web Application",
environment="Development",
resources=[foobar.droplet_urn])
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 {
foobar, err := digitalocean.NewDroplet(ctx, "foobar", &digitalocean.DropletArgs{
Name: pulumi.String("example"),
Size: pulumi.String(digitalocean.DropletSlugDropletS1VCPU1GB),
Image: pulumi.String("ubuntu-22-04-x64"),
Region: pulumi.String(digitalocean.RegionNYC3),
})
if err != nil {
return err
}
_, err = digitalocean.NewProject(ctx, "playground", &digitalocean.ProjectArgs{
Name: pulumi.String("playground"),
Description: pulumi.String("A project to represent development resources."),
Purpose: pulumi.String("Web Application"),
Environment: pulumi.String("Development"),
Resources: pulumi.StringArray{
foobar.DropletUrn,
},
})
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 foobar = new DigitalOcean.Droplet("foobar", new()
{
Name = "example",
Size = DigitalOcean.DropletSlug.DropletS1VCPU1GB,
Image = "ubuntu-22-04-x64",
Region = DigitalOcean.Region.NYC3,
});
var playground = new DigitalOcean.Project("playground", new()
{
Name = "playground",
Description = "A project to represent development resources.",
Purpose = "Web Application",
Environment = "Development",
Resources = new[]
{
foobar.DropletUrn,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.digitalocean.Droplet;
import com.pulumi.digitalocean.DropletArgs;
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 foobar = new Droplet("foobar", DropletArgs.builder()
.name("example")
.size("s-1vcpu-1gb")
.image("ubuntu-22-04-x64")
.region("nyc3")
.build());
var playground = new Project("playground", ProjectArgs.builder()
.name("playground")
.description("A project to represent development resources.")
.purpose("Web Application")
.environment("Development")
.resources(foobar.dropletUrn())
.build());
}
}
resources:
foobar:
type: digitalocean:Droplet
properties:
name: example
size: s-1vcpu-1gb
image: ubuntu-22-04-x64
region: nyc3
playground:
type: digitalocean:Project
properties:
name: playground
description: A project to represent development resources.
purpose: Web Application
environment: Development
resources:
- ${foobar.dropletUrn}
Create Project Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Project(name: string, args?: ProjectArgs, opts?: CustomResourceOptions);
@overload
def Project(resource_name: str,
args: Optional[ProjectArgs] = None,
opts: Optional[ResourceOptions] = None)
@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)
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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var projectResource = new DigitalOcean.Project("projectResource", new()
{
Description = "string",
Environment = "string",
IsDefault = false,
Name = "string",
Purpose = "string",
Resources = new[]
{
"string",
},
});
example, err := digitalocean.NewProject(ctx, "projectResource", &digitalocean.ProjectArgs{
Description: pulumi.String("string"),
Environment: pulumi.String("string"),
IsDefault: pulumi.Bool(false),
Name: pulumi.String("string"),
Purpose: pulumi.String("string"),
Resources: pulumi.StringArray{
pulumi.String("string"),
},
})
var projectResource = new Project("projectResource", ProjectArgs.builder()
.description("string")
.environment("string")
.isDefault(false)
.name("string")
.purpose("string")
.resources("string")
.build());
project_resource = digitalocean.Project("projectResource",
description="string",
environment="string",
is_default=False,
name="string",
purpose="string",
resources=["string"])
const projectResource = new digitalocean.Project("projectResource", {
description: "string",
environment: "string",
isDefault: false,
name: "string",
purpose: "string",
resources: ["string"],
});
type: digitalocean:Project
properties:
description: string
environment: string
isDefault: false
name: string
purpose: string
resources:
- string
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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
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
) - Is
Default 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
) - Is
Default 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
) - is
Default 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
) - is
Default 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
) - is
Default 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:
- Created
At string - the date and time when the project was created, (ISO8601)
- Id string
- The provider-assigned unique ID for this managed resource.
- Owner
Id int - the id of the project owner.
- Owner
Uuid string - the unique universal identifier of the project owner.
- 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)
- Id string
- The provider-assigned unique ID for this managed resource.
- Owner
Id int - the id of the project owner.
- Owner
Uuid string - the unique universal identifier of the project owner.
- 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)
- id String
- The provider-assigned unique ID for this managed resource.
- owner
Id Integer - the id of the project owner.
- owner
Uuid String - the unique universal identifier of the project owner.
- 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)
- id string
- The provider-assigned unique ID for this managed resource.
- owner
Id number - the id of the project owner.
- owner
Uuid string - the unique universal identifier of the project owner.
- 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)
- 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)
- created
At String - the date and time when the project was created, (ISO8601)
- id String
- The provider-assigned unique ID for this managed resource.
- owner
Id Number - the id of the project owner.
- owner
Uuid String - the unique universal identifier of the project owner.
- updated
At String - the date and time when the project was last updated, (ISO8601)
Look up 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.
- 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
) - Is
Default bool - a boolean indicating whether or not the project is the default project. (Default: "false")
- 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 list 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
) - Is
Default bool - a boolean indicating whether or not the project is the default project. (Default: "false")
- 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 list 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
) - is
Default Boolean - a boolean indicating whether or not the project is the default project. (Default: "false")
- 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<String>
- a list 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
) - is
Default boolean - a boolean indicating whether or not the project is the default project. (Default: "false")
- 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 list 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
) - 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)
- 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
) - is
Default Boolean - a boolean indicating whether or not the project is the default project. (Default: "false")
- 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<String>
- a list 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)
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
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- DigitalOcean pulumi/pulumi-digitalocean
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
digitalocean
Terraform Provider.