UNPKG

@pulumi/gcp

Version:

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

133 lines 5.14 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! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.LogicalView = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * A logical view object that can be referenced in SQL queries. * * To get more information about LogicalView, see: * * * [API documentation](https://cloud.google.com/bigtable/docs/reference/admin/rest/v2/projects.instances.logicalViews) * * ## Example Usage * * ### Bigtable Logical View * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const instance = new gcp.bigtable.Instance("instance", { * name: "bt-instance", * clusters: [{ * clusterId: "cluster-1", * zone: "us-east1-b", * numNodes: 3, * storageType: "HDD", * }], * deletionProtection: false, * }); * const table = new gcp.bigtable.Table("table", { * name: "bt-table", * instanceName: instance.name, * columnFamilies: [{ * family: "CF", * }], * }); * const logicalView = new gcp.bigtable.LogicalView("logical_view", { * logicalViewId: "bt-logical-view", * instance: instance.name, * deletionProtection: false, * query: `SELECT _key, CF * FROM \` + "\`bt-table\`" + \` * `, * }, { * dependsOn: [table], * }); * ``` * * ## Import * * LogicalView can be imported using any of these accepted formats: * * * `projects/{{project}}/instances/{{instance}}/logicalViews/{{logical_view_id}}` * * * `{{project}}/{{instance}}/{{logical_view_id}}` * * * `{{instance}}/{{logical_view_id}}` * * When using the `pulumi import` command, LogicalView can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:bigtable/logicalView:LogicalView default projects/{{project}}/instances/{{instance}}/logicalViews/{{logical_view_id}} * ``` * * ```sh * $ pulumi import gcp:bigtable/logicalView:LogicalView default {{project}}/{{instance}}/{{logical_view_id}} * ``` * * ```sh * $ pulumi import gcp:bigtable/logicalView:LogicalView default {{instance}}/{{logical_view_id}} * ``` */ class LogicalView extends pulumi.CustomResource { /** * Get an existing LogicalView 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 LogicalView(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of LogicalView. 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'] === LogicalView.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["deletionProtection"] = state ? state.deletionProtection : undefined; resourceInputs["instance"] = state ? state.instance : undefined; resourceInputs["logicalViewId"] = state ? state.logicalViewId : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["project"] = state ? state.project : undefined; resourceInputs["query"] = state ? state.query : undefined; } else { const args = argsOrState; if ((!args || args.logicalViewId === undefined) && !opts.urn) { throw new Error("Missing required property 'logicalViewId'"); } if ((!args || args.query === undefined) && !opts.urn) { throw new Error("Missing required property 'query'"); } resourceInputs["deletionProtection"] = args ? args.deletionProtection : undefined; resourceInputs["instance"] = args ? args.instance : undefined; resourceInputs["logicalViewId"] = args ? args.logicalViewId : undefined; resourceInputs["project"] = args ? args.project : undefined; resourceInputs["query"] = args ? args.query : undefined; resourceInputs["name"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(LogicalView.__pulumiType, name, resourceInputs, opts); } } exports.LogicalView = LogicalView; /** @internal */ LogicalView.__pulumiType = 'gcp:bigtable/logicalView:LogicalView'; //# sourceMappingURL=logicalView.js.map