Skip to content

Commit 572eae0

Browse files
authored
overhaul of az support and doc updates (#114)
* overhaul of az support and doc updates * updating locals.tf with regions that support az * testing seed region for p1v2 * adding reference to avm_res_web_serferfarm module * removing references to service_plan output
1 parent c2a8901 commit 572eae0

52 files changed

Lines changed: 357 additions & 506 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 56 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ The following resources are used by this module:
4848
- [azurerm_role_assignment.slot](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/role_assignment) (resource)
4949
- [azurerm_role_assignment.slot_pe](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/role_assignment) (resource)
5050
- [azurerm_role_assignment.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/role_assignment) (resource)
51-
- [azurerm_service_plan.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/service_plan) (resource)
5251
- [azurerm_web_app_active_slot.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/web_app_active_slot) (resource)
5352
- [azurerm_windows_function_app.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/windows_function_app) (resource)
5453
- [azurerm_windows_function_app_slot.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/windows_function_app_slot) (resource)
@@ -72,7 +71,7 @@ Type: `string`
7271

7372
### <a name="input_location"></a> [location](#input\_location)
7473

75-
Description: Azure region where the resource should be deployed. If null, the location will be inferred from the resource group location.
74+
Description: Azure region where the resource should be deployed.
7675

7776
Type: `string`
7877

@@ -1207,7 +1206,7 @@ map(object({
12071206
virtual_network_subnet_id = optional(string)
12081207
headers = optional(map(object({
12091208
x_azure_fdid = optional(list(string))
1210-
x_fd_health_probe = optional(number)
1209+
x_fd_health_probe = optional(list(string), ["1"])
12111210
x_forwarded_for = optional(list(string))
12121211
x_forwarded_host = optional(list(string))
12131212
})), {})
@@ -1221,7 +1220,7 @@ map(object({
12211220
virtual_network_subnet_id = optional(string)
12221221
headers = optional(map(object({
12231222
x_azure_fdid = optional(list(string))
1224-
x_fd_health_probe = optional(number)
1223+
x_fd_health_probe = optional(list(string), ["1"])
12251224
x_forwarded_for = optional(list(string))
12261225
x_forwarded_host = optional(list(string))
12271226
})), {})
@@ -1348,6 +1347,11 @@ Description: A map of objects that represent a Storage Account to mount to the
13481347
- `name` - (Optional) The name of the Storage Account.
13491348
- `resource_group_name` - (Optional) The name of the resource group to deploy the Storage Account in.
13501349
- `location` - (Optional) The Azure region where the Storage Account will be deployed.
1350+
- `account_kind` - (Optional) The kind of the Storage Account. Defaults to `StorageV2`.
1351+
- `account_tier` - (Optional) The tier of the Storage Account. Defaults to `Standard`.
1352+
- `account_replication_type` - (Optional) The replication type of the Storage Account.
1353+
- `shared_access_key_enabled` - (Optional) Should the shared access key be enabled for the Storage Account? Defaults to `true`.
1354+
- `public_network_access_enabled` - (Optional) Should public network access be enabled for the Storage Account? Defaults to `true`.
13511355
- `lock` - (Optional) The lock level to apply.
13521356
- `role_assignments` - (Optional) A map of role assignments to assign to the Storage Account.
13531357

@@ -1359,9 +1363,14 @@ Type:
13591363

13601364
```hcl
13611365
object({
1362-
name = optional(string)
1363-
resource_group_name = optional(string)
1364-
location = optional(string)
1366+
name = optional(string)
1367+
resource_group_name = optional(string)
1368+
location = optional(string)
1369+
account_kind = optional(string, "StorageV2")
1370+
account_tier = optional(string, "Standard")
1371+
account_replication_type = optional(string)
1372+
shared_access_key_enabled = optional(bool, true)
1373+
public_network_access_enabled = optional(bool, true)
13651374
lock = optional(object({
13661375
kind = string
13671376
name = optional(string, null)
@@ -1509,10 +1518,11 @@ Description: A map of objects that represent a new App Service Plan to create
15091518
- `name` - (Optional) The name of the App Service Plan.
15101519
- `resource_group_name` - (Optional) The name of the resource group to deploy the App Service Plan in.
15111520
- `location` - (Optional) The Azure region where the App Service Plan will be deployed. Defaults to the location of the resource group.
1512-
- `sku_name` - (Optional) The SKU name of the App Service Plan. Defaults to `B1`.
1521+
- `sku_name` - (Optional) The SKU name of the App Service Plan. Defaults to `P1v2`.
1522+
> Possible values include `B1`, `B2`, `B3`, `D1`, `F1`, `I1`, `I2`, `I3`, `I1v2`, `I2v2`, `I3v2`, `I4v2`, `I5v2`, `I6v2`, `P1v2`, `P2v2`, `P3v2`, `P0v3`, `P1v3`,`P2v3`, `P3v3`, `P1mv3`, `P2mv3`, `P3mv3`, `P4mv3`, `P5mv3`, `S1`, `S2`, `S3`, `SHARED`, `EP1`, `EP2`, `EP3`, `FC1`, `WS1`, `WS2`, `WS3`, and `Y1`.
15131523
- `app_service_environment_resource_id` - (Optional) The resource ID of the App Service Environment to deploy the App Service Plan in.
1514-
- `maximum_elastic_worker_count` - (Optional) The maximum number of workers that can be allocated to this App Service Plan.
1515-
- `worker_count` - (Optional) The number of workers to allocate to this App Service Plan.
1524+
- `maximum_elastic_worker_count` - (Optional) The maximum number of workers that can be allocated to Elastic SKU Plan. Cannot be set unless using an Elastic SKU.
1525+
- `worker_count` - (Optional) The number of workers to allocate to this App Service Plan. Defaults to `3`.
15161526
- `per_site_scaling_enabled` - (Optional) Should per site scaling be enabled for the App Service Plan? Defaults to `false`.
15171527
- `zone_balancing_enabled` - (Optional) Should zone balancing be enabled for the App Service Plan? Changing this forces a new resource to be created.
15181528
> **NOTE:** If this setting is set to `true` and the `worker_count` value is specified, it should be set to a multiple of the number of availability zones in the region. Please see the Azure documentation for the number of Availability Zones in your region.
@@ -1524,12 +1534,26 @@ object({
15241534
name = optional(string)
15251535
resource_group_name = optional(string)
15261536
location = optional(string)
1527-
sku_name = optional(string)
1537+
sku_name = optional(string, "P1v2")
15281538
app_service_environment_resource_id = optional(string)
15291539
maximum_elastic_worker_count = optional(number)
1530-
worker_count = optional(number)
1540+
worker_count = optional(number, 3)
15311541
per_site_scaling_enabled = optional(bool, false)
1532-
zone_balancing_enabled = optional(bool)
1542+
zone_balancing_enabled = optional(bool, true)
1543+
lock = optional(object({
1544+
kind = string
1545+
name = optional(string, null)
1546+
}), null)
1547+
role_assignments = optional(map(object({
1548+
role_definition_id_or_name = string
1549+
principal_id = string
1550+
description = optional(string, null)
1551+
skip_service_principal_aad_check = optional(bool, false)
1552+
condition = optional(string, null)
1553+
condition_version = optional(string, null)
1554+
delegated_managed_identity_resource_id = optional(string, null)
1555+
principal_type = optional(string, null)
1556+
})), {})
15331557
})
15341558
```
15351559

@@ -1837,7 +1861,7 @@ object({
18371861
virtual_network_subnet_id = optional(string)
18381862
headers = optional(map(object({
18391863
x_azure_fdid = optional(list(string))
1840-
x_fd_health_probe = optional(number)
1864+
x_fd_health_probe = optional(list(string), ["1"])
18411865
x_forwarded_for = optional(list(string))
18421866
x_forwarded_host = optional(list(string))
18431867
})), {})
@@ -1851,7 +1875,7 @@ object({
18511875
virtual_network_subnet_id = optional(string)
18521876
headers = optional(map(object({
18531877
x_azure_fdid = optional(list(string))
1854-
x_fd_health_probe = optional(number)
1878+
x_fd_health_probe = optional(list(string), ["1"])
18551879
x_forwarded_for = optional(list(string))
18561880
x_forwarded_host = optional(list(string))
18571881
})), {})
@@ -2032,6 +2056,10 @@ Description: The object principal id of the resource.
20322056

20332057
Description: The kind of app service.
20342058

2059+
### <a name="output_location"></a> [location](#output\_location)
2060+
2061+
Description: The location of the resource.
2062+
20352063
### <a name="output_name"></a> [name](#output\_name)
20362064

20372065
Description: The name of the resource.
@@ -2064,9 +2092,13 @@ Description: A map of private endpoints. The map key is the supplied input to va
20642092

20652093
Description: The default hostname of the resource.
20662094

2067-
### <a name="output_service_plan"></a> [service\_plan](#output\_service\_plan)
2095+
### <a name="output_service_plan_id"></a> [service\_plan\_id](#output\_service\_plan\_id)
20682096

2069-
Description: The service plan resource.
2097+
Description: The resource id of the service plan.
2098+
2099+
### <a name="output_service_plan_name"></a> [service\_plan\_name](#output\_service\_plan\_name)
2100+
2101+
Description: The name of the created service plan.
20702102

20712103
### <a name="output_storage_account"></a> [storage\_account](#output\_storage\_account)
20722104

@@ -2100,7 +2132,13 @@ The following Modules are called:
21002132

21012133
Source: Azure/avm-res-storage-storageaccount/azurerm
21022134

2103-
Version: 0.1.2
2135+
Version: 0.2.4
2136+
2137+
### <a name="module_avm_res_web_serverfarm"></a> [avm\_res\_web\_serverfarm](#module\_avm\_res\_web\_serverfarm)
2138+
2139+
Source: Azure/avm-res-web-serverfarm/azurerm
2140+
2141+
Version: 0.1.0
21042142

21052143
<!-- markdownlint-disable-next-line MD041 -->
21062144
## Data Collection

avm.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ IF "%~1"=="" (
1818
)
1919

2020
REM Run the make target with CONTAINER_RUNTIME
21-
%CONTAINER_RUNTIME% run --pull always --rm -v "%cd%":/src -w /src --user "1000:1000" -r ARM_SUBSCRIPTION_ID -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER mcr.microsoft.com/azterraform make %1
21+
%CONTAINER_RUNTIME% run --pull always --rm -v "%cd%":/src -w /src --user "1000:1000" -e ARM_SUBSCRIPTION_ID -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER mcr.microsoft.com/azterraform make %1
2222

2323
ENDLOCAL

examples/auto_heal_enabled/README.md

Lines changed: 2 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- BEGIN_TF_DOCS -->
22
# Default example
33

4-
This deploys the module utilizing auto heal settings.
4+
This deploys the module as a Linux Web App utilizing auto heal settings.
55

66
```hcl
77
terraform {
@@ -54,39 +54,11 @@ resource "azurerm_resource_group" "example" {
5454
name = module.naming.resource_group.name_unique
5555
}
5656
57-
/*
58-
module "avm_res_storage_storageaccount" {
59-
source = "Azure/avm-res-storage-storageaccount/azurerm"
60-
version = "0.1.1"
61-
62-
enable_telemetry = false
63-
name = module.naming.storage_account.name_unique
64-
resource_group_name = azurerm_resource_group.example.name
65-
shared_access_key_enabled = true
66-
public_network_access_enabled = true
67-
network_rules = {
68-
bypass = ["AzureServices"]
69-
default_action = "Allow"
70-
}
71-
}
72-
*/
73-
74-
/*
75-
resource "azurerm_service_plan" "example" {
76-
location = azurerm_resource_group.example.location
77-
# This will equate to Consumption (Serverless) in portal
78-
name = module.naming.app_service_plan.name_unique
79-
os_type = "Windows"
80-
resource_group_name = azurerm_resource_group.example.name
81-
sku_name = "Y1"
82-
}
83-
*/
84-
8557
module "test" {
8658
source = "../../"
8759
8860
# source = "Azure/avm-res-web-site/azurerm"
89-
# version = "0.9.1"
61+
# version = "0.9.2"
9062
9163
enable_telemetry = var.enable_telemetry
9264
@@ -134,31 +106,8 @@ module "test" {
134106
# }
135107
}
136108
137-
138-
/*
139-
# Uses an existing app service plan
140-
os_type = azurerm_service_plan.example.os_type
141-
service_plan_resource_id = azurerm_service_plan.example.id
142-
*/
143-
144109
# Creates a new app service plan
145110
create_service_plan = true
146-
new_service_plan = {
147-
sku_name = "S1"
148-
}
149-
150-
/*
151-
# Uses an existing storage account
152-
storage_account_name = module.avm_res_storage_storageaccount.name
153-
storage_account_access_key = module.avm_res_storage_storageaccount.resource.primary_access_key
154-
*/
155-
156-
# Uses the avm-res-storage-storageaccount module to create a new storage account within root module
157-
# function_app_create_storage_account = true
158-
# function_app_storage_account = {
159-
# name = module.naming.storage_account.name_unique
160-
# resource_group_name = azurerm_resource_group.example.name
161-
# }
162111
}
163112
```
164113

@@ -219,10 +168,6 @@ Description: This is the full output for the resource.
219168

220169
Description: This is the full output for the resource.
221170

222-
### <a name="output_service_plan"></a> [service\_plan](#output\_service\_plan)
223-
224-
Description: Full output of service plan created
225-
226171
### <a name="output_storage_account"></a> [storage\_account](#output\_storage\_account)
227172

228173
Description: Full output of storage account created
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Default example
22

3-
This deploys the module utilizing auto heal settings.
3+
This deploys the module as a Linux Web App utilizing auto heal settings.
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
locals {
22
azure_regions = [
33
"eastus",
4-
"westeurope",
5-
"eastasia",
6-
"japaneast"
4+
"eastus2",
5+
"centralus",
6+
"southcentralus",
7+
"westus2",
8+
"westus3"
79
]
810
}

examples/auto_heal_enabled/main.tf

Lines changed: 1 addition & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -48,39 +48,11 @@ resource "azurerm_resource_group" "example" {
4848
name = module.naming.resource_group.name_unique
4949
}
5050

51-
/*
52-
module "avm_res_storage_storageaccount" {
53-
source = "Azure/avm-res-storage-storageaccount/azurerm"
54-
version = "0.1.1"
55-
56-
enable_telemetry = false
57-
name = module.naming.storage_account.name_unique
58-
resource_group_name = azurerm_resource_group.example.name
59-
shared_access_key_enabled = true
60-
public_network_access_enabled = true
61-
network_rules = {
62-
bypass = ["AzureServices"]
63-
default_action = "Allow"
64-
}
65-
}
66-
*/
67-
68-
/*
69-
resource "azurerm_service_plan" "example" {
70-
location = azurerm_resource_group.example.location
71-
# This will equate to Consumption (Serverless) in portal
72-
name = module.naming.app_service_plan.name_unique
73-
os_type = "Windows"
74-
resource_group_name = azurerm_resource_group.example.name
75-
sku_name = "Y1"
76-
}
77-
*/
78-
7951
module "test" {
8052
source = "../../"
8153

8254
# source = "Azure/avm-res-web-site/azurerm"
83-
# version = "0.9.1"
55+
# version = "0.9.2"
8456

8557
enable_telemetry = var.enable_telemetry
8658

@@ -128,29 +100,6 @@ module "test" {
128100
# }
129101
}
130102

131-
132-
/*
133-
# Uses an existing app service plan
134-
os_type = azurerm_service_plan.example.os_type
135-
service_plan_resource_id = azurerm_service_plan.example.id
136-
*/
137-
138103
# Creates a new app service plan
139104
create_service_plan = true
140-
new_service_plan = {
141-
sku_name = "S1"
142-
}
143-
144-
/*
145-
# Uses an existing storage account
146-
storage_account_name = module.avm_res_storage_storageaccount.name
147-
storage_account_access_key = module.avm_res_storage_storageaccount.resource.primary_access_key
148-
*/
149-
150-
# Uses the avm-res-storage-storageaccount module to create a new storage account within root module
151-
# function_app_create_storage_account = true
152-
# function_app_storage_account = {
153-
# name = module.naming.storage_account.name_unique
154-
# resource_group_name = azurerm_resource_group.example.name
155-
# }
156105
}

examples/auto_heal_enabled/outputs.tf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ output "resource" {
2020
value = module.test.resource
2121
}
2222

23-
output "service_plan" {
24-
description = "Full output of service plan created"
25-
value = module.test.service_plan
26-
}
27-
2823
output "storage_account" {
2924
description = "Full output of storage account created"
3025
sensitive = true

examples/basic_auth/README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ module "test" {
8787
source = "../../"
8888
8989
# source = "Azure/avm-res-web-site/azurerm"
90-
# version = "0.9.1"
90+
# version = "0.9.2"
9191
9292
enable_telemetry = var.enable_telemetry
9393
@@ -199,10 +199,6 @@ Description: This is the full output for the resource.
199199

200200
Description: This is the full output for the resource.
201201

202-
### <a name="output_service_plan"></a> [service\_plan](#output\_service\_plan)
203-
204-
Description: Full output of service plan created
205-
206202
### <a name="output_storage_account"></a> [storage\_account](#output\_storage\_account)
207203

208204
Description: Full output of storage account created

0 commit comments

Comments
 (0)