"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.ScalableTarget = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * The ``AWS::ApplicationAutoScaling::ScalableTarget`` resource specifies a resource that Application Auto Scaling can scale, such as an AWS::DynamoDB::Table or AWS::ECS::Service resource.
 *  For more information, see [Getting started](https://docs.aws.amazon.com/autoscaling/application/userguide/getting-started.html) in the *Application Auto Scaling User Guide*.
 *   If the resource that you want Application Auto Scaling to scale is not yet created in your account, add a dependency on the resource when registering it as a scalable target using the [DependsOn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html) attribute.
 */
class ScalableTarget extends pulumi.CustomResource {
    /**
     * Get an existing ScalableTarget 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 opts Optional settings to control the behavior of the CustomResource.
     */
    static get(name, id, opts) {
        return new ScalableTarget(name, undefined, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of ScalableTarget.  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'] === ScalableTarget.__pulumiType;
    }
    /**
     * Create a ScalableTarget 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, args, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (!opts.id) {
            if (args?.maxCapacity === undefined && !opts.urn) {
                throw new Error("Missing required property 'maxCapacity'");
            }
            if (args?.minCapacity === undefined && !opts.urn) {
                throw new Error("Missing required property 'minCapacity'");
            }
            if (args?.resourceId === undefined && !opts.urn) {
                throw new Error("Missing required property 'resourceId'");
            }
            if (args?.scalableDimension === undefined && !opts.urn) {
                throw new Error("Missing required property 'scalableDimension'");
            }
            if (args?.serviceNamespace === undefined && !opts.urn) {
                throw new Error("Missing required property 'serviceNamespace'");
            }
            resourceInputs["maxCapacity"] = args?.maxCapacity;
            resourceInputs["minCapacity"] = args?.minCapacity;
            resourceInputs["resourceId"] = args?.resourceId;
            resourceInputs["roleArn"] = args?.roleArn;
            resourceInputs["scalableDimension"] = args?.scalableDimension;
            resourceInputs["scheduledActions"] = args?.scheduledActions;
            resourceInputs["serviceNamespace"] = args?.serviceNamespace;
            resourceInputs["suspendedState"] = args?.suspendedState;
            resourceInputs["awsId"] = undefined /*out*/;
        }
        else {
            resourceInputs["awsId"] = undefined /*out*/;
            resourceInputs["maxCapacity"] = undefined /*out*/;
            resourceInputs["minCapacity"] = undefined /*out*/;
            resourceInputs["resourceId"] = undefined /*out*/;
            resourceInputs["roleArn"] = undefined /*out*/;
            resourceInputs["scalableDimension"] = undefined /*out*/;
            resourceInputs["scheduledActions"] = undefined /*out*/;
            resourceInputs["serviceNamespace"] = undefined /*out*/;
            resourceInputs["suspendedState"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const replaceOnChanges = { replaceOnChanges: ["resourceId", "scalableDimension", "serviceNamespace"] };
        opts = pulumi.mergeOptions(opts, replaceOnChanges);
        super(ScalableTarget.__pulumiType, name, resourceInputs, opts);
    }
}
exports.ScalableTarget = ScalableTarget;
/** @internal */
ScalableTarget.__pulumiType = 'aws-native:applicationautoscaling:ScalableTarget';
//# sourceMappingURL=scalableTarget.js.map