UNPKG

@pulumi/digitalocean

Version:

A Pulumi package for creating and managing DigitalOcean cloud resources.

133 lines 5.05 kB
"use strict"; // *** 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, { ...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?.createdAt; resourceInputs["description"] = state?.description; resourceInputs["environment"] = state?.environment; resourceInputs["isDefault"] = state?.isDefault; resourceInputs["name"] = state?.name; resourceInputs["ownerId"] = state?.ownerId; resourceInputs["ownerUuid"] = state?.ownerUuid; resourceInputs["purpose"] = state?.purpose; resourceInputs["resources"] = state?.resources; resourceInputs["updatedAt"] = state?.updatedAt; } else { const args = argsOrState; resourceInputs["description"] = args?.description; resourceInputs["environment"] = args?.environment; resourceInputs["isDefault"] = args?.isDefault; resourceInputs["name"] = args?.name; resourceInputs["purpose"] = args?.purpose; resourceInputs["resources"] = args?.resources; 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