@spacelift-io/pulumi-spacelift
Version:
A Pulumi package for creating and managing Spacelift resources.
84 lines • 3.72 kB
JavaScript
;
// *** 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.Space = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* `spacelift.Space` represents a Spacelift **space** - a collection of resources such as stacks, modules, policies, etc. Allows for more granular access control. Can have a parent space.
*
* **Please note:** the `spacelift.Space` resource requires root Admin permissions, and can only be used by administrative stacks in the root space, or using an API key or user session that has root space access.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as spacelift from "@spacelift-io/pulumi-spacelift";
*
* const development = new spacelift.Space("development", {
* parentSpaceId: "root",
* description: "This a child of the root space. It contains all the resources common to the development infrastructure.",
* });
* const development_frontend = new spacelift.Space("development-frontend", {
* parentSpaceId: development.id,
* inheritEntities: true,
* });
* ```
*
* ## Import
*
* ```sh
* $ pulumi import spacelift:index/space:Space development $SPACE_ID
* ```
*/
class Space extends pulumi.CustomResource {
/**
* Get an existing Space 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 Space(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Space. 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'] === Space.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["inheritEntities"] = state ? state.inheritEntities : undefined;
resourceInputs["labels"] = state ? state.labels : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["parentSpaceId"] = state ? state.parentSpaceId : undefined;
}
else {
const args = argsOrState;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["inheritEntities"] = args ? args.inheritEntities : undefined;
resourceInputs["labels"] = args ? args.labels : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["parentSpaceId"] = args ? args.parentSpaceId : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Space.__pulumiType, name, resourceInputs, opts);
}
}
exports.Space = Space;
/** @internal */
Space.__pulumiType = 'spacelift:index/space:Space';
//# sourceMappingURL=space.js.map