UNPKG

@pulumi/gcp

Version:

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

162 lines 5.99 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.Instance = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * ## +--- * * subcategory: "Cloud Bigtable" * description: |- * Creates a Google Bigtable instance. * --- * * # gcp.bigtable.Instance * * Creates a Google Bigtable instance. For more information see: * * * [API documentation](https://cloud.google.com/bigtable/docs/reference/admin/rest/v2/projects.instances.clusters) * * How-to Guides * * [Official Documentation](https://cloud.google.com/bigtable/docs) * * ## Example Usage * * ### Simple Instance * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const production_instance = new gcp.bigtable.Instance("production-instance", { * name: "tf-instance", * clusters: [{ * clusterId: "tf-instance-cluster", * numNodes: 1, * storageType: "HDD", * }], * labels: { * "my-label": "prod-label", * }, * }); * ``` * * ### Replicated Instance * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const production_instance = new gcp.bigtable.Instance("production-instance", { * name: "tf-instance", * clusters: [ * { * clusterId: "tf-instance-cluster1", * numNodes: 1, * storageType: "HDD", * zone: "us-central1-c", * }, * { * clusterId: "tf-instance-cluster2", * storageType: "HDD", * zone: "us-central1-b", * autoscalingConfig: { * minNodes: 1, * maxNodes: 3, * cpuTarget: 50, * }, * }, * ], * labels: { * "my-label": "prod-label", * }, * }); * ``` * * ## Import * * Bigtable Instances can be imported using any of these accepted formats: * * * `projects/{{project}}/instances/{{name}}` * * * `{{project}}/{{name}}` * * * `{{name}}` * * When using the `pulumi import` command, Bigtable Instances can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:bigtable/instance:Instance default projects/{{project}}/instances/{{name}} * ``` * * ```sh * $ pulumi import gcp:bigtable/instance:Instance default {{project}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:bigtable/instance:Instance default {{name}} * ``` */ class Instance extends pulumi.CustomResource { /** * Get an existing Instance 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 Instance(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Instance. 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'] === Instance.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["clusters"] = state ? state.clusters : undefined; resourceInputs["deletionProtection"] = state ? state.deletionProtection : undefined; resourceInputs["displayName"] = state ? state.displayName : undefined; resourceInputs["effectiveLabels"] = state ? state.effectiveLabels : undefined; resourceInputs["forceDestroy"] = state ? state.forceDestroy : undefined; resourceInputs["instanceType"] = state ? state.instanceType : undefined; resourceInputs["labels"] = state ? state.labels : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["project"] = state ? state.project : undefined; resourceInputs["pulumiLabels"] = state ? state.pulumiLabels : undefined; } else { const args = argsOrState; resourceInputs["clusters"] = args ? args.clusters : undefined; resourceInputs["deletionProtection"] = args ? args.deletionProtection : undefined; resourceInputs["displayName"] = args ? args.displayName : undefined; resourceInputs["forceDestroy"] = args ? args.forceDestroy : undefined; resourceInputs["instanceType"] = args ? args.instanceType : undefined; resourceInputs["labels"] = args ? args.labels : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["project"] = args ? args.project : undefined; resourceInputs["effectiveLabels"] = undefined /*out*/; resourceInputs["pulumiLabels"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(Instance.__pulumiType, name, resourceInputs, opts); } } exports.Instance = Instance; /** @internal */ Instance.__pulumiType = 'gcp:bigtable/instance:Instance'; //# sourceMappingURL=instance.js.map