UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

179 lines 7.29 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.AuthorizedView = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * Creates a Google Cloud Bigtable authorized view inside a table. For more information see * [the official documentation](https://cloud.google.com/bigtable/) and * [API](https://cloud.google.com/bigtable/docs/go/reference). * * > **Note:** It is strongly recommended to set `lifecycle { preventDestroy = true }` * on authorized views in order to prevent accidental data loss. See * Terraform docs * for more information on lifecycle parameters. * * ## 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: [""], * }, * ], * }, * }); * ``` * * ## 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}} * $ pulumi import gcp:bigtable/authorizedView:AuthorizedView default {{project}}/{{instance_name}}/{{table_name}}/{{name}} * $ pulumi import gcp:bigtable/authorizedView:AuthorizedView default {{instance_name}}/{{table_name}}/{{name}} * ``` */ class AuthorizedView extends pulumi.CustomResource { /** * Get an existing AuthorizedView resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new AuthorizedView(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:bigtable/authorizedView:AuthorizedView'; /** * Returns true if the given object is an instance of AuthorizedView. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === AuthorizedView.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["deletionPolicy"] = state?.deletionPolicy; resourceInputs["deletionProtection"] = state?.deletionProtection; resourceInputs["instanceName"] = state?.instanceName; resourceInputs["name"] = state?.name; resourceInputs["project"] = state?.project; resourceInputs["subsetView"] = state?.subsetView; resourceInputs["tableName"] = state?.tableName; } else { const args = argsOrState; if (args?.instanceName === undefined && !opts.urn) { throw new Error("Missing required property 'instanceName'"); } if (args?.tableName === undefined && !opts.urn) { throw new Error("Missing required property 'tableName'"); } resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["deletionProtection"] = args?.deletionProtection; resourceInputs["instanceName"] = args?.instanceName; resourceInputs["name"] = args?.name; resourceInputs["project"] = args?.project; resourceInputs["subsetView"] = args?.subsetView; resourceInputs["tableName"] = args?.tableName; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(AuthorizedView.__pulumiType, name, resourceInputs, opts); } } exports.AuthorizedView = AuthorizedView; //# sourceMappingURL=authorizedView.js.map