0

I am creating a module for configuring Azure Application Gateway with Terraform. In the azurerm_application_gateway resource, in the sku block, I see Name, tier, and capacity, but I don't see how to make this setting for what I see in the portal, "Capacity type" Autoscale, minimum scale units. Anyone have an terraform example of how to do this?

resource "azurerm_application_gateway" "network" {
  name                = "${var.application_gateway_name}"
  resource_group_name = "${var.resource_group_name[0]}"
  location            = "${var.location}"

  sku {
    name     = "${var.sku_name}"
    tier     = "${var.sku_tier}"
    capacity = "${var.sku_capacity}"
  }
i255d
  • 20
  • 5

2 Answers2

1

Here is an example usage for Azure Application Gateway with terraform.

An SKU block supports the following:

name - (Required) The Name of the SKU to use for this Application Gateway. Possible values are Standard_Small, Standard_Medium, Standard_Large, Standard_v2, WAF_Medium, WAF_Large, and WAF_v2.

tier - (Required) The Tier of the SKU to use for this Application Gateway. Possible values are Standard, Standard_v2, WAF and WAF_v2.

capacity - (Required) The Capacity of the SKU to use for this Application Gateway - which must be between 1 and 10.

Update

Since the autoscaling application gateway SKU is currently in public preview. There are no specific parameters with traditional SKU blocks for configuring "Capacity type" Autoscale, minimum scale units like it running on the Azure portal.

Like creating an autoscale application gateway with Powershell. When you configure autoscaling you don't set that capacity on the SKU, but add a new mincapacity parameter.

$autoscaleConfig = New-AzureRmApplicationGatewayAutoscaleConfiguration -MinCapacity 2
$sku = New-AzureRmApplicationGatewaySku -Name Standard_v2 -Tier Standard_v2

You could also refer to the same issue open in GitHub.

Nancy
  • 26,865
  • 3
  • 18
  • 34
  • Did you bother to read the question? You copied the same code that I have in the question.. The question is does Terraform have a way to do what can be done in the portal, which is set "Capacity type" Autoscale, and minimum scale units??? – i255d Feb 05 '19 at 20:49
  • Sorry, it's my bad. Currently, we could not set autoscaling with terraform, check my update. – Nancy Feb 11 '19 at 07:26
-3

Did you bother to read the question? You copied the same code that I have in the question.. The question is does Terraform have a way to do what can be done in the portal, which is set "Capacity type" Autoscale, and minimum scale units???

i255d
  • 20
  • 5