@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
113 lines • 4.37 kB
JavaScript
// *** 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.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, { ...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?.createTime;
resourceInputs["name"] = state?.name;
resourceInputs["origin"] = state?.origin;
resourceInputs["parent"] = state?.parent;
resourceInputs["reason"] = state?.reason;
resourceInputs["restrictions"] = state?.restrictions;
}
else {
const args = argsOrState;
if (args?.origin === undefined && !opts.urn) {
throw new Error("Missing required property 'origin'");
}
if (args?.parent === undefined && !opts.urn) {
throw new Error("Missing required property 'parent'");
}
if (args?.reason === undefined && !opts.urn) {
throw new Error("Missing required property 'reason'");
}
if (args?.restrictions === undefined && !opts.urn) {
throw new Error("Missing required property 'restrictions'");
}
resourceInputs["origin"] = args?.origin;
resourceInputs["parent"] = args?.parent;
resourceInputs["reason"] = args?.reason;
resourceInputs["restrictions"] = args?.restrictions;
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
;