"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! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.AutoscaleSetting = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages a AutoScale Setting which can be applied to Virtual Machine Scale Sets, App Services and other scalable resources.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "autoscalingTest",
 *     location: "West Europe",
 * });
 * const exampleVirtualNetwork = new azure.network.VirtualNetwork("example", {
 *     name: "acctvn",
 *     addressSpaces: ["10.0.0.0/16"],
 *     location: example.location,
 *     resourceGroupName: example.name,
 * });
 * const exampleSubnet = new azure.network.Subnet("example", {
 *     name: "acctsub",
 *     resourceGroupName: example.name,
 *     virtualNetworkName: exampleVirtualNetwork.name,
 *     addressPrefixes: ["10.0.2.0/24"],
 * });
 * const exampleLinuxVirtualMachineScaleSet = new azure.compute.LinuxVirtualMachineScaleSet("example", {
 *     name: "exampleset",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     upgradeMode: "Manual",
 *     sku: "Standard_F2",
 *     instances: 2,
 *     adminUsername: "myadmin",
 *     adminSshKeys: [{
 *         username: "myadmin",
 *         publicKey: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDCsTcryUl51Q2VSEHqDRNmceUFo55ZtcIwxl2QITbN1RREti5ml/VTytC0yeBOvnZA4x4CFpdw/lCDPk0yrH9Ei5vVkXmOrExdTlT3qI7YaAzj1tUVlBd4S6LX1F7y6VLActvdHuDDuXZXzCDd/97420jrDfWZqJMlUK/EmCE5ParCeHIRIvmBxcEnGfFIsw8xQZl0HphxWOtJil8qsUWSdMyCiJYYQpMoMliO99X40AUc4/AlsyPyT5ddbKk08YrZ+rKDVHF7o29rh4vi5MmHkVgVQHKiKybWlHq+b71gIAUQk9wrJxD+dqt4igrmDSpIjfjwnd+l5UIn5fJSO5DYV4YT/4hwK7OKmuo7OFHD0WyY5YnkYEMtFgzemnRBdE8ulcT60DQpVgRMXFWHvhyCWy0L6sgj1QWDZlLpvsIvNfHsyhKFMG1frLnMt/nP0+YCcfg+v1JYeCKjeoJxB8DWcRBsjzItY0CGmzP8UYZiYKl/2u+2TgFS5r7NWH11bxoUzjKdaa1NLw+ieA8GlBFfCbfWe6YVB9ggUte4VtYFMZGxOjS2bAiYtfgTKFJv+XqORAwExG6+G2eDxIDyo80/OA9IG7Xv/jwQr7D6KDjDuULFcN/iTxuttoKrHeYz1hf5ZQlBdllwJHYx6fK2g8kha6r2JIQKocvsAXiiONqSfw== hello@world.com",
 *     }],
 *     networkInterfaces: [{
 *         name: "TestNetworkProfile",
 *         primary: true,
 *         ipConfigurations: [{
 *             name: "TestIPConfiguration",
 *             primary: true,
 *             subnetId: exampleSubnet.id,
 *         }],
 *     }],
 *     osDisk: {
 *         caching: "ReadWrite",
 *         storageAccountType: "StandardSSD_LRS",
 *     },
 *     sourceImageReference: {
 *         publisher: "Canonical",
 *         offer: "0001-com-ubuntu-server-jammy",
 *         sku: "22_04-lts",
 *         version: "latest",
 *     },
 * });
 * const exampleAutoscaleSetting = new azure.monitoring.AutoscaleSetting("example", {
 *     name: "myAutoscaleSetting",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     targetResourceId: exampleLinuxVirtualMachineScaleSet.id,
 *     profiles: [{
 *         name: "defaultProfile",
 *         capacity: {
 *             "default": 1,
 *             minimum: 1,
 *             maximum: 10,
 *         },
 *         rules: [
 *             {
 *                 metricTrigger: {
 *                     metricName: "Percentage CPU",
 *                     metricResourceId: exampleLinuxVirtualMachineScaleSet.id,
 *                     timeGrain: "PT1M",
 *                     statistic: "Average",
 *                     timeWindow: "PT5M",
 *                     timeAggregation: "Average",
 *                     operator: "GreaterThan",
 *                     threshold: 75,
 *                     metricNamespace: "microsoft.compute/virtualmachinescalesets",
 *                     dimensions: [{
 *                         name: "AppName",
 *                         operator: "Equals",
 *                         values: ["App1"],
 *                     }],
 *                 },
 *                 scaleAction: {
 *                     direction: "Increase",
 *                     type: "ChangeCount",
 *                     value: 1,
 *                     cooldown: "PT1M",
 *                 },
 *             },
 *             {
 *                 metricTrigger: {
 *                     metricName: "Percentage CPU",
 *                     metricResourceId: exampleLinuxVirtualMachineScaleSet.id,
 *                     timeGrain: "PT1M",
 *                     statistic: "Average",
 *                     timeWindow: "PT5M",
 *                     timeAggregation: "Average",
 *                     operator: "LessThan",
 *                     threshold: 25,
 *                 },
 *                 scaleAction: {
 *                     direction: "Decrease",
 *                     type: "ChangeCount",
 *                     value: 1,
 *                     cooldown: "PT1M",
 *                 },
 *             },
 *         ],
 *     }],
 *     predictive: {
 *         scaleMode: "Enabled",
 *         lookAheadTime: "PT5M",
 *     },
 *     notification: {
 *         email: {
 *             sendToSubscriptionAdministrator: true,
 *             sendToSubscriptionCoAdministrator: true,
 *             customEmails: ["admin@contoso.com"],
 *         },
 *     },
 * });
 * ```
 *
 * ### Repeating On Weekends)
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "autoscalingTest",
 *     location: "West Europe",
 * });
 * const exampleVirtualNetwork = new azure.network.VirtualNetwork("example", {
 *     name: "acctvn",
 *     addressSpaces: ["10.0.0.0/16"],
 *     location: example.location,
 *     resourceGroupName: example.name,
 * });
 * const exampleSubnet = new azure.network.Subnet("example", {
 *     name: "acctsub",
 *     resourceGroupName: example.name,
 *     virtualNetworkName: exampleVirtualNetwork.name,
 *     addressPrefixes: ["10.0.2.0/24"],
 * });
 * const exampleLinuxVirtualMachineScaleSet = new azure.compute.LinuxVirtualMachineScaleSet("example", {
 *     name: "exampleset",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     upgradeMode: "Manual",
 *     sku: "Standard_F2",
 *     instances: 2,
 *     adminUsername: "myadmin",
 *     adminSshKeys: [{
 *         username: "myadmin",
 *         publicKey: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDCsTcryUl51Q2VSEHqDRNmceUFo55ZtcIwxl2QITbN1RREti5ml/VTytC0yeBOvnZA4x4CFpdw/lCDPk0yrH9Ei5vVkXmOrExdTlT3qI7YaAzj1tUVlBd4S6LX1F7y6VLActvdHuDDuXZXzCDd/97420jrDfWZqJMlUK/EmCE5ParCeHIRIvmBxcEnGfFIsw8xQZl0HphxWOtJil8qsUWSdMyCiJYYQpMoMliO99X40AUc4/AlsyPyT5ddbKk08YrZ+rKDVHF7o29rh4vi5MmHkVgVQHKiKybWlHq+b71gIAUQk9wrJxD+dqt4igrmDSpIjfjwnd+l5UIn5fJSO5DYV4YT/4hwK7OKmuo7OFHD0WyY5YnkYEMtFgzemnRBdE8ulcT60DQpVgRMXFWHvhyCWy0L6sgj1QWDZlLpvsIvNfHsyhKFMG1frLnMt/nP0+YCcfg+v1JYeCKjeoJxB8DWcRBsjzItY0CGmzP8UYZiYKl/2u+2TgFS5r7NWH11bxoUzjKdaa1NLw+ieA8GlBFfCbfWe6YVB9ggUte4VtYFMZGxOjS2bAiYtfgTKFJv+XqORAwExG6+G2eDxIDyo80/OA9IG7Xv/jwQr7D6KDjDuULFcN/iTxuttoKrHeYz1hf5ZQlBdllwJHYx6fK2g8kha6r2JIQKocvsAXiiONqSfw== hello@world.com",
 *     }],
 *     networkInterfaces: [{
 *         name: "TestNetworkProfile",
 *         primary: true,
 *         ipConfigurations: [{
 *             name: "TestIPConfiguration",
 *             primary: true,
 *             subnetId: exampleSubnet.id,
 *         }],
 *     }],
 *     osDisk: {
 *         caching: "ReadWrite",
 *         storageAccountType: "StandardSSD_LRS",
 *     },
 *     sourceImageReference: {
 *         publisher: "Canonical",
 *         offer: "0001-com-ubuntu-server-jammy",
 *         sku: "22_04-lts",
 *         version: "latest",
 *     },
 * });
 * const exampleAutoscaleSetting = new azure.monitoring.AutoscaleSetting("example", {
 *     name: "myAutoscaleSetting",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     targetResourceId: exampleLinuxVirtualMachineScaleSet.id,
 *     profiles: [{
 *         name: "Weekends",
 *         capacity: {
 *             "default": 1,
 *             minimum: 1,
 *             maximum: 10,
 *         },
 *         rules: [
 *             {
 *                 metricTrigger: {
 *                     metricName: "Percentage CPU",
 *                     metricResourceId: exampleLinuxVirtualMachineScaleSet.id,
 *                     timeGrain: "PT1M",
 *                     statistic: "Average",
 *                     timeWindow: "PT5M",
 *                     timeAggregation: "Average",
 *                     operator: "GreaterThan",
 *                     threshold: 90,
 *                 },
 *                 scaleAction: {
 *                     direction: "Increase",
 *                     type: "ChangeCount",
 *                     value: 2,
 *                     cooldown: "PT1M",
 *                 },
 *             },
 *             {
 *                 metricTrigger: {
 *                     metricName: "Percentage CPU",
 *                     metricResourceId: exampleLinuxVirtualMachineScaleSet.id,
 *                     timeGrain: "PT1M",
 *                     statistic: "Average",
 *                     timeWindow: "PT5M",
 *                     timeAggregation: "Average",
 *                     operator: "LessThan",
 *                     threshold: 10,
 *                 },
 *                 scaleAction: {
 *                     direction: "Decrease",
 *                     type: "ChangeCount",
 *                     value: 2,
 *                     cooldown: "PT1M",
 *                 },
 *             },
 *         ],
 *         recurrence: {
 *             timezone: "Pacific Standard Time",
 *             days: [
 *                 "Saturday",
 *                 "Sunday",
 *             ],
 *             hours: 12,
 *             minutes: 0,
 *         },
 *     }],
 *     notification: {
 *         email: {
 *             sendToSubscriptionAdministrator: true,
 *             sendToSubscriptionCoAdministrator: true,
 *             customEmails: ["admin@contoso.com"],
 *         },
 *     },
 * });
 * ```
 *
 * ### For Fixed Dates)
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "autoscalingTest",
 *     location: "West Europe",
 * });
 * const exampleVirtualNetwork = new azure.network.VirtualNetwork("example", {
 *     name: "acctvn",
 *     addressSpaces: ["10.0.0.0/16"],
 *     location: example.location,
 *     resourceGroupName: example.name,
 * });
 * const exampleSubnet = new azure.network.Subnet("example", {
 *     name: "acctsub",
 *     resourceGroupName: example.name,
 *     virtualNetworkName: exampleVirtualNetwork.name,
 *     addressPrefixes: ["10.0.2.0/24"],
 * });
 * const exampleLinuxVirtualMachineScaleSet = new azure.compute.LinuxVirtualMachineScaleSet("example", {
 *     name: "exampleset",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     upgradeMode: "Manual",
 *     sku: "Standard_F2",
 *     instances: 2,
 *     adminUsername: "myadmin",
 *     adminSshKeys: [{
 *         username: "myadmin",
 *         publicKey: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDCsTcryUl51Q2VSEHqDRNmceUFo55ZtcIwxl2QITbN1RREti5ml/VTytC0yeBOvnZA4x4CFpdw/lCDPk0yrH9Ei5vVkXmOrExdTlT3qI7YaAzj1tUVlBd4S6LX1F7y6VLActvdHuDDuXZXzCDd/97420jrDfWZqJMlUK/EmCE5ParCeHIRIvmBxcEnGfFIsw8xQZl0HphxWOtJil8qsUWSdMyCiJYYQpMoMliO99X40AUc4/AlsyPyT5ddbKk08YrZ+rKDVHF7o29rh4vi5MmHkVgVQHKiKybWlHq+b71gIAUQk9wrJxD+dqt4igrmDSpIjfjwnd+l5UIn5fJSO5DYV4YT/4hwK7OKmuo7OFHD0WyY5YnkYEMtFgzemnRBdE8ulcT60DQpVgRMXFWHvhyCWy0L6sgj1QWDZlLpvsIvNfHsyhKFMG1frLnMt/nP0+YCcfg+v1JYeCKjeoJxB8DWcRBsjzItY0CGmzP8UYZiYKl/2u+2TgFS5r7NWH11bxoUzjKdaa1NLw+ieA8GlBFfCbfWe6YVB9ggUte4VtYFMZGxOjS2bAiYtfgTKFJv+XqORAwExG6+G2eDxIDyo80/OA9IG7Xv/jwQr7D6KDjDuULFcN/iTxuttoKrHeYz1hf5ZQlBdllwJHYx6fK2g8kha6r2JIQKocvsAXiiONqSfw== hello@world.com",
 *     }],
 *     networkInterfaces: [{
 *         name: "TestNetworkProfile",
 *         primary: true,
 *         ipConfigurations: [{
 *             name: "TestIPConfiguration",
 *             primary: true,
 *             subnetId: exampleSubnet.id,
 *         }],
 *     }],
 *     osDisk: {
 *         caching: "ReadWrite",
 *         storageAccountType: "StandardSSD_LRS",
 *     },
 *     sourceImageReference: {
 *         publisher: "Canonical",
 *         offer: "0001-com-ubuntu-server-jammy",
 *         sku: "22_04-lts",
 *         version: "latest",
 *     },
 * });
 * const exampleAutoscaleSetting = new azure.monitoring.AutoscaleSetting("example", {
 *     name: "myAutoscaleSetting",
 *     enabled: true,
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     targetResourceId: exampleLinuxVirtualMachineScaleSet.id,
 *     profiles: [{
 *         name: "forJuly",
 *         capacity: {
 *             "default": 1,
 *             minimum: 1,
 *             maximum: 10,
 *         },
 *         rules: [
 *             {
 *                 metricTrigger: {
 *                     metricName: "Percentage CPU",
 *                     metricResourceId: exampleLinuxVirtualMachineScaleSet.id,
 *                     timeGrain: "PT1M",
 *                     statistic: "Average",
 *                     timeWindow: "PT5M",
 *                     timeAggregation: "Average",
 *                     operator: "GreaterThan",
 *                     threshold: 90,
 *                 },
 *                 scaleAction: {
 *                     direction: "Increase",
 *                     type: "ChangeCount",
 *                     value: 2,
 *                     cooldown: "PT1M",
 *                 },
 *             },
 *             {
 *                 metricTrigger: {
 *                     metricName: "Percentage CPU",
 *                     metricResourceId: exampleLinuxVirtualMachineScaleSet.id,
 *                     timeGrain: "PT1M",
 *                     statistic: "Average",
 *                     timeWindow: "PT5M",
 *                     timeAggregation: "Average",
 *                     operator: "LessThan",
 *                     threshold: 10,
 *                 },
 *                 scaleAction: {
 *                     direction: "Decrease",
 *                     type: "ChangeCount",
 *                     value: 2,
 *                     cooldown: "PT1M",
 *                 },
 *             },
 *         ],
 *         fixedDate: {
 *             timezone: "Pacific Standard Time",
 *             start: "2020-07-01T00:00:00Z",
 *             end: "2020-07-31T23:59:59Z",
 *         },
 *     }],
 *     notification: {
 *         email: {
 *             sendToSubscriptionAdministrator: true,
 *             sendToSubscriptionCoAdministrator: true,
 *             customEmails: ["admin@contoso.com"],
 *         },
 *     },
 * });
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.Insights` - 2022-10-01
 *
 * ## Import
 *
 * AutoScale Setting can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:monitoring/autoscaleSetting:AutoscaleSetting example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Insights/autoScaleSettings/setting1
 * ```
 */
class AutoscaleSetting extends pulumi.CustomResource {
    /**
     * Get an existing AutoscaleSetting 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 AutoscaleSetting(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:monitoring/autoscaleSetting:AutoscaleSetting';
    /**
     * Returns true if the given object is an instance of AutoscaleSetting.  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'] === AutoscaleSetting.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["enabled"] = state?.enabled;
            resourceInputs["location"] = state?.location;
            resourceInputs["name"] = state?.name;
            resourceInputs["notification"] = state?.notification;
            resourceInputs["predictive"] = state?.predictive;
            resourceInputs["profiles"] = state?.profiles;
            resourceInputs["resourceGroupName"] = state?.resourceGroupName;
            resourceInputs["tags"] = state?.tags;
            resourceInputs["targetResourceId"] = state?.targetResourceId;
        }
        else {
            const args = argsOrState;
            if (args?.profiles === undefined && !opts.urn) {
                throw new Error("Missing required property 'profiles'");
            }
            if (args?.resourceGroupName === undefined && !opts.urn) {
                throw new Error("Missing required property 'resourceGroupName'");
            }
            if (args?.targetResourceId === undefined && !opts.urn) {
                throw new Error("Missing required property 'targetResourceId'");
            }
            resourceInputs["enabled"] = args?.enabled;
            resourceInputs["location"] = args?.location;
            resourceInputs["name"] = args?.name;
            resourceInputs["notification"] = args?.notification;
            resourceInputs["predictive"] = args?.predictive;
            resourceInputs["profiles"] = args?.profiles;
            resourceInputs["resourceGroupName"] = args?.resourceGroupName;
            resourceInputs["tags"] = args?.tags;
            resourceInputs["targetResourceId"] = args?.targetResourceId;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(AutoscaleSetting.__pulumiType, name, resourceInputs, opts);
    }
}
exports.AutoscaleSetting = AutoscaleSetting;
//# sourceMappingURL=autoscaleSetting.js.map