Skip to content

Latest commit

 

History

History
97 lines (67 loc) · 4.33 KB

app_service_environment.html.markdown

File metadata and controls

97 lines (67 loc) · 4.33 KB
subcategory layout page_title description
App Service (Web Apps)
azurerm
Azure Resource Manager: azurerm_app_service_environment
Manages an App Service Environment.

azurerm_app_service_environment

Manages an App Service Environment.

Example Usage

resource "azurerm_resource_group" "example" {
  name     = "exampleRG1"
  location = "westeurope"
}

resource "azurerm_virtual_network" "example" {
  name                = "example-vnet1"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  address_space       = ["10.0.0.0/16"]
}

resource "azurerm_subnet" "ase" {
  name                 = "asesubnet"
  resource_group_name  = azurerm_resource_group.example.name
  virtual_network_name = azurerm_virtual_network.example.name
  address_prefix       = "10.0.1.0/24"
}

resource "azurerm_subnet" "gateway" {
  name                 = "gatewaysubnet"
  resource_group_name  = azurerm_resource_group.example.name
  virtual_network_name = azurerm_virtual_network.example.name
  address_prefix       = "10.0.2.0/24"
}

resource "azurerm_app_service_environment" "example" {
  name                         = "example-ase"
  subnet_id                    = azurerm_subnet.ase.id
  pricing_tier                 = "I2"
  front_end_scale_factor       = 10
  internal_load_balancing_mode = "Web, Publishing"
  user_whitelisted_ip_ranges   = ["11.22.33.44/32", "55.66.77.0/24"]
}

Argument Reference

  • name - (Required) The name of the App Service Environment. Changing this forces a new resource to be created.

  • subnet_id - (Required) The ID of the Subnet which the App Service Environment should be connected to. Changing this forces a new resource to be created.

~> NOTE a /24 or larger CIDR is required. Once associated with an ASE this size cannot be changed.

  • internal_load_balancing_mode - (Optional) Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. Possible values are None, Web, Publishing and combined value "Web, Publishing". Defaults to None.

  • pricing_tier - (Optional) Pricing tier for the front end instances. Possible values are I1, I2 and I3. Defaults to I1.

  • front_end_scale_factor - (Optional) Scale factor for front end instances. Possible values are between 5 and 15. Defaults to 15.

  • user_whitelisted_ip_ranges - (Optional) User added IP ranges to whitelist on ASE db. Use the addresses you want to set as the explicit egress address ranges. Use CIDR format.

~> NOTE: user_whitelisted_ip_ranges The addresses that will be used for all outbound traffic from your App Service Environment to the internet to avoid asymmetric routing challenge. If you're routing the traffic on premises, these addresses are your NATs or gateway IPs. If you want to route the App Service Environment outbound traffic through an NVA, the egress address is the public IP of the NVA. Please visit Create your ASE with the egress addresses

  • resource_group_name - (Optional) The name of the Resource Group where the App Service Environment exists. Defaults to the Resource Group of the Subnet (specified by subnet_id).

  • tags - (Optional) A mapping of tags to assign to the resource. Changing this forces a new resource to be created.

Attribute Reference

  • id - The ID of the App Service Environment.

  • location - The location where the App Service Environment exists.

Timeouts

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

  • create - (Defaults to 4 hours) Used when creating the App Service Environment.
  • update - (Defaults to 4 hours) Used when updating the App Service Environment.
  • read - (Defaults to 5 minutes) Used when retrieving the App Service Environment.
  • delete - (Defaults to 4 hours) Used when deleting the App Service Environment.

Import

The App Service Environment can be imported using the resource id, e.g.

terraform import azurerm_app_service_environment.myAppServiceEnv /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Web/hostingEnvironments/myAppServiceEnv