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

com.pulumi.gcp.dataproc.kotlin.GdcApplicationEnvironment.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 8.20.1.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.dataproc.kotlin

import com.pulumi.core.Output
import com.pulumi.gcp.dataproc.kotlin.outputs.GdcApplicationEnvironmentSparkApplicationEnvironmentConfig
import com.pulumi.gcp.dataproc.kotlin.outputs.GdcApplicationEnvironmentSparkApplicationEnvironmentConfig.Companion.toKotlin
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
import kotlin.collections.Map

/**
 * Builder for [GdcApplicationEnvironment].
 */
@PulumiTagMarker
public class GdcApplicationEnvironmentResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: GdcApplicationEnvironmentArgs = GdcApplicationEnvironmentArgs()

    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 GdcApplicationEnvironmentArgsBuilder.() -> Unit) {
        val builder = GdcApplicationEnvironmentArgsBuilder()
        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(): GdcApplicationEnvironment {
        val builtJavaResource =
            com.pulumi.gcp.dataproc.GdcApplicationEnvironment(
                this.name,
                this.args.toJava(),
                this.opts.toJava(),
            )
        return GdcApplicationEnvironment(builtJavaResource)
    }
}

/**
 * An ApplicationEnvironment contains shared configuration that may be referenced by multiple SparkApplications.
 * To get more information about ApplicationEnvironment, see:
 * * [API documentation](https://cloud.google.com/dataproc-gdc/docs/reference/rest/v1/projects.locations.applicationEnvironments)
 * * How-to Guides
 *     * [Dataproc Intro](https://cloud.google.com/dataproc/)
 * ## Example Usage
 * ### Dataprocgdc Applicationenvironment Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const application_environment = new gcp.dataproc.GdcApplicationEnvironment("application-environment", {
 *     applicationEnvironmentId: "dp-tf-e2e-application-environment-basic",
 *     serviceinstance: "do-not-delete-dataproc-gdc-instance",
 *     project: "my-project",
 *     location: "us-west2",
 *     namespace: "default",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * application_environment = gcp.dataproc.GdcApplicationEnvironment("application-environment",
 *     application_environment_id="dp-tf-e2e-application-environment-basic",
 *     serviceinstance="do-not-delete-dataproc-gdc-instance",
 *     project="my-project",
 *     location="us-west2",
 *     namespace="default")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var application_environment = new Gcp.Dataproc.GdcApplicationEnvironment("application-environment", new()
 *     {
 *         ApplicationEnvironmentId = "dp-tf-e2e-application-environment-basic",
 *         Serviceinstance = "do-not-delete-dataproc-gdc-instance",
 *         Project = "my-project",
 *         Location = "us-west2",
 *         Namespace = "default",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/dataproc"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := dataproc.NewGdcApplicationEnvironment(ctx, "application-environment", &dataproc.GdcApplicationEnvironmentArgs{
 * 			ApplicationEnvironmentId: pulumi.String("dp-tf-e2e-application-environment-basic"),
 * 			Serviceinstance:          pulumi.String("do-not-delete-dataproc-gdc-instance"),
 * 			Project:                  pulumi.String("my-project"),
 * 			Location:                 pulumi.String("us-west2"),
 * 			Namespace:                pulumi.String("default"),
 * 		})
 * 		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.gcp.dataproc.GdcApplicationEnvironment;
 * import com.pulumi.gcp.dataproc.GdcApplicationEnvironmentArgs;
 * 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 application_environment = new GdcApplicationEnvironment("application-environment", GdcApplicationEnvironmentArgs.builder()
 *             .applicationEnvironmentId("dp-tf-e2e-application-environment-basic")
 *             .serviceinstance("do-not-delete-dataproc-gdc-instance")
 *             .project("my-project")
 *             .location("us-west2")
 *             .namespace("default")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   application-environment:
 *     type: gcp:dataproc:GdcApplicationEnvironment
 *     properties:
 *       applicationEnvironmentId: dp-tf-e2e-application-environment-basic
 *       serviceinstance: do-not-delete-dataproc-gdc-instance
 *       project: my-project
 *       location: us-west2
 *       namespace: default
 * ```
 * 
 * ### Dataprocgdc Applicationenvironment
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const application_environment = new gcp.dataproc.GdcApplicationEnvironment("application-environment", {
 *     applicationEnvironmentId: "dp-tf-e2e-application-environment",
 *     serviceinstance: "do-not-delete-dataproc-gdc-instance",
 *     project: "my-project",
 *     location: "us-west2",
 *     namespace: "default",
 *     displayName: "An application environment",
 *     labels: {
 *         "test-label": "label-value",
 *     },
 *     annotations: {
 *         an_annotation: "annotation_value",
 *     },
 *     sparkApplicationEnvironmentConfig: {
 *         defaultProperties: {
 *             "spark.executor.memory": "4g",
 *         },
 *         defaultVersion: "1.2",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * application_environment = gcp.dataproc.GdcApplicationEnvironment("application-environment",
 *     application_environment_id="dp-tf-e2e-application-environment",
 *     serviceinstance="do-not-delete-dataproc-gdc-instance",
 *     project="my-project",
 *     location="us-west2",
 *     namespace="default",
 *     display_name="An application environment",
 *     labels={
 *         "test-label": "label-value",
 *     },
 *     annotations={
 *         "an_annotation": "annotation_value",
 *     },
 *     spark_application_environment_config={
 *         "default_properties": {
 *             "spark.executor.memory": "4g",
 *         },
 *         "default_version": "1.2",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var application_environment = new Gcp.Dataproc.GdcApplicationEnvironment("application-environment", new()
 *     {
 *         ApplicationEnvironmentId = "dp-tf-e2e-application-environment",
 *         Serviceinstance = "do-not-delete-dataproc-gdc-instance",
 *         Project = "my-project",
 *         Location = "us-west2",
 *         Namespace = "default",
 *         DisplayName = "An application environment",
 *         Labels =
 *         {
 *             { "test-label", "label-value" },
 *         },
 *         Annotations =
 *         {
 *             { "an_annotation", "annotation_value" },
 *         },
 *         SparkApplicationEnvironmentConfig = new Gcp.Dataproc.Inputs.GdcApplicationEnvironmentSparkApplicationEnvironmentConfigArgs
 *         {
 *             DefaultProperties =
 *             {
 *                 { "spark.executor.memory", "4g" },
 *             },
 *             DefaultVersion = "1.2",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/dataproc"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := dataproc.NewGdcApplicationEnvironment(ctx, "application-environment", &dataproc.GdcApplicationEnvironmentArgs{
 * 			ApplicationEnvironmentId: pulumi.String("dp-tf-e2e-application-environment"),
 * 			Serviceinstance:          pulumi.String("do-not-delete-dataproc-gdc-instance"),
 * 			Project:                  pulumi.String("my-project"),
 * 			Location:                 pulumi.String("us-west2"),
 * 			Namespace:                pulumi.String("default"),
 * 			DisplayName:              pulumi.String("An application environment"),
 * 			Labels: pulumi.StringMap{
 * 				"test-label": pulumi.String("label-value"),
 * 			},
 * 			Annotations: pulumi.StringMap{
 * 				"an_annotation": pulumi.String("annotation_value"),
 * 			},
 * 			SparkApplicationEnvironmentConfig: &dataproc.GdcApplicationEnvironmentSparkApplicationEnvironmentConfigArgs{
 * 				DefaultProperties: pulumi.StringMap{
 * 					"spark.executor.memory": pulumi.String("4g"),
 * 				},
 * 				DefaultVersion: pulumi.String("1.2"),
 * 			},
 * 		})
 * 		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.gcp.dataproc.GdcApplicationEnvironment;
 * import com.pulumi.gcp.dataproc.GdcApplicationEnvironmentArgs;
 * import com.pulumi.gcp.dataproc.inputs.GdcApplicationEnvironmentSparkApplicationEnvironmentConfigArgs;
 * 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 application_environment = new GdcApplicationEnvironment("application-environment", GdcApplicationEnvironmentArgs.builder()
 *             .applicationEnvironmentId("dp-tf-e2e-application-environment")
 *             .serviceinstance("do-not-delete-dataproc-gdc-instance")
 *             .project("my-project")
 *             .location("us-west2")
 *             .namespace("default")
 *             .displayName("An application environment")
 *             .labels(Map.of("test-label", "label-value"))
 *             .annotations(Map.of("an_annotation", "annotation_value"))
 *             .sparkApplicationEnvironmentConfig(GdcApplicationEnvironmentSparkApplicationEnvironmentConfigArgs.builder()
 *                 .defaultProperties(Map.of("spark.executor.memory", "4g"))
 *                 .defaultVersion("1.2")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   application-environment:
 *     type: gcp:dataproc:GdcApplicationEnvironment
 *     properties:
 *       applicationEnvironmentId: dp-tf-e2e-application-environment
 *       serviceinstance: do-not-delete-dataproc-gdc-instance
 *       project: my-project
 *       location: us-west2
 *       namespace: default
 *       displayName: An application environment
 *       labels:
 *         test-label: label-value
 *       annotations:
 *         an_annotation: annotation_value
 *       sparkApplicationEnvironmentConfig:
 *         defaultProperties:
 *           spark.executor.memory: 4g
 *         defaultVersion: '1.2'
 * ```
 * 
 * ## Import
 * ApplicationEnvironment can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/{{location}}/serviceInstances/{{serviceinstance}}/applicationEnvironments/{{application_environment_id}}`
 * * `{{project}}/{{location}}/{{serviceinstance}}/{{application_environment_id}}`
 * * `{{location}}/{{serviceinstance}}/{{application_environment_id}}`
 * When using the `pulumi import` command, ApplicationEnvironment can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:dataproc/gdcApplicationEnvironment:GdcApplicationEnvironment default projects/{{project}}/locations/{{location}}/serviceInstances/{{serviceinstance}}/applicationEnvironments/{{application_environment_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:dataproc/gdcApplicationEnvironment:GdcApplicationEnvironment default {{project}}/{{location}}/{{serviceinstance}}/{{application_environment_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:dataproc/gdcApplicationEnvironment:GdcApplicationEnvironment default {{location}}/{{serviceinstance}}/{{application_environment_id}}
 * ```
 */
public class GdcApplicationEnvironment internal constructor(
    override val javaResource: com.pulumi.gcp.dataproc.GdcApplicationEnvironment,
) : KotlinCustomResource(javaResource, GdcApplicationEnvironmentMapper) {
    /**
     * The annotations to associate with this application environment. Annotations may be used to store client information, but are not used by the server.
     * **Note**: This field is non-authoritative, and will only manage the annotations present in your configuration.
     * Please refer to the field `effective_annotations` for all of the annotations present on the resource.
     */
    public val annotations: Output>?
        get() = javaResource.annotations().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * The id of the application environment
     */
    public val applicationEnvironmentId: Output?
        get() = javaResource.applicationEnvironmentId().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The timestamp when the resource was created.
     */
    public val createTime: Output
        get() = javaResource.createTime().applyValue({ args0 -> args0 })

    /**
     * User-provided human-readable name to be used in user interfaces.
     */
    public val displayName: Output?
        get() = javaResource.displayName().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    public val effectiveAnnotations: Output>
        get() = javaResource.effectiveAnnotations().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
     */
    public val effectiveLabels: Output>
        get() = javaResource.effectiveLabels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * The labels to associate with this application environment. Labels may be used for filtering and billing tracking.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    public val labels: Output>?
        get() = javaResource.labels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * The location of the application environment
     */
    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * Identifier. The name of the application environment. Format: projects/{project}/locations/{location}/serviceInstances/{service_instance}/applicationEnvironments/{application_environment_id}
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The name of the namespace in which to create this ApplicationEnvironment. This namespace must already exist in the cluster
     */
    public val namespace: Output?
        get() = javaResource.namespace().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    public val project: Output
        get() = javaResource.project().applyValue({ args0 -> args0 })

    /**
     * The combination of labels configured directly on the resource
     * and default labels configured on the provider.
     */
    public val pulumiLabels: Output>
        get() = javaResource.pulumiLabels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * The id of the service instance to which this application environment belongs.
     * - - -
     */
    public val serviceinstance: Output
        get() = javaResource.serviceinstance().applyValue({ args0 -> args0 })

    /**
     * Represents the SparkApplicationEnvironmentConfig.
     * Structure is documented below.
     */
    public val sparkApplicationEnvironmentConfig:
        Output?
        get() = javaResource.sparkApplicationEnvironmentConfig().applyValue({ args0 ->
            args0.map({ args0 -> args0.let({ args0 -> toKotlin(args0) }) }).orElse(null)
        })

    /**
     * System generated unique identifier for this application environment, formatted as UUID4.
     */
    public val uid: Output
        get() = javaResource.uid().applyValue({ args0 -> args0 })

    /**
     * The timestamp when the resource was most recently updated.
     */
    public val updateTime: Output
        get() = javaResource.updateTime().applyValue({ args0 -> args0 })
}

public object GdcApplicationEnvironmentMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.dataproc.GdcApplicationEnvironment::class == javaResource::class

    override fun map(javaResource: Resource): GdcApplicationEnvironment =
        GdcApplicationEnvironment(javaResource as com.pulumi.gcp.dataproc.GdcApplicationEnvironment)
}

/**
 * @see [GdcApplicationEnvironment].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [GdcApplicationEnvironment].
 */
public suspend fun gdcApplicationEnvironment(
    name: String,
    block: suspend GdcApplicationEnvironmentResourceBuilder.() -> Unit,
): GdcApplicationEnvironment {
    val builder = GdcApplicationEnvironmentResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [GdcApplicationEnvironment].
 * @param name The _unique_ name of the resulting resource.
 */
public fun gdcApplicationEnvironment(name: String): GdcApplicationEnvironment {
    val builder = GdcApplicationEnvironmentResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy