All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.digitalocean.kotlin.ProjectArgs.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.digitalocean.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.digitalocean.ProjectArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * 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",
 * });
 * ```
 * ```python
 * 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")
 * ```
 * ```csharp
 * 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",
 *     });
 * });
 * ```
 * ```go
 * 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
 * 	})
 * }
 * ```
 * ```java
 * 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());
 *     }
 * }
 * ```
 * ```yaml
 * 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:
 * 
 * ```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],
 * });
 * ```
 * ```python
 * 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])
 * ```
 * ```csharp
 * 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,
 *         },
 *     });
 * });
 * ```
 * ```go
 * 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
 * 	})
 * }
 * ```
 * ```java
 * 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());
 *     }
 * }
 * ```
 * ```yaml
 * 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}
 * ```
 * 
 * ## 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
 * ```
 * @property description the description of the project
 * @property environment the environment of the project's resources. The possible values are: `Development`, `Staging`, `Production`)
 * @property isDefault a boolean indicating whether or not the project is the default project. (Default: "false")
 * @property name The name of the Project
 * @property purpose the purpose of the project, (Default: "Web Application")
 * @property resources a list of uniform resource names (URNs) for the resources associated with the project
 */
public data class ProjectArgs(
    public val description: Output? = null,
    public val environment: Output? = null,
    public val isDefault: Output? = null,
    public val name: Output? = null,
    public val purpose: Output? = null,
    public val resources: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.digitalocean.ProjectArgs =
        com.pulumi.digitalocean.ProjectArgs.builder()
            .description(description?.applyValue({ args0 -> args0 }))
            .environment(environment?.applyValue({ args0 -> args0 }))
            .isDefault(isDefault?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .purpose(purpose?.applyValue({ args0 -> args0 }))
            .resources(resources?.applyValue({ args0 -> args0.map({ args0 -> args0 }) })).build()
}

/**
 * Builder for [ProjectArgs].
 */
@PulumiTagMarker
public class ProjectArgsBuilder internal constructor() {
    private var description: Output? = null

    private var environment: Output? = null

    private var isDefault: Output? = null

    private var name: Output? = null

    private var purpose: Output? = null

    private var resources: Output>? = null

    /**
     * @param value the description of the project
     */
    @JvmName("ktayopleuwlmkaal")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value the environment of the project's resources. The possible values are: `Development`, `Staging`, `Production`)
     */
    @JvmName("fouegnudqwnqouvd")
    public suspend fun environment(`value`: Output) {
        this.environment = value
    }

    /**
     * @param value a boolean indicating whether or not the project is the default project. (Default: "false")
     */
    @JvmName("tgduklieiobmuvch")
    public suspend fun isDefault(`value`: Output) {
        this.isDefault = value
    }

    /**
     * @param value The name of the Project
     */
    @JvmName("flramastsgnwawbt")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value the purpose of the project, (Default: "Web Application")
     */
    @JvmName("qqbppxwjfpbvdsah")
    public suspend fun purpose(`value`: Output) {
        this.purpose = value
    }

    /**
     * @param value a list of uniform resource names (URNs) for the resources associated with the project
     */
    @JvmName("acewahwajfcrlqln")
    public suspend fun resources(`value`: Output>) {
        this.resources = value
    }

    @JvmName("nbpmuuvyqofhweoy")
    public suspend fun resources(vararg values: Output) {
        this.resources = Output.all(values.asList())
    }

    /**
     * @param values a list of uniform resource names (URNs) for the resources associated with the project
     */
    @JvmName("lbykocypdcpepduu")
    public suspend fun resources(values: List>) {
        this.resources = Output.all(values)
    }

    /**
     * @param value the description of the project
     */
    @JvmName("fmmhlscitrltrpyd")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value the environment of the project's resources. The possible values are: `Development`, `Staging`, `Production`)
     */
    @JvmName("oerenulgwigkrhpv")
    public suspend fun environment(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.environment = mapped
    }

    /**
     * @param value a boolean indicating whether or not the project is the default project. (Default: "false")
     */
    @JvmName("ctnpqsalrddobmed")
    public suspend fun isDefault(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.isDefault = mapped
    }

    /**
     * @param value The name of the Project
     */
    @JvmName("qprvadqbtjbyudwg")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value the purpose of the project, (Default: "Web Application")
     */
    @JvmName("ridhcrymjmvxbmmf")
    public suspend fun purpose(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.purpose = mapped
    }

    /**
     * @param value a list of uniform resource names (URNs) for the resources associated with the project
     */
    @JvmName("htolsuossyjxdmel")
    public suspend fun resources(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resources = mapped
    }

    /**
     * @param values a list of uniform resource names (URNs) for the resources associated with the project
     */
    @JvmName("viwvaxhpleqkplba")
    public suspend fun resources(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.resources = mapped
    }

    internal fun build(): ProjectArgs = ProjectArgs(
        description = description,
        environment = environment,
        isDefault = isDefault,
        name = name,
        purpose = purpose,
        resources = resources,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy