UNPKG

@pulumi/gcp

Version:

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

129 lines 6.32 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! *** var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Folder = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * Allows management of a Google Cloud Platform folder. For more information see * [the official documentation](https://docs.cloud.google.com/resource-manager/docs/creating-managing-folders) * and * [API](https://docs.cloud.google.com/resource-manager/reference/rest/v2/folders). * * A folder can contain projects, other folders, or a combination of both. You can use folders to group projects under an organization in a hierarchy. For example, your organization might contain multiple departments, each with its own set of Cloud Platform resources. Folders allows you to group these resources on a per-department basis. Folders are used to group resources that share common IAM policies. * * Folders created live inside an Organization. See the [Organization documentation](https://docs.cloud.google.com/resource-manager/docs/quickstarts) for more details. * * The service account used to run the provider when creating a `gcp.organizations.Folder` * resource must have `roles/resourcemanager.folderCreator`. See the * [Access Control for Folders Using IAM](https://docs.cloud.google.com/resource-manager/docs/access-control-folders) * doc for more information. * * > It may take a while for the attached tag bindings to be deleted after the folder is scheduled to be deleted. * * ## Import * * Folders can be imported using the folder's id, e.g. * * * `folders/{{folder_id}}` * * `{{folder_id}}` * * When using the `pulumi import` command, Folders can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:organizations/folder:Folder default {{folder_id}} * $ pulumi import gcp:organizations/folder:Folder default folders/{{folder_id}} * ``` */ class Folder extends pulumi.CustomResource { /** * Get an existing Folder 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 Folder(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:organizations/folder:Folder'; /** * Returns true if the given object is an instance of Folder. 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'] === Folder.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["configuredCapabilities"] = state?.configuredCapabilities; resourceInputs["createTime"] = state?.createTime; resourceInputs["deletionPolicy"] = state?.deletionPolicy; resourceInputs["deletionProtection"] = state?.deletionProtection; resourceInputs["displayName"] = state?.displayName; resourceInputs["folderId"] = state?.folderId; resourceInputs["lifecycleState"] = state?.lifecycleState; resourceInputs["managementProject"] = state?.managementProject; resourceInputs["name"] = state?.name; resourceInputs["parent"] = state?.parent; resourceInputs["tags"] = state?.tags; } else { const args = argsOrState; if (args?.displayName === undefined && !opts.urn) { throw new Error("Missing required property 'displayName'"); } if (args?.parent === undefined && !opts.urn) { throw new Error("Missing required property 'parent'"); } resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["deletionProtection"] = args?.deletionProtection; resourceInputs["displayName"] = args?.displayName; resourceInputs["parent"] = args?.parent; resourceInputs["tags"] = args?.tags; resourceInputs["configuredCapabilities"] = undefined /*out*/; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["folderId"] = undefined /*out*/; resourceInputs["lifecycleState"] = undefined /*out*/; resourceInputs["managementProject"] = undefined /*out*/; resourceInputs["name"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Folder.__pulumiType, name, resourceInputs, opts); } } exports.Folder = Folder; //# sourceMappingURL=folder.js.map