UNPKG

@spacelift-io/pulumi-spacelift

Version:

A Pulumi package for creating and managing Spacelift resources.

79 lines (78 loc) 3.34 kB
import * as pulumi from "@pulumi/pulumi"; /** * `spacelift.StackDestructor` is used to destroy the resources of a Stack before deleting it. `dependsOn` should be used to make sure that all necessary resources (environment variables, roles, integrations, etc.) are still in place when the destruction run is executed. **Note:** Destroying this resource will delete the resources in the stack. If this resource needs to be deleted and the resources in the stacks are to be preserved, ensure that the `deactivated` attribute is set to `true`. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as spacelift from "@spacelift-io/pulumi-spacelift"; * * const k8s_coreStack = new spacelift.Stack("k8s-coreStack", {}); * // ... * const credentials = new spacelift.EnvironmentVariable("credentials", {}); * // ... * const k8s_coreStackDestructor = new spacelift.StackDestructor("k8s-coreStackDestructor", {stackId: k8s_coreStack.id}, { * dependsOn: [credentials], * }); * ``` */ export declare class StackDestructor extends pulumi.CustomResource { /** * Get an existing StackDestructor 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: string, id: pulumi.Input<pulumi.ID>, state?: StackDestructorState, opts?: pulumi.CustomResourceOptions): StackDestructor; /** * Returns true if the given object is an instance of StackDestructor. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is StackDestructor; /** * If set to true, destruction won't delete the stack */ readonly deactivated: pulumi.Output<boolean | undefined>; /** * ID of the stack to delete and destroy on destruction */ readonly stackId: pulumi.Output<string>; /** * Create a StackDestructor resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: StackDestructorArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering StackDestructor resources. */ export interface StackDestructorState { /** * If set to true, destruction won't delete the stack */ deactivated?: pulumi.Input<boolean>; /** * ID of the stack to delete and destroy on destruction */ stackId?: pulumi.Input<string>; } /** * The set of arguments for constructing a StackDestructor resource. */ export interface StackDestructorArgs { /** * If set to true, destruction won't delete the stack */ deactivated?: pulumi.Input<boolean>; /** * ID of the stack to delete and destroy on destruction */ stackId: pulumi.Input<string>; }