com.pulumi.aws.codecatalyst.kotlin.Project.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-kotlin Show documentation
Show all versions of pulumi-aws-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.aws.codecatalyst.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.String
import kotlin.Suppress
import kotlin.Unit
/**
* 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.aws.codecatalyst.Project(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Project(builtJavaResource)
}
}
/**
* Resource for managing an AWS CodeCatalyst Project.
* ## Example Usage
* ### Basic Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* const test = new aws.codecatalyst.Project("test", {
* spaceName: "myproject",
* displayName: "MyProject",
* description: "My CodeCatalyst Project created using Pulumi",
* });
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* test = aws.codecatalyst.Project("test",
* space_name="myproject",
* display_name="MyProject",
* description="My CodeCatalyst Project created using Pulumi")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var test = new Aws.CodeCatalyst.Project("test", new()
* {
* SpaceName = "myproject",
* DisplayName = "MyProject",
* Description = "My CodeCatalyst Project created using Pulumi",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/codecatalyst"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := codecatalyst.NewProject(ctx, "test", &codecatalyst.ProjectArgs{
* SpaceName: pulumi.String("myproject"),
* DisplayName: pulumi.String("MyProject"),
* Description: pulumi.String("My CodeCatalyst Project created using Pulumi"),
* })
* 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.aws.codecatalyst.Project;
* import com.pulumi.aws.codecatalyst.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 test = new Project("test", ProjectArgs.builder()
* .spaceName("myproject")
* .displayName("MyProject")
* .description("My CodeCatalyst Project created using Pulumi")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* test:
* type: aws:codecatalyst:Project
* properties:
* spaceName: myproject
* displayName: MyProject
* description: My CodeCatalyst Project created using Pulumi
* ```
*
* ## Import
* Using `pulumi import`, import CodeCatalyst Project using the `id`. For example:
* ```sh
* $ pulumi import aws:codecatalyst/project:Project example project-id-12345678
* ```
*/
public class Project internal constructor(
override val javaResource: com.pulumi.aws.codecatalyst.Project,
) : KotlinCustomResource(javaResource, ProjectMapper) {
/**
* The description of the project. This description will be displayed to all users of the project. We recommend providing a brief description of the project and its intended purpose.
*/
public val description: Output?
get() = javaResource.description().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The friendly name of the project that will be displayed to users.
* The following arguments are optional:
*/
public val displayName: Output
get() = javaResource.displayName().applyValue({ args0 -> args0 })
/**
* The name of the project in the space.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* The name of the space.
*/
public val spaceName: Output
get() = javaResource.spaceName().applyValue({ args0 -> args0 })
}
public object ProjectMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.aws.codecatalyst.Project::class == javaResource::class
override fun map(javaResource: Resource): Project = Project(
javaResource as
com.pulumi.aws.codecatalyst.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()
}