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

com.pulumi.gcp.dataplex.kotlin.Zone.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.10.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.dataplex.kotlin

import com.pulumi.core.Output
import com.pulumi.gcp.dataplex.kotlin.outputs.ZoneAssetStatus
import com.pulumi.gcp.dataplex.kotlin.outputs.ZoneDiscoverySpec
import com.pulumi.gcp.dataplex.kotlin.outputs.ZoneResourceSpec
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.Any
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import com.pulumi.gcp.dataplex.kotlin.outputs.ZoneAssetStatus.Companion.toKotlin as zoneAssetStatusToKotlin
import com.pulumi.gcp.dataplex.kotlin.outputs.ZoneDiscoverySpec.Companion.toKotlin as zoneDiscoverySpecToKotlin
import com.pulumi.gcp.dataplex.kotlin.outputs.ZoneResourceSpec.Companion.toKotlin as zoneResourceSpecToKotlin

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

    public var args: ZoneArgs = ZoneArgs()

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

/**
 * The Dataplex Zone resource
 * ## Example Usage
 * ### Basic_zone
 * A basic example of a dataplex zone
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const basic = new gcp.dataplex.Lake("basic", {
 *     location: "us-west1",
 *     name: "lake",
 *     description: "Lake for DCL",
 *     displayName: "Lake for DCL",
 *     project: "my-project-name",
 *     labels: {
 *         "my-lake": "exists",
 *     },
 * });
 * const primary = new gcp.dataplex.Zone("primary", {
 *     discoverySpec: {
 *         enabled: false,
 *     },
 *     lake: basic.name,
 *     location: "us-west1",
 *     name: "zone",
 *     resourceSpec: {
 *         locationType: "MULTI_REGION",
 *     },
 *     type: "RAW",
 *     description: "Zone for DCL",
 *     displayName: "Zone for DCL",
 *     project: "my-project-name",
 *     labels: {},
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * basic = gcp.dataplex.Lake("basic",
 *     location="us-west1",
 *     name="lake",
 *     description="Lake for DCL",
 *     display_name="Lake for DCL",
 *     project="my-project-name",
 *     labels={
 *         "my-lake": "exists",
 *     })
 * primary = gcp.dataplex.Zone("primary",
 *     discovery_spec=gcp.dataplex.ZoneDiscoverySpecArgs(
 *         enabled=False,
 *     ),
 *     lake=basic.name,
 *     location="us-west1",
 *     name="zone",
 *     resource_spec=gcp.dataplex.ZoneResourceSpecArgs(
 *         location_type="MULTI_REGION",
 *     ),
 *     type="RAW",
 *     description="Zone for DCL",
 *     display_name="Zone for DCL",
 *     project="my-project-name",
 *     labels={})
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var basic = new Gcp.DataPlex.Lake("basic", new()
 *     {
 *         Location = "us-west1",
 *         Name = "lake",
 *         Description = "Lake for DCL",
 *         DisplayName = "Lake for DCL",
 *         Project = "my-project-name",
 *         Labels =
 *         {
 *             { "my-lake", "exists" },
 *         },
 *     });
 *     var primary = new Gcp.DataPlex.Zone("primary", new()
 *     {
 *         DiscoverySpec = new Gcp.DataPlex.Inputs.ZoneDiscoverySpecArgs
 *         {
 *             Enabled = false,
 *         },
 *         Lake = basic.Name,
 *         Location = "us-west1",
 *         Name = "zone",
 *         ResourceSpec = new Gcp.DataPlex.Inputs.ZoneResourceSpecArgs
 *         {
 *             LocationType = "MULTI_REGION",
 *         },
 *         Type = "RAW",
 *         Description = "Zone for DCL",
 *         DisplayName = "Zone for DCL",
 *         Project = "my-project-name",
 *         Labels = null,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/dataplex"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		basic, err := dataplex.NewLake(ctx, "basic", &dataplex.LakeArgs{
 * 			Location:    pulumi.String("us-west1"),
 * 			Name:        pulumi.String("lake"),
 * 			Description: pulumi.String("Lake for DCL"),
 * 			DisplayName: pulumi.String("Lake for DCL"),
 * 			Project:     pulumi.String("my-project-name"),
 * 			Labels: pulumi.StringMap{
 * 				"my-lake": pulumi.String("exists"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = dataplex.NewZone(ctx, "primary", &dataplex.ZoneArgs{
 * 			DiscoverySpec: &dataplex.ZoneDiscoverySpecArgs{
 * 				Enabled: pulumi.Bool(false),
 * 			},
 * 			Lake:     basic.Name,
 * 			Location: pulumi.String("us-west1"),
 * 			Name:     pulumi.String("zone"),
 * 			ResourceSpec: &dataplex.ZoneResourceSpecArgs{
 * 				LocationType: pulumi.String("MULTI_REGION"),
 * 			},
 * 			Type:        pulumi.String("RAW"),
 * 			Description: pulumi.String("Zone for DCL"),
 * 			DisplayName: pulumi.String("Zone for DCL"),
 * 			Project:     pulumi.String("my-project-name"),
 * 			Labels:      nil,
 * 		})
 * 		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.dataplex.Lake;
 * import com.pulumi.gcp.dataplex.LakeArgs;
 * import com.pulumi.gcp.dataplex.Zone;
 * import com.pulumi.gcp.dataplex.ZoneArgs;
 * import com.pulumi.gcp.dataplex.inputs.ZoneDiscoverySpecArgs;
 * import com.pulumi.gcp.dataplex.inputs.ZoneResourceSpecArgs;
 * 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 basic = new Lake("basic", LakeArgs.builder()
 *             .location("us-west1")
 *             .name("lake")
 *             .description("Lake for DCL")
 *             .displayName("Lake for DCL")
 *             .project("my-project-name")
 *             .labels(Map.of("my-lake", "exists"))
 *             .build());
 *         var primary = new Zone("primary", ZoneArgs.builder()
 *             .discoverySpec(ZoneDiscoverySpecArgs.builder()
 *                 .enabled(false)
 *                 .build())
 *             .lake(basic.name())
 *             .location("us-west1")
 *             .name("zone")
 *             .resourceSpec(ZoneResourceSpecArgs.builder()
 *                 .locationType("MULTI_REGION")
 *                 .build())
 *             .type("RAW")
 *             .description("Zone for DCL")
 *             .displayName("Zone for DCL")
 *             .project("my-project-name")
 *             .labels()
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   primary:
 *     type: gcp:dataplex:Zone
 *     properties:
 *       discoverySpec:
 *         enabled: false
 *       lake: ${basic.name}
 *       location: us-west1
 *       name: zone
 *       resourceSpec:
 *         locationType: MULTI_REGION
 *       type: RAW
 *       description: Zone for DCL
 *       displayName: Zone for DCL
 *       project: my-project-name
 *       labels: {}
 *   basic:
 *     type: gcp:dataplex:Lake
 *     properties:
 *       location: us-west1
 *       name: lake
 *       description: Lake for DCL
 *       displayName: Lake for DCL
 *       project: my-project-name
 *       labels:
 *         my-lake: exists
 * ```
 * 
 * ## Import
 * Zone can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/{{location}}/lakes/{{lake}}/zones/{{name}}`
 * * `{{project}}/{{location}}/{{lake}}/{{name}}`
 * * `{{location}}/{{lake}}/{{name}}`
 * When using the `pulumi import` command, Zone can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:dataplex/zone:Zone default projects/{{project}}/locations/{{location}}/lakes/{{lake}}/zones/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:dataplex/zone:Zone default {{project}}/{{location}}/{{lake}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:dataplex/zone:Zone default {{location}}/{{lake}}/{{name}}
 * ```
 */
public class Zone internal constructor(
    override val javaResource: com.pulumi.gcp.dataplex.Zone,
) : KotlinCustomResource(javaResource, ZoneMapper) {
    /**
     * Output only. Aggregated status of the underlying assets of the zone.
     */
    public val assetStatuses: Output>
        get() = javaResource.assetStatuses().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> zoneAssetStatusToKotlin(args0) })
            })
        })

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

    /**
     * Optional. Description of the zone.
     */
    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Required. Specification of the discovery feature applied to data in this zone.
     */
    public val discoverySpec: Output
        get() = javaResource.discoverySpec().applyValue({ args0 ->
            args0.let({ args0 ->
                zoneDiscoverySpecToKotlin(args0)
            })
        })

    /**
     * Optional. User friendly display name.
     */
    public val displayName: Output?
        get() = javaResource.displayName().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * 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()
        })

    /**
     * Optional. User defined labels for the zone. **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 lake for the resource
     */
    public val lake: Output
        get() = javaResource.lake().applyValue({ args0 -> args0 })

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

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

    /**
     * The project for the resource
     */
    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()
        })

    /**
     * Required. Immutable. Specification of the resources that are referenced by the assets within this zone.
     */
    public val resourceSpec: Output
        get() = javaResource.resourceSpec().applyValue({ args0 ->
            args0.let({ args0 ->
                zoneResourceSpecToKotlin(args0)
            })
        })

    /**
     * Output only. Current state of the zone. Possible values: STATE_UNSPECIFIED, ACTIVE, CREATING, DELETING, ACTION_REQUIRED
     */
    public val state: Output
        get() = javaResource.state().applyValue({ args0 -> args0 })

    /**
     * Required. Immutable. The type of the zone. Possible values: TYPE_UNSPECIFIED, RAW, CURATED
     */
    public val type: Output
        get() = javaResource.type().applyValue({ args0 -> args0 })

    /**
     * Output only. System generated globally unique ID for the zone. This ID will be different if the zone is deleted and re-created with the same name.
     */
    public val uid: Output
        get() = javaResource.uid().applyValue({ args0 -> args0 })

    /**
     * Output only. The time when the zone was last updated.
     */
    public val updateTime: Output
        get() = javaResource.updateTime().applyValue({ args0 -> args0 })
}

public object ZoneMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.dataplex.Zone::class == javaResource::class

    override fun map(javaResource: Resource): Zone = Zone(
        javaResource as
            com.pulumi.gcp.dataplex.Zone,
    )
}

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy