Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.pulumi.digitalocean.kotlin.Project.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.digitalocean.kotlin
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
/**
* Builder for [Project].
*/
@PulumiTagMarker
public class ProjectResourceBuilder internal constructor() {
public var name: String? = null
public var args: ProjectArgs = ProjectArgs()
public var opts: CustomResourceOptions = CustomResourceOptions()
/**
* @param name The _unique_ name of the resulting resource.
*/
public fun name(`value`: String) {
this.name = value
}
/**
* @param block The arguments to use to populate this resource's properties.
*/
public suspend fun args(block: suspend ProjectArgsBuilder.() -> Unit) {
val builder = ProjectArgsBuilder()
block(builder)
this.args = builder.build()
}
/**
* @param block A bag of options that control this resource's behavior.
*/
public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
}
internal fun build(): Project {
val builtJavaResource = com.pulumi.digitalocean.Project(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Project(builtJavaResource)
}
}
/**
* 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
* ```
*/
public class Project internal constructor(
override val javaResource: com.pulumi.digitalocean.Project,
) : KotlinCustomResource(javaResource, ProjectMapper) {
/**
* the date and time when the project was created, (ISO8601)
*/
public val createdAt: Output
get() = javaResource.createdAt().applyValue({ args0 -> args0 })
/**
* the description of the project
*/
public val description: Output?
get() = javaResource.description().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* the environment of the project's resources. The possible values are: `Development`, `Staging`, `Production`)
*/
public val environment: Output?
get() = javaResource.environment().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* a boolean indicating whether or not the project is the default project. (Default: "false")
*/
public val isDefault: Output?
get() = javaResource.isDefault().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The name of the Project
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* the id of the project owner.
*/
public val ownerId: Output
get() = javaResource.ownerId().applyValue({ args0 -> args0 })
/**
* the unique universal identifier of the project owner.
*/
public val ownerUuid: Output
get() = javaResource.ownerUuid().applyValue({ args0 -> args0 })
/**
* the purpose of the project, (Default: "Web Application")
*/
public val purpose: Output?
get() = javaResource.purpose().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* a list of uniform resource names (URNs) for the resources associated with the project
*/
public val resources: Output>
get() = javaResource.resources().applyValue({ args0 -> args0.map({ args0 -> args0 }) })
/**
* the date and time when the project was last updated, (ISO8601)
*/
public val updatedAt: Output
get() = javaResource.updatedAt().applyValue({ args0 -> args0 })
}
public object ProjectMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.digitalocean.Project::class == javaResource::class
override fun map(javaResource: Resource): Project = Project(
javaResource as
com.pulumi.digitalocean.Project,
)
}
/**
* @see [Project].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Project].
*/
public suspend fun project(name: String, block: suspend ProjectResourceBuilder.() -> Unit): Project {
val builder = ProjectResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Project].
* @param name The _unique_ name of the resulting resource.
*/
public fun project(name: String): Project {
val builder = ProjectResourceBuilder()
builder.name(name)
return builder.build()
}