UNPKG

@spacelift-io/pulumi-spacelift

Version:

A Pulumi package for creating and managing Spacelift resources.

95 lines 5.06 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.Context = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * `spacelift.Context` represents a Spacelift **context** - a collection of configuration elements (either environment variables or mounted files) that can be administratively attached to multiple stacks (`spacelift.Stack`) or modules (`spacelift.Module`) using a context attachment (`spacelift.ContextAttachment`)` * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as spacelift from "@spacelift-io/pulumi-spacelift"; * * const prod_k8s_ie = new spacelift.Context("prod-k8s-ie", {description: "Configuration details for the compute cluster in 🇮🇪"}); * ``` * * ## Import * * ```sh * $ pulumi import spacelift:index/context:Context prod-k8s-ie $CONTEXT_ID * ``` */ class Context extends pulumi.CustomResource { /** * Get an existing Context 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 Context(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Context. 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'] === Context.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["afterApplies"] = state ? state.afterApplies : undefined; resourceInputs["afterDestroys"] = state ? state.afterDestroys : undefined; resourceInputs["afterInits"] = state ? state.afterInits : undefined; resourceInputs["afterPerforms"] = state ? state.afterPerforms : undefined; resourceInputs["afterPlans"] = state ? state.afterPlans : undefined; resourceInputs["afterRuns"] = state ? state.afterRuns : undefined; resourceInputs["beforeApplies"] = state ? state.beforeApplies : undefined; resourceInputs["beforeDestroys"] = state ? state.beforeDestroys : undefined; resourceInputs["beforeInits"] = state ? state.beforeInits : undefined; resourceInputs["beforePerforms"] = state ? state.beforePerforms : undefined; resourceInputs["beforePlans"] = state ? state.beforePlans : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["labels"] = state ? state.labels : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["spaceId"] = state ? state.spaceId : undefined; } else { const args = argsOrState; resourceInputs["afterApplies"] = args ? args.afterApplies : undefined; resourceInputs["afterDestroys"] = args ? args.afterDestroys : undefined; resourceInputs["afterInits"] = args ? args.afterInits : undefined; resourceInputs["afterPerforms"] = args ? args.afterPerforms : undefined; resourceInputs["afterPlans"] = args ? args.afterPlans : undefined; resourceInputs["afterRuns"] = args ? args.afterRuns : undefined; resourceInputs["beforeApplies"] = args ? args.beforeApplies : undefined; resourceInputs["beforeDestroys"] = args ? args.beforeDestroys : undefined; resourceInputs["beforeInits"] = args ? args.beforeInits : undefined; resourceInputs["beforePerforms"] = args ? args.beforePerforms : undefined; resourceInputs["beforePlans"] = args ? args.beforePlans : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["labels"] = args ? args.labels : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["spaceId"] = args ? args.spaceId : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Context.__pulumiType, name, resourceInputs, opts); } } exports.Context = Context; /** @internal */ Context.__pulumiType = 'spacelift:index/context:Context'; //# sourceMappingURL=context.js.map