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

com.pulumi.gcp.dataplex.kotlin.AssetArgs.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.core.Output.of
import com.pulumi.gcp.dataplex.AssetArgs.builder
import com.pulumi.gcp.dataplex.kotlin.inputs.AssetDiscoverySpecArgs
import com.pulumi.gcp.dataplex.kotlin.inputs.AssetDiscoverySpecArgsBuilder
import com.pulumi.gcp.dataplex.kotlin.inputs.AssetResourceSpecArgs
import com.pulumi.gcp.dataplex.kotlin.inputs.AssetResourceSpecArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * The Dataplex Asset resource
 * ## Example Usage
 * ### Basic_asset
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const basicBucket = new gcp.storage.Bucket("basic_bucket", {
 *     name: "bucket",
 *     location: "us-west1",
 *     uniformBucketLevelAccess: true,
 *     project: "my-project-name",
 * });
 * const basicLake = new gcp.dataplex.Lake("basic_lake", {
 *     name: "lake",
 *     location: "us-west1",
 *     project: "my-project-name",
 * });
 * const basicZone = new gcp.dataplex.Zone("basic_zone", {
 *     name: "zone",
 *     location: "us-west1",
 *     lake: basicLake.name,
 *     type: "RAW",
 *     discoverySpec: {
 *         enabled: false,
 *     },
 *     resourceSpec: {
 *         locationType: "SINGLE_REGION",
 *     },
 *     project: "my-project-name",
 * });
 * const primary = new gcp.dataplex.Asset("primary", {
 *     name: "asset",
 *     location: "us-west1",
 *     lake: basicLake.name,
 *     dataplexZone: basicZone.name,
 *     discoverySpec: {
 *         enabled: false,
 *     },
 *     resourceSpec: {
 *         name: "projects/my-project-name/buckets/bucket",
 *         type: "STORAGE_BUCKET",
 *     },
 *     labels: {
 *         env: "foo",
 *         "my-asset": "exists",
 *     },
 *     project: "my-project-name",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * basic_bucket = gcp.storage.Bucket("basic_bucket",
 *     name="bucket",
 *     location="us-west1",
 *     uniform_bucket_level_access=True,
 *     project="my-project-name")
 * basic_lake = gcp.dataplex.Lake("basic_lake",
 *     name="lake",
 *     location="us-west1",
 *     project="my-project-name")
 * basic_zone = gcp.dataplex.Zone("basic_zone",
 *     name="zone",
 *     location="us-west1",
 *     lake=basic_lake.name,
 *     type="RAW",
 *     discovery_spec=gcp.dataplex.ZoneDiscoverySpecArgs(
 *         enabled=False,
 *     ),
 *     resource_spec=gcp.dataplex.ZoneResourceSpecArgs(
 *         location_type="SINGLE_REGION",
 *     ),
 *     project="my-project-name")
 * primary = gcp.dataplex.Asset("primary",
 *     name="asset",
 *     location="us-west1",
 *     lake=basic_lake.name,
 *     dataplex_zone=basic_zone.name,
 *     discovery_spec=gcp.dataplex.AssetDiscoverySpecArgs(
 *         enabled=False,
 *     ),
 *     resource_spec=gcp.dataplex.AssetResourceSpecArgs(
 *         name="projects/my-project-name/buckets/bucket",
 *         type="STORAGE_BUCKET",
 *     ),
 *     labels={
 *         "env": "foo",
 *         "my-asset": "exists",
 *     },
 *     project="my-project-name")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var basicBucket = new Gcp.Storage.Bucket("basic_bucket", new()
 *     {
 *         Name = "bucket",
 *         Location = "us-west1",
 *         UniformBucketLevelAccess = true,
 *         Project = "my-project-name",
 *     });
 *     var basicLake = new Gcp.DataPlex.Lake("basic_lake", new()
 *     {
 *         Name = "lake",
 *         Location = "us-west1",
 *         Project = "my-project-name",
 *     });
 *     var basicZone = new Gcp.DataPlex.Zone("basic_zone", new()
 *     {
 *         Name = "zone",
 *         Location = "us-west1",
 *         Lake = basicLake.Name,
 *         Type = "RAW",
 *         DiscoverySpec = new Gcp.DataPlex.Inputs.ZoneDiscoverySpecArgs
 *         {
 *             Enabled = false,
 *         },
 *         ResourceSpec = new Gcp.DataPlex.Inputs.ZoneResourceSpecArgs
 *         {
 *             LocationType = "SINGLE_REGION",
 *         },
 *         Project = "my-project-name",
 *     });
 *     var primary = new Gcp.DataPlex.Asset("primary", new()
 *     {
 *         Name = "asset",
 *         Location = "us-west1",
 *         Lake = basicLake.Name,
 *         DataplexZone = basicZone.Name,
 *         DiscoverySpec = new Gcp.DataPlex.Inputs.AssetDiscoverySpecArgs
 *         {
 *             Enabled = false,
 *         },
 *         ResourceSpec = new Gcp.DataPlex.Inputs.AssetResourceSpecArgs
 *         {
 *             Name = "projects/my-project-name/buckets/bucket",
 *             Type = "STORAGE_BUCKET",
 *         },
 *         Labels =
 *         {
 *             { "env", "foo" },
 *             { "my-asset", "exists" },
 *         },
 *         Project = "my-project-name",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/dataplex"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/storage"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := storage.NewBucket(ctx, "basic_bucket", &storage.BucketArgs{
 * 			Name:                     pulumi.String("bucket"),
 * 			Location:                 pulumi.String("us-west1"),
 * 			UniformBucketLevelAccess: pulumi.Bool(true),
 * 			Project:                  pulumi.String("my-project-name"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		basicLake, err := dataplex.NewLake(ctx, "basic_lake", &dataplex.LakeArgs{
 * 			Name:     pulumi.String("lake"),
 * 			Location: pulumi.String("us-west1"),
 * 			Project:  pulumi.String("my-project-name"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		basicZone, err := dataplex.NewZone(ctx, "basic_zone", &dataplex.ZoneArgs{
 * 			Name:     pulumi.String("zone"),
 * 			Location: pulumi.String("us-west1"),
 * 			Lake:     basicLake.Name,
 * 			Type:     pulumi.String("RAW"),
 * 			DiscoverySpec: &dataplex.ZoneDiscoverySpecArgs{
 * 				Enabled: pulumi.Bool(false),
 * 			},
 * 			ResourceSpec: &dataplex.ZoneResourceSpecArgs{
 * 				LocationType: pulumi.String("SINGLE_REGION"),
 * 			},
 * 			Project: pulumi.String("my-project-name"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = dataplex.NewAsset(ctx, "primary", &dataplex.AssetArgs{
 * 			Name:         pulumi.String("asset"),
 * 			Location:     pulumi.String("us-west1"),
 * 			Lake:         basicLake.Name,
 * 			DataplexZone: basicZone.Name,
 * 			DiscoverySpec: &dataplex.AssetDiscoverySpecArgs{
 * 				Enabled: pulumi.Bool(false),
 * 			},
 * 			ResourceSpec: &dataplex.AssetResourceSpecArgs{
 * 				Name: pulumi.String("projects/my-project-name/buckets/bucket"),
 * 				Type: pulumi.String("STORAGE_BUCKET"),
 * 			},
 * 			Labels: pulumi.StringMap{
 * 				"env":      pulumi.String("foo"),
 * 				"my-asset": pulumi.String("exists"),
 * 			},
 * 			Project: pulumi.String("my-project-name"),
 * 		})
 * 		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.storage.Bucket;
 * import com.pulumi.gcp.storage.BucketArgs;
 * 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 com.pulumi.gcp.dataplex.Asset;
 * import com.pulumi.gcp.dataplex.AssetArgs;
 * import com.pulumi.gcp.dataplex.inputs.AssetDiscoverySpecArgs;
 * import com.pulumi.gcp.dataplex.inputs.AssetResourceSpecArgs;
 * 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 basicBucket = new Bucket("basicBucket", BucketArgs.builder()
 *             .name("bucket")
 *             .location("us-west1")
 *             .uniformBucketLevelAccess(true)
 *             .project("my-project-name")
 *             .build());
 *         var basicLake = new Lake("basicLake", LakeArgs.builder()
 *             .name("lake")
 *             .location("us-west1")
 *             .project("my-project-name")
 *             .build());
 *         var basicZone = new Zone("basicZone", ZoneArgs.builder()
 *             .name("zone")
 *             .location("us-west1")
 *             .lake(basicLake.name())
 *             .type("RAW")
 *             .discoverySpec(ZoneDiscoverySpecArgs.builder()
 *                 .enabled(false)
 *                 .build())
 *             .resourceSpec(ZoneResourceSpecArgs.builder()
 *                 .locationType("SINGLE_REGION")
 *                 .build())
 *             .project("my-project-name")
 *             .build());
 *         var primary = new Asset("primary", AssetArgs.builder()
 *             .name("asset")
 *             .location("us-west1")
 *             .lake(basicLake.name())
 *             .dataplexZone(basicZone.name())
 *             .discoverySpec(AssetDiscoverySpecArgs.builder()
 *                 .enabled(false)
 *                 .build())
 *             .resourceSpec(AssetResourceSpecArgs.builder()
 *                 .name("projects/my-project-name/buckets/bucket")
 *                 .type("STORAGE_BUCKET")
 *                 .build())
 *             .labels(Map.ofEntries(
 *                 Map.entry("env", "foo"),
 *                 Map.entry("my-asset", "exists")
 *             ))
 *             .project("my-project-name")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   basicBucket:
 *     type: gcp:storage:Bucket
 *     name: basic_bucket
 *     properties:
 *       name: bucket
 *       location: us-west1
 *       uniformBucketLevelAccess: true
 *       project: my-project-name
 *   basicLake:
 *     type: gcp:dataplex:Lake
 *     name: basic_lake
 *     properties:
 *       name: lake
 *       location: us-west1
 *       project: my-project-name
 *   basicZone:
 *     type: gcp:dataplex:Zone
 *     name: basic_zone
 *     properties:
 *       name: zone
 *       location: us-west1
 *       lake: ${basicLake.name}
 *       type: RAW
 *       discoverySpec:
 *         enabled: false
 *       resourceSpec:
 *         locationType: SINGLE_REGION
 *       project: my-project-name
 *   primary:
 *     type: gcp:dataplex:Asset
 *     properties:
 *       name: asset
 *       location: us-west1
 *       lake: ${basicLake.name}
 *       dataplexZone: ${basicZone.name}
 *       discoverySpec:
 *         enabled: false
 *       resourceSpec:
 *         name: projects/my-project-name/buckets/bucket
 *         type: STORAGE_BUCKET
 *       labels:
 *         env: foo
 *         my-asset: exists
 *       project: my-project-name
 * ```
 * 
 * ## Import
 * Asset can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/{{location}}/lakes/{{lake}}/zones/{{dataplex_zone}}/assets/{{name}}`
 * * `{{project}}/{{location}}/{{lake}}/{{dataplex_zone}}/{{name}}`
 * * `{{location}}/{{lake}}/{{dataplex_zone}}/{{name}}`
 * When using the `pulumi import` command, Asset can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:dataplex/asset:Asset default projects/{{project}}/locations/{{location}}/lakes/{{lake}}/zones/{{dataplex_zone}}/assets/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:dataplex/asset:Asset default {{project}}/{{location}}/{{lake}}/{{dataplex_zone}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:dataplex/asset:Asset default {{location}}/{{lake}}/{{dataplex_zone}}/{{name}}
 * ```
 * @property dataplexZone The zone for the resource
 * @property description Optional. Description of the asset.
 * @property discoverySpec Required. Specification of the discovery feature applied to data referenced by this asset. When this spec is left unset, the asset will use the spec set on the parent zone.
 * @property displayName Optional. User friendly display name.
 * @property labels Optional. User defined labels for the asset. **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.
 * @property lake The lake for the resource
 * @property location The location for the resource
 * @property name The name of the asset.
 * @property project The project for the resource
 * @property resourceSpec Required. Immutable. Specification of the resource that is referenced by this asset.
 */
public data class AssetArgs(
    public val dataplexZone: Output? = null,
    public val description: Output? = null,
    public val discoverySpec: Output? = null,
    public val displayName: Output? = null,
    public val labels: Output>? = null,
    public val lake: Output? = null,
    public val location: Output? = null,
    public val name: Output? = null,
    public val project: Output? = null,
    public val resourceSpec: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.dataplex.AssetArgs =
        com.pulumi.gcp.dataplex.AssetArgs.builder()
            .dataplexZone(dataplexZone?.applyValue({ args0 -> args0 }))
            .description(description?.applyValue({ args0 -> args0 }))
            .discoverySpec(discoverySpec?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .displayName(displayName?.applyValue({ args0 -> args0 }))
            .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .lake(lake?.applyValue({ args0 -> args0 }))
            .location(location?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .resourceSpec(resourceSpec?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) })).build()
}

/**
 * Builder for [AssetArgs].
 */
@PulumiTagMarker
public class AssetArgsBuilder internal constructor() {
    private var dataplexZone: Output? = null

    private var description: Output? = null

    private var discoverySpec: Output? = null

    private var displayName: Output? = null

    private var labels: Output>? = null

    private var lake: Output? = null

    private var location: Output? = null

    private var name: Output? = null

    private var project: Output? = null

    private var resourceSpec: Output? = null

    /**
     * @param value The zone for the resource
     */
    @JvmName("ucwwyagxyenclwdk")
    public suspend fun dataplexZone(`value`: Output) {
        this.dataplexZone = value
    }

    /**
     * @param value Optional. Description of the asset.
     */
    @JvmName("rbaqdimhhvxturhx")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value Required. Specification of the discovery feature applied to data referenced by this asset. When this spec is left unset, the asset will use the spec set on the parent zone.
     */
    @JvmName("awacluuicobcgmhu")
    public suspend fun discoverySpec(`value`: Output) {
        this.discoverySpec = value
    }

    /**
     * @param value Optional. User friendly display name.
     */
    @JvmName("fmmdbwywhlwmswkw")
    public suspend fun displayName(`value`: Output) {
        this.displayName = value
    }

    /**
     * @param value Optional. User defined labels for the asset. **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.
     */
    @JvmName("xttmitjbcljwdukw")
    public suspend fun labels(`value`: Output>) {
        this.labels = value
    }

    /**
     * @param value The lake for the resource
     */
    @JvmName("tgefnefxprttofog")
    public suspend fun lake(`value`: Output) {
        this.lake = value
    }

    /**
     * @param value The location for the resource
     */
    @JvmName("ptityphrtgfjghhp")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

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

    /**
     * @param value The project for the resource
     */
    @JvmName("rshgmeoywqcofabc")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value Required. Immutable. Specification of the resource that is referenced by this asset.
     */
    @JvmName("vgynrowsbnhlsotb")
    public suspend fun resourceSpec(`value`: Output) {
        this.resourceSpec = value
    }

    /**
     * @param value The zone for the resource
     */
    @JvmName("moirxxdtgirkxdja")
    public suspend fun dataplexZone(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.dataplexZone = mapped
    }

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

    /**
     * @param value Required. Specification of the discovery feature applied to data referenced by this asset. When this spec is left unset, the asset will use the spec set on the parent zone.
     */
    @JvmName("flilfrpasowjwyal")
    public suspend fun discoverySpec(`value`: AssetDiscoverySpecArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.discoverySpec = mapped
    }

    /**
     * @param argument Required. Specification of the discovery feature applied to data referenced by this asset. When this spec is left unset, the asset will use the spec set on the parent zone.
     */
    @JvmName("ijtifvlswkjcefxi")
    public suspend fun discoverySpec(argument: suspend AssetDiscoverySpecArgsBuilder.() -> Unit) {
        val toBeMapped = AssetDiscoverySpecArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.discoverySpec = mapped
    }

    /**
     * @param value Optional. User friendly display name.
     */
    @JvmName("wniqnbhfhctuxlbx")
    public suspend fun displayName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.displayName = mapped
    }

    /**
     * @param value Optional. User defined labels for the asset. **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.
     */
    @JvmName("hqrkkfcxcfdicyxm")
    public suspend fun labels(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param values Optional. User defined labels for the asset. **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.
     */
    @JvmName("tfrbwmlyogrjwbst")
    public fun labels(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labels = mapped
    }

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

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

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

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

    /**
     * @param value Required. Immutable. Specification of the resource that is referenced by this asset.
     */
    @JvmName("syrguampvtomqanh")
    public suspend fun resourceSpec(`value`: AssetResourceSpecArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceSpec = mapped
    }

    /**
     * @param argument Required. Immutable. Specification of the resource that is referenced by this asset.
     */
    @JvmName("dnyuwdapsdpffnyj")
    public suspend fun resourceSpec(argument: suspend AssetResourceSpecArgsBuilder.() -> Unit) {
        val toBeMapped = AssetResourceSpecArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.resourceSpec = mapped
    }

    internal fun build(): AssetArgs = AssetArgs(
        dataplexZone = dataplexZone,
        description = description,
        discoverySpec = discoverySpec,
        displayName = displayName,
        labels = labels,
        lake = lake,
        location = location,
        name = name,
        project = project,
        resourceSpec = resourceSpec,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy