UNPKG

@spacelift-io/pulumi-spacelift

Version:

A Pulumi package for creating and managing Spacelift resources.

86 lines 3.72 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.ScheduledDeleteTask = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * `spacelift.ScheduledDeleteTask` represents a scheduling configuration for a Stack. It will trigger a stack deletion task at the given timestamp. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as spacelift from "@spacelift-io/pulumi-spacelift"; * * const k8s_core = new spacelift.Stack("k8s-core", {}); * // ... * // at a given timestamp (unix) * const k8s_core_delete = new spacelift.ScheduledDeleteTask("k8s-core-delete", { * stackId: k8s_core.id, * at: 1663336895, * deleteResources: true, * }); * ``` * * ## Import * * ```sh * $ pulumi import spacelift:index/scheduledDeleteTask:ScheduledDeleteTask ireland-kubeconfig $STACK_ID/$SCHEDULED_DELETE_STACK_ID * ``` */ class ScheduledDeleteTask extends pulumi.CustomResource { /** * Get an existing ScheduledDeleteTask 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 ScheduledDeleteTask(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of ScheduledDeleteTask. 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'] === ScheduledDeleteTask.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["at"] = state ? state.at : undefined; resourceInputs["deleteResources"] = state ? state.deleteResources : undefined; resourceInputs["scheduleId"] = state ? state.scheduleId : undefined; resourceInputs["stackId"] = state ? state.stackId : undefined; } else { const args = argsOrState; if ((!args || args.at === undefined) && !opts.urn) { throw new Error("Missing required property 'at'"); } if ((!args || args.stackId === undefined) && !opts.urn) { throw new Error("Missing required property 'stackId'"); } resourceInputs["at"] = args ? args.at : undefined; resourceInputs["deleteResources"] = args ? args.deleteResources : undefined; resourceInputs["scheduleId"] = args ? args.scheduleId : undefined; resourceInputs["stackId"] = args ? args.stackId : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ScheduledDeleteTask.__pulumiType, name, resourceInputs, opts); } } exports.ScheduledDeleteTask = ScheduledDeleteTask; /** @internal */ ScheduledDeleteTask.__pulumiType = 'spacelift:index/scheduledDeleteTask:ScheduledDeleteTask'; //# sourceMappingURL=scheduledDeleteTask.js.map