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

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

package com.pulumi.gcp.bigtable.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.bigtable.AuthorizedViewArgs.builder
import com.pulumi.gcp.bigtable.kotlin.inputs.AuthorizedViewSubsetViewArgs
import com.pulumi.gcp.bigtable.kotlin.inputs.AuthorizedViewSubsetViewArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName

/**
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * import * as std from "@pulumi/std";
 * const instance = new gcp.bigtable.Instance("instance", {
 *     name: "tf-instance",
 *     clusters: [{
 *         clusterId: "tf-instance-cluster",
 *         zone: "us-central1-b",
 *         numNodes: 3,
 *         storageType: "HDD",
 *     }],
 * });
 * const table = new gcp.bigtable.Table("table", {
 *     name: "tf-table",
 *     instanceName: instance.name,
 *     splitKeys: [
 *         "a",
 *         "b",
 *         "c",
 *     ],
 *     columnFamilies: [
 *         {
 *             family: "family-first",
 *         },
 *         {
 *             family: "family-second",
 *         },
 *     ],
 *     changeStreamRetention: "24h0m0s",
 * });
 * const authorizedView = new gcp.bigtable.AuthorizedView("authorized_view", {
 *     name: "tf-authorized-view",
 *     instanceName: instance.name,
 *     tableName: table.name,
 *     subsetView: {
 *         rowPrefixes: [std.base64encode({
 *             input: "prefix#",
 *         }).then(invoke => invoke.result)],
 *         familySubsets: [
 *             {
 *                 familyName: "family-first",
 *                 qualifiers: [
 *                     std.base64encode({
 *                         input: "qualifier",
 *                     }).then(invoke => invoke.result),
 *                     std.base64encode({
 *                         input: "qualifier-second",
 *                     }).then(invoke => invoke.result),
 *                 ],
 *             },
 *             {
 *                 familyName: "family-second",
 *                 qualifierPrefixes: [""],
 *             },
 *         ],
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * import pulumi_std as std
 * instance = gcp.bigtable.Instance("instance",
 *     name="tf-instance",
 *     clusters=[{
 *         "cluster_id": "tf-instance-cluster",
 *         "zone": "us-central1-b",
 *         "num_nodes": 3,
 *         "storage_type": "HDD",
 *     }])
 * table = gcp.bigtable.Table("table",
 *     name="tf-table",
 *     instance_name=instance.name,
 *     split_keys=[
 *         "a",
 *         "b",
 *         "c",
 *     ],
 *     column_families=[
 *         {
 *             "family": "family-first",
 *         },
 *         {
 *             "family": "family-second",
 *         },
 *     ],
 *     change_stream_retention="24h0m0s")
 * authorized_view = gcp.bigtable.AuthorizedView("authorized_view",
 *     name="tf-authorized-view",
 *     instance_name=instance.name,
 *     table_name=table.name,
 *     subset_view={
 *         "row_prefixes": [std.base64encode(input="prefix#").result],
 *         "family_subsets": [
 *             {
 *                 "family_name": "family-first",
 *                 "qualifiers": [
 *                     std.base64encode(input="qualifier").result,
 *                     std.base64encode(input="qualifier-second").result,
 *                 ],
 *             },
 *             {
 *                 "family_name": "family-second",
 *                 "qualifier_prefixes": [""],
 *             },
 *         ],
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * using Std = Pulumi.Std;
 * return await Deployment.RunAsync(() =>
 * {
 *     var instance = new Gcp.BigTable.Instance("instance", new()
 *     {
 *         Name = "tf-instance",
 *         Clusters = new[]
 *         {
 *             new Gcp.BigTable.Inputs.InstanceClusterArgs
 *             {
 *                 ClusterId = "tf-instance-cluster",
 *                 Zone = "us-central1-b",
 *                 NumNodes = 3,
 *                 StorageType = "HDD",
 *             },
 *         },
 *     });
 *     var table = new Gcp.BigTable.Table("table", new()
 *     {
 *         Name = "tf-table",
 *         InstanceName = instance.Name,
 *         SplitKeys = new[]
 *         {
 *             "a",
 *             "b",
 *             "c",
 *         },
 *         ColumnFamilies = new[]
 *         {
 *             new Gcp.BigTable.Inputs.TableColumnFamilyArgs
 *             {
 *                 Family = "family-first",
 *             },
 *             new Gcp.BigTable.Inputs.TableColumnFamilyArgs
 *             {
 *                 Family = "family-second",
 *             },
 *         },
 *         ChangeStreamRetention = "24h0m0s",
 *     });
 *     var authorizedView = new Gcp.BigTable.AuthorizedView("authorized_view", new()
 *     {
 *         Name = "tf-authorized-view",
 *         InstanceName = instance.Name,
 *         TableName = table.Name,
 *         SubsetView = new Gcp.BigTable.Inputs.AuthorizedViewSubsetViewArgs
 *         {
 *             RowPrefixes = new[]
 *             {
 *                 Std.Base64encode.Invoke(new()
 *                 {
 *                     Input = "prefix#",
 *                 }).Apply(invoke => invoke.Result),
 *             },
 *             FamilySubsets = new[]
 *             {
 *                 new Gcp.BigTable.Inputs.AuthorizedViewSubsetViewFamilySubsetArgs
 *                 {
 *                     FamilyName = "family-first",
 *                     Qualifiers = new[]
 *                     {
 *                         Std.Base64encode.Invoke(new()
 *                         {
 *                             Input = "qualifier",
 *                         }).Apply(invoke => invoke.Result),
 *                         Std.Base64encode.Invoke(new()
 *                         {
 *                             Input = "qualifier-second",
 *                         }).Apply(invoke => invoke.Result),
 *                     },
 *                 },
 *                 new Gcp.BigTable.Inputs.AuthorizedViewSubsetViewFamilySubsetArgs
 *                 {
 *                     FamilyName = "family-second",
 *                     QualifierPrefixes = new[]
 *                     {
 *                         "",
 *                     },
 *                 },
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/bigtable"
 * 	"github.com/pulumi/pulumi-std/sdk/go/std"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		instance, err := bigtable.NewInstance(ctx, "instance", &bigtable.InstanceArgs{
 * 			Name: pulumi.String("tf-instance"),
 * 			Clusters: bigtable.InstanceClusterArray{
 * 				&bigtable.InstanceClusterArgs{
 * 					ClusterId:   pulumi.String("tf-instance-cluster"),
 * 					Zone:        pulumi.String("us-central1-b"),
 * 					NumNodes:    pulumi.Int(3),
 * 					StorageType: pulumi.String("HDD"),
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		table, err := bigtable.NewTable(ctx, "table", &bigtable.TableArgs{
 * 			Name:         pulumi.String("tf-table"),
 * 			InstanceName: instance.Name,
 * 			SplitKeys: pulumi.StringArray{
 * 				pulumi.String("a"),
 * 				pulumi.String("b"),
 * 				pulumi.String("c"),
 * 			},
 * 			ColumnFamilies: bigtable.TableColumnFamilyArray{
 * 				&bigtable.TableColumnFamilyArgs{
 * 					Family: pulumi.String("family-first"),
 * 				},
 * 				&bigtable.TableColumnFamilyArgs{
 * 					Family: pulumi.String("family-second"),
 * 				},
 * 			},
 * 			ChangeStreamRetention: pulumi.String("24h0m0s"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		invokeBase64encode, err := std.Base64encode(ctx, &std.Base64encodeArgs{
 * 			Input: "prefix#",
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		invokeBase64encode1, err := std.Base64encode(ctx, &std.Base64encodeArgs{
 * 			Input: "qualifier",
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		invokeBase64encode2, err := std.Base64encode(ctx, &std.Base64encodeArgs{
 * 			Input: "qualifier-second",
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = bigtable.NewAuthorizedView(ctx, "authorized_view", &bigtable.AuthorizedViewArgs{
 * 			Name:         pulumi.String("tf-authorized-view"),
 * 			InstanceName: instance.Name,
 * 			TableName:    table.Name,
 * 			SubsetView: &bigtable.AuthorizedViewSubsetViewArgs{
 * 				RowPrefixes: pulumi.StringArray{
 * 					pulumi.String(invokeBase64encode.Result),
 * 				},
 * 				FamilySubsets: bigtable.AuthorizedViewSubsetViewFamilySubsetArray{
 * 					&bigtable.AuthorizedViewSubsetViewFamilySubsetArgs{
 * 						FamilyName: pulumi.String("family-first"),
 * 						Qualifiers: pulumi.StringArray{
 * 							pulumi.String(invokeBase64encode1.Result),
 * 							pulumi.String(invokeBase64encode2.Result),
 * 						},
 * 					},
 * 					&bigtable.AuthorizedViewSubsetViewFamilySubsetArgs{
 * 						FamilyName: pulumi.String("family-second"),
 * 						QualifierPrefixes: pulumi.StringArray{
 * 							pulumi.String(""),
 * 						},
 * 					},
 * 				},
 * 			},
 * 		})
 * 		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.bigtable.Instance;
 * import com.pulumi.gcp.bigtable.InstanceArgs;
 * import com.pulumi.gcp.bigtable.inputs.InstanceClusterArgs;
 * import com.pulumi.gcp.bigtable.Table;
 * import com.pulumi.gcp.bigtable.TableArgs;
 * import com.pulumi.gcp.bigtable.inputs.TableColumnFamilyArgs;
 * import com.pulumi.gcp.bigtable.AuthorizedView;
 * import com.pulumi.gcp.bigtable.AuthorizedViewArgs;
 * import com.pulumi.gcp.bigtable.inputs.AuthorizedViewSubsetViewArgs;
 * 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 instance = new Instance("instance", InstanceArgs.builder()
 *             .name("tf-instance")
 *             .clusters(InstanceClusterArgs.builder()
 *                 .clusterId("tf-instance-cluster")
 *                 .zone("us-central1-b")
 *                 .numNodes(3)
 *                 .storageType("HDD")
 *                 .build())
 *             .build());
 *         var table = new Table("table", TableArgs.builder()
 *             .name("tf-table")
 *             .instanceName(instance.name())
 *             .splitKeys(
 *                 "a",
 *                 "b",
 *                 "c")
 *             .columnFamilies(
 *                 TableColumnFamilyArgs.builder()
 *                     .family("family-first")
 *                     .build(),
 *                 TableColumnFamilyArgs.builder()
 *                     .family("family-second")
 *                     .build())
 *             .changeStreamRetention("24h0m0s")
 *             .build());
 *         var authorizedView = new AuthorizedView("authorizedView", AuthorizedViewArgs.builder()
 *             .name("tf-authorized-view")
 *             .instanceName(instance.name())
 *             .tableName(table.name())
 *             .subsetView(AuthorizedViewSubsetViewArgs.builder()
 *                 .rowPrefixes(StdFunctions.base64encode(Base64encodeArgs.builder()
 *                     .input("prefix#")
 *                     .build()).result())
 *                 .familySubsets(
 *                     AuthorizedViewSubsetViewFamilySubsetArgs.builder()
 *                         .familyName("family-first")
 *                         .qualifiers(
 *                             StdFunctions.base64encode(Base64encodeArgs.builder()
 *                                 .input("qualifier")
 *                                 .build()).result(),
 *                             StdFunctions.base64encode(Base64encodeArgs.builder()
 *                                 .input("qualifier-second")
 *                                 .build()).result())
 *                         .build(),
 *                     AuthorizedViewSubsetViewFamilySubsetArgs.builder()
 *                         .familyName("family-second")
 *                         .qualifierPrefixes("")
 *                         .build())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   instance:
 *     type: gcp:bigtable:Instance
 *     properties:
 *       name: tf-instance
 *       clusters:
 *         - clusterId: tf-instance-cluster
 *           zone: us-central1-b
 *           numNodes: 3
 *           storageType: HDD
 *   table:
 *     type: gcp:bigtable:Table
 *     properties:
 *       name: tf-table
 *       instanceName: ${instance.name}
 *       splitKeys:
 *         - a
 *         - b
 *         - c
 *       columnFamilies:
 *         - family: family-first
 *         - family: family-second
 *       changeStreamRetention: 24h0m0s
 *   authorizedView:
 *     type: gcp:bigtable:AuthorizedView
 *     name: authorized_view
 *     properties:
 *       name: tf-authorized-view
 *       instanceName: ${instance.name}
 *       tableName: ${table.name}
 *       subsetView:
 *         rowPrefixes:
 *           - fn::invoke:
 *               function: std:base64encode
 *               arguments:
 *                 input: prefix#
 *               return: result
 *         familySubsets:
 *           - familyName: family-first
 *             qualifiers:
 *               - fn::invoke:
 *                   function: std:base64encode
 *                   arguments:
 *                     input: qualifier
 *                   return: result
 *               - fn::invoke:
 *                   function: std:base64encode
 *                   arguments:
 *                     input: qualifier-second
 *                   return: result
 *           - familyName: family-second
 *             qualifierPrefixes:
 *               - ""
 * ```
 * 
 * ## Import
 * Bigtable Authorized Views can be imported using any of these accepted formats:
 * * `projects/{{project}}/instances/{{instance_name}}/tables/{{table_name}}/authorizedViews/{{name}}`
 * * `{{project}}/{{instance_name}}/{{table_name}}/{{name}}`
 * * `{{instance_name}}/{{table_name}}/{{name}}`
 * When using the `pulumi import` command, Bigtable Authorized Views can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:bigtable/authorizedView:AuthorizedView default projects/{{project}}/instances/{{instance_name}}/tables/{{table_name}}/authorizedViews/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:bigtable/authorizedView:AuthorizedView default {{project}}/{{instance_name}}/{{table_name}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:bigtable/authorizedView:AuthorizedView default {{instance_name}}/{{table_name}}/{{name}}
 * ```
 * @property deletionProtection
 * @property instanceName The name of the Bigtable instance in which the authorized view belongs.
 * @property name The name of the authorized view. Must be 1-50 characters and must only contain hyphens, underscores, periods, letters and numbers.
 * @property project The ID of the project in which the resource belongs. If it
 * is not provided, the provider project is used.
 * @property subsetView An AuthorizedView permitting access to an explicit subset of a Table. Structure is documented below.
 * -----
 * @property tableName The name of the Bigtable table in which the authorized view belongs.
 */
public data class AuthorizedViewArgs(
    public val deletionProtection: Output? = null,
    public val instanceName: Output? = null,
    public val name: Output? = null,
    public val project: Output? = null,
    public val subsetView: Output? = null,
    public val tableName: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.bigtable.AuthorizedViewArgs =
        com.pulumi.gcp.bigtable.AuthorizedViewArgs.builder()
            .deletionProtection(deletionProtection?.applyValue({ args0 -> args0 }))
            .instanceName(instanceName?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .subsetView(subsetView?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .tableName(tableName?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [AuthorizedViewArgs].
 */
@PulumiTagMarker
public class AuthorizedViewArgsBuilder internal constructor() {
    private var deletionProtection: Output? = null

    private var instanceName: Output? = null

    private var name: Output? = null

    private var project: Output? = null

    private var subsetView: Output? = null

    private var tableName: Output? = null

    /**
     * @param value
     */
    @JvmName("rscsfacggutblcfa")
    public suspend fun deletionProtection(`value`: Output) {
        this.deletionProtection = value
    }

    /**
     * @param value The name of the Bigtable instance in which the authorized view belongs.
     */
    @JvmName("btjlcnilwttaglse")
    public suspend fun instanceName(`value`: Output) {
        this.instanceName = value
    }

    /**
     * @param value The name of the authorized view. Must be 1-50 characters and must only contain hyphens, underscores, periods, letters and numbers.
     */
    @JvmName("mitjftwpqirgylhp")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The ID of the project in which the resource belongs. If it
     * is not provided, the provider project is used.
     */
    @JvmName("hiwxowvmaipdemlp")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value An AuthorizedView permitting access to an explicit subset of a Table. Structure is documented below.
     * -----
     */
    @JvmName("xeaxoqpfjyoevyon")
    public suspend fun subsetView(`value`: Output) {
        this.subsetView = value
    }

    /**
     * @param value The name of the Bigtable table in which the authorized view belongs.
     */
    @JvmName("fqmcrkwuwctiuhfa")
    public suspend fun tableName(`value`: Output) {
        this.tableName = value
    }

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

    /**
     * @param value The name of the Bigtable instance in which the authorized view belongs.
     */
    @JvmName("pupxsisnledoiyug")
    public suspend fun instanceName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.instanceName = mapped
    }

    /**
     * @param value The name of the authorized view. Must be 1-50 characters and must only contain hyphens, underscores, periods, letters and numbers.
     */
    @JvmName("ewtaheoalvuxmwip")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The ID of the project in which the resource belongs. If it
     * is not provided, the provider project is used.
     */
    @JvmName("beiuivwsdrgwlace")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value An AuthorizedView permitting access to an explicit subset of a Table. Structure is documented below.
     * -----
     */
    @JvmName("mqdigvohwpkfspoq")
    public suspend fun subsetView(`value`: AuthorizedViewSubsetViewArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.subsetView = mapped
    }

    /**
     * @param argument An AuthorizedView permitting access to an explicit subset of a Table. Structure is documented below.
     * -----
     */
    @JvmName("edlopilqfyegdxgl")
    public suspend fun subsetView(argument: suspend AuthorizedViewSubsetViewArgsBuilder.() -> Unit) {
        val toBeMapped = AuthorizedViewSubsetViewArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.subsetView = mapped
    }

    /**
     * @param value The name of the Bigtable table in which the authorized view belongs.
     */
    @JvmName("lvjjwmsliwycgqdi")
    public suspend fun tableName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tableName = mapped
    }

    internal fun build(): AuthorizedViewArgs = AuthorizedViewArgs(
        deletionProtection = deletionProtection,
        instanceName = instanceName,
        name = name,
        project = project,
        subsetView = subsetView,
        tableName = tableName,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy