@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
113 lines • 4.66 kB
JavaScript
;
// *** 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, { ...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?.arn;
resourceInputs["autoscalingGroupName"] = state?.autoscalingGroupName;
resourceInputs["desiredCapacity"] = state?.desiredCapacity;
resourceInputs["endTime"] = state?.endTime;
resourceInputs["maxSize"] = state?.maxSize;
resourceInputs["minSize"] = state?.minSize;
resourceInputs["recurrence"] = state?.recurrence;
resourceInputs["region"] = state?.region;
resourceInputs["scheduledActionName"] = state?.scheduledActionName;
resourceInputs["startTime"] = state?.startTime;
resourceInputs["timeZone"] = state?.timeZone;
}
else {
const args = argsOrState;
if (args?.autoscalingGroupName === undefined && !opts.urn) {
throw new Error("Missing required property 'autoscalingGroupName'");
}
if (args?.scheduledActionName === undefined && !opts.urn) {
throw new Error("Missing required property 'scheduledActionName'");
}
resourceInputs["autoscalingGroupName"] = args?.autoscalingGroupName;
resourceInputs["desiredCapacity"] = args?.desiredCapacity;
resourceInputs["endTime"] = args?.endTime;
resourceInputs["maxSize"] = args?.maxSize;
resourceInputs["minSize"] = args?.minSize;
resourceInputs["recurrence"] = args?.recurrence;
resourceInputs["region"] = args?.region;
resourceInputs["scheduledActionName"] = args?.scheduledActionName;
resourceInputs["startTime"] = args?.startTime;
resourceInputs["timeZone"] = args?.timeZone;
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