Skip to content

azurermMonitorAutoscaleSetting

Manages a AutoScale Setting which can be applied to Virtual Machine Scale Sets, App Services and other scalable resources.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "West Europe",
    name: "autoscalingTest",
  }
);
const azurermVirtualNetworkExample = new azurerm.virtualNetwork.VirtualNetwork(
  this,
  "example_1",
  {
    address_space: ["10.0.0.0/16"],
    location: azurermResourceGroupExample.location,
    name: "acctvn",
    resource_group_name: azurermResourceGroupExample.name,
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermVirtualNetworkExample.overrideLogicalId("example");
const azurermSubnetExample = new azurerm.subnet.Subnet(this, "example_2", {
  address_prefixes: ["10.0.2.0/24"],
  name: "acctsub",
  resource_group_name: azurermResourceGroupExample.name,
  virtual_network_name: azurermVirtualNetworkExample.name,
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermSubnetExample.overrideLogicalId("example");
const azurermLinuxVirtualMachineScaleSetExample =
  new azurerm.linuxVirtualMachineScaleSet.LinuxVirtualMachineScaleSet(
    this,
    "example_3",
    {
      admin_ssh_key: [
        {
          public_key:
            "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",
          username: "myadmin",
        },
      ],
      admin_username: "myadmin",
      instances: 2,
      location: azurermResourceGroupExample.location,
      name: "exampleset",
      network_interface: [
        {
          ip_configuration: [
            {
              name: "TestIPConfiguration",
              primary: true,
              subnet_id: azurermSubnetExample.id,
            },
          ],
          name: "TestNetworkProfile",
          primary: true,
        },
      ],
      os_disk: [
        {
          caching: "ReadWrite",
          storage_account_type: "StandardSSD_LRS",
        },
      ],
      resource_group_name: azurermResourceGroupExample.name,
      sku: "Standard_F2",
      source_image_reference: [
        {
          offer: "UbuntuServer",
          publisher: "Canonical",
          sku: "16.04-LTS",
          version: "latest",
        },
      ],
      upgrade_mode: "Manual",
    }
  );
azurermLinuxVirtualMachineScaleSetExample.addOverride("lifecycle", [
  {
    ignore_changes: ["instances"],
  },
]);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermLinuxVirtualMachineScaleSetExample.overrideLogicalId("example");
const azurermMonitorAutoscaleSettingExample =
  new azurerm.monitorAutoscaleSetting.MonitorAutoscaleSetting(
    this,
    "example_4",
    {
      location: azurermResourceGroupExample.location,
      name: "myAutoscaleSetting",
      notification: [
        {
          email: [
            {
              custom_emails: ["admin@contoso.com"],
              send_to_subscription_administrator: true,
              send_to_subscription_co_administrator: true,
            },
          ],
        },
      ],
      profile: [
        {
          capacity: [
            {
              default: 1,
              maximum: 10,
              minimum: 1,
            },
          ],
          name: "defaultProfile",
          rule: [
            {
              metric_trigger: [
                {
                  dimensions: [
                    {
                      name: "AppName",
                      operator: "Equals",
                      values: ["App1"],
                    },
                  ],
                  metric_name: "Percentage CPU",
                  metric_namespace: "microsoft.compute/virtualmachinescalesets",
                  metric_resource_id:
                    azurermLinuxVirtualMachineScaleSetExample.id,
                  operator: "GreaterThan",
                  statistic: "Average",
                  threshold: 75,
                  time_aggregation: "Average",
                  time_grain: "PT1M",
                  time_window: "PT5M",
                },
              ],
              scale_action: [
                {
                  cooldown: "PT1M",
                  direction: "Increase",
                  type: "ChangeCount",
                  value: "1",
                },
              ],
            },
            {
              metric_trigger: [
                {
                  metric_name: "Percentage CPU",
                  metric_resource_id:
                    azurermLinuxVirtualMachineScaleSetExample.id,
                  operator: "LessThan",
                  statistic: "Average",
                  threshold: 25,
                  time_aggregation: "Average",
                  time_grain: "PT1M",
                  time_window: "PT5M",
                },
              ],
              scale_action: [
                {
                  cooldown: "PT1M",
                  direction: "Decrease",
                  type: "ChangeCount",
                  value: "1",
                },
              ],
            },
          ],
        },
      ],
      resource_group_name: azurermResourceGroupExample.name,
      target_resource_id: azurermLinuxVirtualMachineScaleSetExample.id,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermMonitorAutoscaleSettingExample.overrideLogicalId("example");

Example Usage (repeating on weekends)

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "West Europe",
    name: "autoscalingTest",
  }
);
const azurermVirtualNetworkExample = new azurerm.virtualNetwork.VirtualNetwork(
  this,
  "example_1",
  {
    address_space: ["10.0.0.0/16"],
    location: azurermResourceGroupExample.location,
    name: "acctvn",
    resource_group_name: azurermResourceGroupExample.name,
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermVirtualNetworkExample.overrideLogicalId("example");
const azurermSubnetExample = new azurerm.subnet.Subnet(this, "example_2", {
  address_prefixes: ["10.0.2.0/24"],
  name: "acctsub",
  resource_group_name: azurermResourceGroupExample.name,
  virtual_network_name: azurermVirtualNetworkExample.name,
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermSubnetExample.overrideLogicalId("example");
const azurermLinuxVirtualMachineScaleSetExample =
  new azurerm.linuxVirtualMachineScaleSet.LinuxVirtualMachineScaleSet(
    this,
    "example_3",
    {
      admin_ssh_key: [
        {
          public_key:
            "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",
          username: "myadmin",
        },
      ],
      admin_username: "myadmin",
      instances: 2,
      location: azurermResourceGroupExample.location,
      name: "exampleset",
      network_interface: [
        {
          ip_configuration: [
            {
              name: "TestIPConfiguration",
              primary: true,
              subnet_id: azurermSubnetExample.id,
            },
          ],
          name: "TestNetworkProfile",
          primary: true,
        },
      ],
      os_disk: [
        {
          caching: "ReadWrite",
          storage_account_type: "StandardSSD_LRS",
        },
      ],
      resource_group_name: azurermResourceGroupExample.name,
      sku: "Standard_F2",
      source_image_reference: [
        {
          offer: "UbuntuServer",
          publisher: "Canonical",
          sku: "16.04-LTS",
          version: "latest",
        },
      ],
      upgrade_mode: "Manual",
    }
  );
azurermLinuxVirtualMachineScaleSetExample.addOverride("lifecycle", [
  {
    ignore_changes: ["instances"],
  },
]);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermLinuxVirtualMachineScaleSetExample.overrideLogicalId("example");
const azurermMonitorAutoscaleSettingExample =
  new azurerm.monitorAutoscaleSetting.MonitorAutoscaleSetting(
    this,
    "example_4",
    {
      location: azurermResourceGroupExample.location,
      name: "myAutoscaleSetting",
      notification: [
        {
          email: [
            {
              custom_emails: ["admin@contoso.com"],
              send_to_subscription_administrator: true,
              send_to_subscription_co_administrator: true,
            },
          ],
        },
      ],
      profile: [
        {
          capacity: [
            {
              default: 1,
              maximum: 10,
              minimum: 1,
            },
          ],
          name: "Weekends",
          recurrence: [
            {
              days: ["Saturday", "Sunday"],
              hours: [12],
              minutes: [0],
              timezone: "Pacific Standard Time",
            },
          ],
          rule: [
            {
              metric_trigger: [
                {
                  metric_name: "Percentage CPU",
                  metric_resource_id:
                    azurermLinuxVirtualMachineScaleSetExample.id,
                  operator: "GreaterThan",
                  statistic: "Average",
                  threshold: 90,
                  time_aggregation: "Average",
                  time_grain: "PT1M",
                  time_window: "PT5M",
                },
              ],
              scale_action: [
                {
                  cooldown: "PT1M",
                  direction: "Increase",
                  type: "ChangeCount",
                  value: "2",
                },
              ],
            },
            {
              metric_trigger: [
                {
                  metric_name: "Percentage CPU",
                  metric_resource_id:
                    azurermLinuxVirtualMachineScaleSetExample.id,
                  operator: "LessThan",
                  statistic: "Average",
                  threshold: 10,
                  time_aggregation: "Average",
                  time_grain: "PT1M",
                  time_window: "PT5M",
                },
              ],
              scale_action: [
                {
                  cooldown: "PT1M",
                  direction: "Decrease",
                  type: "ChangeCount",
                  value: "2",
                },
              ],
            },
          ],
        },
      ],
      resource_group_name: azurermResourceGroupExample.name,
      target_resource_id: azurermLinuxVirtualMachineScaleSetExample.id,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermMonitorAutoscaleSettingExample.overrideLogicalId("example");

Example Usage (for fixed dates)

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "West Europe",
    name: "autoscalingTest",
  }
);
const azurermVirtualNetworkExample = new azurerm.virtualNetwork.VirtualNetwork(
  this,
  "example_1",
  {
    address_space: ["10.0.0.0/16"],
    location: azurermResourceGroupExample.location,
    name: "acctvn",
    resource_group_name: azurermResourceGroupExample.name,
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermVirtualNetworkExample.overrideLogicalId("example");
const azurermSubnetExample = new azurerm.subnet.Subnet(this, "example_2", {
  address_prefixes: ["10.0.2.0/24"],
  name: "acctsub",
  resource_group_name: azurermResourceGroupExample.name,
  virtual_network_name: azurermVirtualNetworkExample.name,
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermSubnetExample.overrideLogicalId("example");
const azurermLinuxVirtualMachineScaleSetExample =
  new azurerm.linuxVirtualMachineScaleSet.LinuxVirtualMachineScaleSet(
    this,
    "example_3",
    {
      admin_ssh_key: [
        {
          public_key:
            "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",
          username: "myadmin",
        },
      ],
      admin_username: "myadmin",
      instances: 2,
      location: azurermResourceGroupExample.location,
      name: "exampleset",
      network_interface: [
        {
          ip_configuration: [
            {
              name: "TestIPConfiguration",
              primary: true,
              subnet_id: azurermSubnetExample.id,
            },
          ],
          name: "TestNetworkProfile",
          primary: true,
        },
      ],
      os_disk: [
        {
          caching: "ReadWrite",
          storage_account_type: "StandardSSD_LRS",
        },
      ],
      resource_group_name: azurermResourceGroupExample.name,
      sku: "Standard_F2",
      source_image_reference: [
        {
          offer: "UbuntuServer",
          publisher: "Canonical",
          sku: "16.04-LTS",
          version: "latest",
        },
      ],
      upgrade_mode: "Manual",
    }
  );
azurermLinuxVirtualMachineScaleSetExample.addOverride("lifecycle", [
  {
    ignore_changes: ["instances"],
  },
]);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermLinuxVirtualMachineScaleSetExample.overrideLogicalId("example");
const azurermMonitorAutoscaleSettingExample =
  new azurerm.monitorAutoscaleSetting.MonitorAutoscaleSetting(
    this,
    "example_4",
    {
      enabled: true,
      location: azurermResourceGroupExample.location,
      name: "myAutoscaleSetting",
      notification: [
        {
          email: [
            {
              custom_emails: ["admin@contoso.com"],
              send_to_subscription_administrator: true,
              send_to_subscription_co_administrator: true,
            },
          ],
        },
      ],
      profile: [
        {
          capacity: [
            {
              default: 1,
              maximum: 10,
              minimum: 1,
            },
          ],
          fixed_date: [
            {
              end: "2020-07-31T23:59:59Z",
              start: "2020-07-01T00:00:00Z",
              timezone: "Pacific Standard Time",
            },
          ],
          name: "forJuly",
          rule: [
            {
              metric_trigger: [
                {
                  metric_name: "Percentage CPU",
                  metric_resource_id:
                    azurermLinuxVirtualMachineScaleSetExample.id,
                  operator: "GreaterThan",
                  statistic: "Average",
                  threshold: 90,
                  time_aggregation: "Average",
                  time_grain: "PT1M",
                  time_window: "PT5M",
                },
              ],
              scale_action: [
                {
                  cooldown: "PT1M",
                  direction: "Increase",
                  type: "ChangeCount",
                  value: "2",
                },
              ],
            },
            {
              metric_trigger: [
                {
                  metric_name: "Percentage CPU",
                  metric_resource_id:
                    azurermLinuxVirtualMachineScaleSetExample.id,
                  operator: "LessThan",
                  statistic: "Average",
                  threshold: 10,
                  time_aggregation: "Average",
                  time_grain: "PT1M",
                  time_window: "PT5M",
                },
              ],
              scale_action: [
                {
                  cooldown: "PT1M",
                  direction: "Decrease",
                  type: "ChangeCount",
                  value: "2",
                },
              ],
            },
          ],
        },
      ],
      resource_group_name: azurermResourceGroupExample.name,
      target_resource_id: azurermLinuxVirtualMachineScaleSetExample.id,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermMonitorAutoscaleSettingExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • name - (Required) The name of the AutoScale Setting. Changing this forces a new resource to be created.

  • resourceGroupName - (Required) The name of the Resource Group in the AutoScale Setting should be created. Changing this forces a new resource to be created.

  • location - (Required) Specifies the supported Azure location where the AutoScale Setting should exist. Changing this forces a new resource to be created.

  • profile - (Required) Specifies one or more (up to 20) profile blocks as defined below.

  • targetResourceId - (Required) Specifies the resource ID of the resource that the autoscale setting should be added to. Changing this forces a new resource to be created.

  • enabled - (Optional) Specifies whether automatic scaling is enabled for the target resource. Defaults to true.

  • notification - (Optional) Specifies a notification block as defined below.

  • tags - (Optional) A mapping of tags to assign to the resource.


A profile block supports the following:

  • name - (Required) Specifies the name of the profile.

  • capacity - (Required) A capacity block as defined below.

  • rule - (Optional) One or more (up to 10) rule blocks as defined below.

  • fixedDate - (Optional) A fixedDate block as defined below. This cannot be specified if a recurrence block is specified.

  • recurrence - (Optional) A recurrence block as defined below. This cannot be specified if a fixedDate block is specified.


A capacity block supports the following:

  • default - (Required) The number of instances that are available for scaling if metrics are not available for evaluation. The default is only used if the current instance count is lower than the default. Valid values are between 0 and 1000.

  • maximum - (Required) The maximum number of instances for this resource. Valid values are between 0 and 1000.

-> NOTE: The maximum number of instances is also limited by the amount of Cores available in the subscription.

  • minimum - (Required) The minimum number of instances for this resource. Valid values are between 0 and 1000.

A rule block supports the following:

  • metricTrigger - (Required) A metricTrigger block as defined below.

  • scaleAction - (Required) A scaleAction block as defined below.


A metricTrigger block supports the following:

  • metricName - (Required) The name of the metric that defines what the rule monitors, such as percentageCpu for virtualMachineScaleSets and cpuPercentage for appServicePlan.

-> NOTE: The allowed value of metricName highly depends on the targeting resource type, please visit Supported metrics with Azure Monitor for more details.

  • metricResourceId - (Required) The ID of the Resource which the Rule monitors.

  • operator - (Required) Specifies the operator used to compare the metric data and threshold. Possible values are: equals, notEquals, greaterThan, greaterThanOrEqual, lessThan, lessThanOrEqual.

  • statistic - (Required) Specifies how the metrics from multiple instances are combined. Possible values are average, max, min and sum.

  • timeAggregation - (Required) Specifies how the data that's collected should be combined over time. Possible values include average, count, maximum, minimum, last and total.

  • timeGrain - (Required) Specifies the granularity of metrics that the rule monitors, which must be one of the pre-defined values returned from the metric definitions for the metric. This value must be between 1 minute and 12 hours an be formatted as an ISO 8601 string.

  • timeWindow - (Required) Specifies the time range for which data is collected, which must be greater than the delay in metric collection (which varies from resource to resource). This value must be between 5 minutes and 12 hours and be formatted as an ISO 8601 string.

  • threshold - (Required) Specifies the threshold of the metric that triggers the scale action.

  • metricNamespace - (Optional) The namespace of the metric that defines what the rule monitors, such as microsoftCompute/virtualmachinescalesets for virtualMachineScaleSets.

  • dimensions - (Optional) One or more dimensions block as defined below.

  • divideByInstanceCount - (Optional) Whether to enable metric divide by instance count.


A scaleAction block supports the following:

  • cooldown - (Required) The amount of time to wait since the last scaling action before this action occurs. Must be between 1 minute and 1 week and formatted as a ISO 8601 string.

  • direction - (Required) The scale direction. Possible values are increase and decrease.

  • type - (Required) The type of action that should occur. Possible values are changeCount, exactCount, percentChangeCount and serviceAllowedNextValue.

  • value - (Required) The number of instances involved in the scaling action.


A fixedDate block supports the following:

  • end - (Required) Specifies the end date for the profile, formatted as an RFC3339 date string.

  • start - (Required) Specifies the start date for the profile, formatted as an RFC3339 date string.

  • timezone - (Optional) The Time Zone of the start and end times. A list of possible values can be found here. Defaults to utc.


A recurrence block supports the following:

  • timezone - (Optional) The Time Zone used for the hours field. A list of possible values can be found here. Defaults to utc.

  • days - (Required) A list of days that this profile takes effect on. Possible values include monday, tuesday, wednesday, thursday, friday, saturday and sunday.

  • hours - (Required) A list containing a single item, which specifies the Hour interval at which this recurrence should be triggered (in 24-hour time). Possible values are from 0 to 23.

  • minutes - (Required) A list containing a single item which specifies the Minute interval at which this recurrence should be triggered.


A notification block supports the following:

  • email - (Optional) A email block as defined below.

  • webhook - (Optional) One or more webhook blocks as defined below.


A email block supports the following:

  • sendToSubscriptionAdministrator - (Optional) Should email notifications be sent to the subscription administrator? Defaults to false.

  • sendToSubscriptionCoAdministrator - (Optional) Should email notifications be sent to the subscription co-administrator? Defaults to false.

  • customEmails - (Optional) Specifies a list of custom email addresses to which the email notifications will be sent.


A webhook block supports the following:

  • serviceUri - (Required) The HTTPS URI which should receive scale notifications.

  • properties - (Optional) A map of settings.


A dimensions block supports the following:

  • name - (Required) The name of the dimension.

  • operator - (Required) The dimension operator. Possible values are equals and notEquals. equals means being equal to any of the values. notEquals means being not equal to any of the values.

  • values - (Required) A list of dimension values.

Attributes Reference

The following attributes are exported:

  • id - The ID of the AutoScale Setting.

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • create - (Defaults to 30 minutes) Used when creating the AutoScale Setting.
  • update - (Defaults to 30 minutes) Used when updating the AutoScale Setting.
  • read - (Defaults to 5 minutes) Used when retrieving the AutoScale Setting.
  • delete - (Defaults to 30 minutes) Used when deleting the AutoScale Setting.

Import

AutoScale Setting can be imported using the resourceId, e.g.

terraform import azurerm_monitor_autoscale_setting.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Insights/autoScaleSettings/setting1