UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

113 lines 5.1 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! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.Schedule = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides an AutoScaling Schedule resource. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const foobar = new aws.autoscaling.Group("foobar", { * availabilityZones: ["us-west-2a"], * name: "test-foobar5", * maxSize: 1, * minSize: 1, * healthCheckGracePeriod: 300, * healthCheckType: "ELB", * forceDelete: true, * terminationPolicies: ["OldestInstance"], * }); * const foobarSchedule = new aws.autoscaling.Schedule("foobar", { * scheduledActionName: "foobar", * minSize: 0, * maxSize: 1, * desiredCapacity: 0, * startTime: "2016-12-11T18:00:00Z", * endTime: "2016-12-12T06:00:00Z", * autoscalingGroupName: foobar.name, * }); * ``` * * ## Import * * Using `pulumi import`, import AutoScaling ScheduledAction using the `auto-scaling-group-name` and `scheduled-action-name`. For example: * * ```sh * $ pulumi import aws:autoscaling/schedule:Schedule resource-name auto-scaling-group-name/scheduled-action-name * ``` */ class Schedule extends pulumi.CustomResource { /** * Get an existing Schedule 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 Schedule(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Schedule. 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'] === Schedule.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state ? state.arn : undefined; resourceInputs["autoscalingGroupName"] = state ? state.autoscalingGroupName : undefined; resourceInputs["desiredCapacity"] = state ? state.desiredCapacity : undefined; resourceInputs["endTime"] = state ? state.endTime : undefined; resourceInputs["maxSize"] = state ? state.maxSize : undefined; resourceInputs["minSize"] = state ? state.minSize : undefined; resourceInputs["recurrence"] = state ? state.recurrence : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["scheduledActionName"] = state ? state.scheduledActionName : undefined; resourceInputs["startTime"] = state ? state.startTime : undefined; resourceInputs["timeZone"] = state ? state.timeZone : undefined; } else { const args = argsOrState; if ((!args || args.autoscalingGroupName === undefined) && !opts.urn) { throw new Error("Missing required property 'autoscalingGroupName'"); } if ((!args || args.scheduledActionName === undefined) && !opts.urn) { throw new Error("Missing required property 'scheduledActionName'"); } resourceInputs["autoscalingGroupName"] = args ? args.autoscalingGroupName : undefined; resourceInputs["desiredCapacity"] = args ? args.desiredCapacity : undefined; resourceInputs["endTime"] = args ? args.endTime : undefined; resourceInputs["maxSize"] = args ? args.maxSize : undefined; resourceInputs["minSize"] = args ? args.minSize : undefined; resourceInputs["recurrence"] = args ? args.recurrence : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["scheduledActionName"] = args ? args.scheduledActionName : undefined; resourceInputs["startTime"] = args ? args.startTime : undefined; resourceInputs["timeZone"] = args ? args.timeZone : undefined; resourceInputs["arn"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Schedule.__pulumiType, name, resourceInputs, opts); } } exports.Schedule = Schedule; /** @internal */ Schedule.__pulumiType = 'aws:autoscaling/schedule:Schedule'; //# sourceMappingURL=schedule.js.map