UNPKG

@pulumi/aws

Version:

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

81 lines 4.11 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.ScalingPlan = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages an AWS Auto Scaling scaling plan. * More information can be found in the [AWS Auto Scaling User Guide](https://docs.aws.amazon.com/autoscaling/plans/userguide/what-is-aws-auto-scaling.html). * * > **NOTE:** The AWS Auto Scaling service uses an AWS IAM service-linked role to manage predictive scaling of Amazon EC2 Auto Scaling groups. The service attempts to automatically create this role the first time a scaling plan with predictive scaling enabled is created. * An `aws.iam.ServiceLinkedRole` resource can be used to manually manage this role. * See the [AWS documentation](https://docs.aws.amazon.com/autoscaling/plans/userguide/aws-auto-scaling-service-linked-roles.html#create-service-linked-role-manual) for more details. * * ## Example Usage * * ## Import * * Using `pulumi import`, import Auto Scaling scaling plans using the `name`. For example: * * ```sh * $ pulumi import aws:autoscalingplans/scalingPlan:ScalingPlan example MyScale1 * ``` */ class ScalingPlan extends pulumi.CustomResource { /** * Get an existing ScalingPlan 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 ScalingPlan(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of ScalingPlan. 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'] === ScalingPlan.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["applicationSource"] = state ? state.applicationSource : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["scalingInstructions"] = state ? state.scalingInstructions : undefined; resourceInputs["scalingPlanVersion"] = state ? state.scalingPlanVersion : undefined; } else { const args = argsOrState; if ((!args || args.applicationSource === undefined) && !opts.urn) { throw new Error("Missing required property 'applicationSource'"); } if ((!args || args.scalingInstructions === undefined) && !opts.urn) { throw new Error("Missing required property 'scalingInstructions'"); } resourceInputs["applicationSource"] = args ? args.applicationSource : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["scalingInstructions"] = args ? args.scalingInstructions : undefined; resourceInputs["scalingPlanVersion"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ScalingPlan.__pulumiType, name, resourceInputs, opts); } } exports.ScalingPlan = ScalingPlan; /** @internal */ ScalingPlan.__pulumiType = 'aws:autoscalingplans/scalingPlan:ScalingPlan'; //# sourceMappingURL=scalingPlan.js.map