Skip to content

Commit

Permalink
Docs: Add ASEv3 example (#13582)
Browse files Browse the repository at this point in the history
  • Loading branch information
samlin-msft authored Dec 17, 2021
1 parent fc3f898 commit ddb2fd4
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 8 deletions.
69 changes: 69 additions & 0 deletions examples/app-service-environment-v3/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
terraform {
required_providers {
azurerm = {
version = ">=2.76.0"
}
random = {
version = "3.1.0"
}
}
}

provider "azurerm" {
features {}
}

resource "azurerm_resource_group" "example" {
name = "exampleRG1"
location = "West Europe"
}

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

resource "azurerm_subnet" "example" {
name = "example-subnet"
resource_group_name = azurerm_resource_group.example.name
virtual_network_name = azurerm_virtual_network.example.name
address_prefixes = ["10.0.2.0/24"]

delegation {
name = "Microsoft.Web.hostingEnvironments"
service_delegation {
name = "Microsoft.Web/hostingEnvironments"
actions = ["Microsoft.Network/virtualNetworks/subnets/action"]
}
}
}

resource "azurerm_app_service_environment_v3" "example" {
name = "example-asev3"
resource_group_name = azurerm_resource_group.example.name
subnet_id = azurerm_subnet.example.id

internal_load_balancing_mode = "Web, Publishing"

cluster_setting {
name = "DisableTls1.0"
value = "1"
}

cluster_setting {
name = "InternalEncryption"
value = "true"
}

cluster_setting {
name = "FrontEndSSLCipherSuiteOrder"
value = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"
}

tags = {
env = "production"
terraformed = "true"
}
}
20 changes: 12 additions & 8 deletions website/docs/r/app_service_environment_v3.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,29 @@ Manages a 3rd Generation (v3) App Service Environment.

## Example Usage

This example provisions an App Service Environment V3. Additional examples of how to use the `azurerm_app_service_environment_v3` resource can be found [in the `./examples/app-service-environment-v3` directory](https://github.com/hashicorp/terraform-provider-azurerm/tree/main/examples/app-service-environment-v3) within the Github Repository.

```hcl
resource "azurerm_resource_group" "example" {
name = "exampleRG1"
location = "West Europe"
}
resource "azurerm_virtual_network" "example" {
name = "example-vnet1"
name = "example-vnet"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
address_space = ["10.0.0.0/16"]
}
resource "azurerm_subnet" "example" {
name = "outbound"
name = "example-subnet"
resource_group_name = azurerm_resource_group.example.name
virtual_network_name = azurerm_virtual_network.example.name
address_prefixes = ["10.0.2.0/24"]
delegation {
name = "delegation"
name = "Microsoft.Web.hostingEnvironments"
service_delegation {
name = "Microsoft.Web/hostingEnvironments"
actions = ["Microsoft.Network/virtualNetworks/subnets/action"]
Expand All @@ -47,6 +48,8 @@ resource "azurerm_app_service_environment_v3" "example" {
resource_group_name = azurerm_resource_group.example.name
subnet_id = azurerm_subnet.example.id
internal_load_balancing_mode = "Web, Publishing"
cluster_setting {
name = "DisableTls1.0"
value = "1"
Expand All @@ -66,11 +69,8 @@ resource "azurerm_app_service_environment_v3" "example" {
env = "production"
terraformed = "true"
}
}
```

## Argument Reference

* `name` - (Required) The name of the App Service Environment. Changing this forces a new resource to be created.
Expand All @@ -87,7 +87,9 @@ resource "azurerm_app_service_environment_v3" "example" {

* `cluster_setting` - (Optional) Zero or more `cluster_setting` blocks as defined below.

* `dedicated_host_count` - (Optional) This ASEv3 should use dedicated Hosts. Possible vales are `2`. Changing this forces a new resource to be created.
* `dedicated_host_count` - (Optional) This ASEv3 should use dedicated Hosts. Possible values are `2`. Changing this forces a new resource to be created.

* `zone_redundant` - (Optional) Set to `true` to deploy the ASEv3 with availability zones supported. Zonal ASEs can be deployed in some regions, you can refer to [Availability Zone support for App Service Environments](https://docs.microsoft.com/en-us/azure/app-service/environment/zone-redundancy). You can only set either `dedicated_host_count` or `zone_redundant` but not both.

~> **NOTE:** Setting this value will provision 2 Physical Hosts for your App Service Environment V3, this is done at additional cost, please be aware of the pricing commitment in the [General Availability Notes](https://techcommunity.microsoft.com/t5/apps-on-azure/announcing-app-service-environment-v3-ga/ba-p/2517990)

Expand All @@ -109,6 +111,8 @@ A `cluster_setting` block supports the following:

## Attribute Reference

In addition to the Arguments above, the following Attributes are exported:

* `id` - The ID of the App Service Environment.

* `dns_suffix` - the DNS suffix for this App Service Environment V3.
Expand Down

0 comments on commit ddb2fd4

Please sign in to comment.