UNPKG

@pulumi/gcp

Version:

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

113 lines 4.6 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.TagKey = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * A TagKey, used to group a set of TagValues. * * To get more information about TagKey, see: * * * [API documentation](https://cloud.google.com/resource-manager/reference/rest/v3/tagKeys) * * How-to Guides * * [Official Documentation](https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing) * * ## Example Usage * * ### Tag Key Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const key = new gcp.tags.TagKey("key", { * parent: "organizations/123456789", * shortName: "keyname", * description: "For keyname resources.", * }); * ``` * * ## Import * * TagKey can be imported using any of these accepted formats: * * * `tagKeys/{{name}}` * * * `{{name}}` * * When using the `pulumi import` command, TagKey can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:tags/tagKey:TagKey default tagKeys/{{name}} * ``` * * ```sh * $ pulumi import gcp:tags/tagKey:TagKey default {{name}} * ``` */ class TagKey extends pulumi.CustomResource { /** * Get an existing TagKey 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 TagKey(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of TagKey. 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'] === TagKey.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["createTime"] = state ? state.createTime : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["namespacedName"] = state ? state.namespacedName : undefined; resourceInputs["parent"] = state ? state.parent : undefined; resourceInputs["purpose"] = state ? state.purpose : undefined; resourceInputs["purposeData"] = state ? state.purposeData : undefined; resourceInputs["shortName"] = state ? state.shortName : undefined; resourceInputs["updateTime"] = state ? state.updateTime : undefined; } else { const args = argsOrState; if ((!args || args.parent === undefined) && !opts.urn) { throw new Error("Missing required property 'parent'"); } if ((!args || args.shortName === undefined) && !opts.urn) { throw new Error("Missing required property 'shortName'"); } resourceInputs["description"] = args ? args.description : undefined; resourceInputs["parent"] = args ? args.parent : undefined; resourceInputs["purpose"] = args ? args.purpose : undefined; resourceInputs["purposeData"] = args ? args.purposeData : undefined; resourceInputs["shortName"] = args ? args.shortName : undefined; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["name"] = undefined /*out*/; resourceInputs["namespacedName"] = undefined /*out*/; resourceInputs["updateTime"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(TagKey.__pulumiType, name, resourceInputs, opts); } } exports.TagKey = TagKey; /** @internal */ TagKey.__pulumiType = 'gcp:tags/tagKey:TagKey'; //# sourceMappingURL=tagKey.js.map