UNPKG

@pulumi/gcp

Version:

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

113 lines 4.64 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.Lien = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * A Lien represents an encumbrance on the actions that can be performed on a resource. * * To get more information about Lien, see: * * * [API documentation](https://cloud.google.com/resource-manager/reference/rest) * * How-to Guides * * [Create a Lien](https://cloud.google.com/resource-manager/docs/project-liens) * * ## Example Usage * * ### Resource Manager Lien * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const project = new gcp.organizations.Project("project", { * projectId: "staging-project", * name: "A very important project!", * deletionPolicy: "DELETE", * }); * const lien = new gcp.resourcemanager.Lien("lien", { * parent: pulumi.interpolate`projects/${project.number}`, * restrictions: ["resourcemanager.projects.delete"], * origin: "machine-readable-explanation", * reason: "This project is an important environment", * }); * ``` * * ## Import * * Lien can be imported using any of these accepted formats: * * * `{{parent}}/{{name}}` * * When using the `pulumi import` command, Lien can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:resourcemanager/lien:Lien default {{parent}}/{{name}} * ``` */ class Lien extends pulumi.CustomResource { /** * Get an existing Lien 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 Lien(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Lien. 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'] === Lien.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["createTime"] = state ? state.createTime : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["origin"] = state ? state.origin : undefined; resourceInputs["parent"] = state ? state.parent : undefined; resourceInputs["reason"] = state ? state.reason : undefined; resourceInputs["restrictions"] = state ? state.restrictions : undefined; } else { const args = argsOrState; if ((!args || args.origin === undefined) && !opts.urn) { throw new Error("Missing required property 'origin'"); } if ((!args || args.parent === undefined) && !opts.urn) { throw new Error("Missing required property 'parent'"); } if ((!args || args.reason === undefined) && !opts.urn) { throw new Error("Missing required property 'reason'"); } if ((!args || args.restrictions === undefined) && !opts.urn) { throw new Error("Missing required property 'restrictions'"); } resourceInputs["origin"] = args ? args.origin : undefined; resourceInputs["parent"] = args ? args.parent : undefined; resourceInputs["reason"] = args ? args.reason : undefined; resourceInputs["restrictions"] = args ? args.restrictions : undefined; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["name"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Lien.__pulumiType, name, resourceInputs, opts); } } exports.Lien = Lien; /** @internal */ Lien.__pulumiType = 'gcp:resourcemanager/lien:Lien'; //# sourceMappingURL=lien.js.map