@pulumi/digitalocean
Version:
A Pulumi package for creating and managing DigitalOcean cloud resources.
133 lines • 5.38 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.Project = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* 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:
*
* ```typescript
* 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",
* });
* ```
*
* The following example demonstrates the creation of a project with a Droplet resource:
*
* ```typescript
* 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
*
* Projects can be imported using the `id` returned from DigitalOcean, e.g.
*
* ```sh
* $ pulumi import digitalocean:index/project:Project myproject 245bcfd0-7f31-4ce6-a2bc-475a116cca97
* ```
*/
class Project extends pulumi.CustomResource {
/**
* Get an existing Project resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new Project(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Project. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Project.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["environment"] = state ? state.environment : undefined;
resourceInputs["isDefault"] = state ? state.isDefault : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["ownerId"] = state ? state.ownerId : undefined;
resourceInputs["ownerUuid"] = state ? state.ownerUuid : undefined;
resourceInputs["purpose"] = state ? state.purpose : undefined;
resourceInputs["resources"] = state ? state.resources : undefined;
resourceInputs["updatedAt"] = state ? state.updatedAt : undefined;
}
else {
const args = argsOrState;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["environment"] = args ? args.environment : undefined;
resourceInputs["isDefault"] = args ? args.isDefault : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["purpose"] = args ? args.purpose : undefined;
resourceInputs["resources"] = args ? args.resources : undefined;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["ownerId"] = undefined /*out*/;
resourceInputs["ownerUuid"] = undefined /*out*/;
resourceInputs["updatedAt"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Project.__pulumiType, name, resourceInputs, opts);
}
}
exports.Project = Project;
/** @internal */
Project.__pulumiType = 'digitalocean:index/project:Project';
//# sourceMappingURL=project.js.map