UNPKG

@pulumi/gcp

Version:

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

155 lines 5.75 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.Table = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Creates a Google Cloud Bigtable table inside an instance. For more information see * [the official documentation](https://cloud.google.com/bigtable/) and * [API](https://cloud.google.com/bigtable/docs/go/reference). * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * 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", * type: "intsum", * }, * { * family: "family-third", * type: ` { * \x09\x09\x09\x09\x09"aggregateType": { * \x09\x09\x09\x09\x09\x09"max": {}, * \x09\x09\x09\x09\x09\x09"inputType": { * \x09\x09\x09\x09\x09\x09\x09"int64Type": { * \x09\x09\x09\x09\x09\x09\x09\x09"encoding": { * \x09\x09\x09\x09\x09\x09\x09\x09\x09"bigEndianBytes": {} * \x09\x09\x09\x09\x09\x09\x09\x09} * \x09\x09\x09\x09\x09\x09\x09} * \x09\x09\x09\x09\x09\x09} * \x09\x09\x09\x09\x09} * \x09\x09\x09\x09} * `, * }, * ], * changeStreamRetention: "24h0m0s", * automatedBackupPolicy: { * retentionPeriod: "72h0m0s", * frequency: "24h0m0s", * }, * }); * ``` * * ## Import * * -> **Fields affected by import** The following fields can't be read and will show diffs if set in config when imported: `split_keys` * * Bigtable Tables can be imported using any of these accepted formats: * * * `projects/{{project}}/instances/{{instance_name}}/tables/{{name}}` * * * `{{project}}/{{instance_name}}/{{name}}` * * * `{{instance_name}}/{{name}}` * * When using the `pulumi import` command, Bigtable Tables can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:bigtable/table:Table default projects/{{project}}/instances/{{instance_name}}/tables/{{name}} * ``` * * ```sh * $ pulumi import gcp:bigtable/table:Table default {{project}}/{{instance_name}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:bigtable/table:Table default {{instance_name}}/{{name}} * ``` */ class Table extends pulumi.CustomResource { /** * Get an existing Table 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 Table(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Table. 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'] === Table.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["automatedBackupPolicy"] = state?.automatedBackupPolicy; resourceInputs["changeStreamRetention"] = state?.changeStreamRetention; resourceInputs["columnFamilies"] = state?.columnFamilies; resourceInputs["deletionProtection"] = state?.deletionProtection; resourceInputs["instanceName"] = state?.instanceName; resourceInputs["name"] = state?.name; resourceInputs["project"] = state?.project; resourceInputs["rowKeySchema"] = state?.rowKeySchema; resourceInputs["splitKeys"] = state?.splitKeys; } else { const args = argsOrState; if (args?.instanceName === undefined && !opts.urn) { throw new Error("Missing required property 'instanceName'"); } resourceInputs["automatedBackupPolicy"] = args?.automatedBackupPolicy; resourceInputs["changeStreamRetention"] = args?.changeStreamRetention; resourceInputs["columnFamilies"] = args?.columnFamilies; resourceInputs["deletionProtection"] = args?.deletionProtection; resourceInputs["instanceName"] = args?.instanceName; resourceInputs["name"] = args?.name; resourceInputs["project"] = args?.project; resourceInputs["rowKeySchema"] = args?.rowKeySchema; resourceInputs["splitKeys"] = args?.splitKeys; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Table.__pulumiType, name, resourceInputs, opts); } } exports.Table = Table; /** @internal */ Table.__pulumiType = 'gcp:bigtable/table:Table'; //# sourceMappingURL=table.js.map