From 572eae031abd995ad25e50f176b90786b96132b1 Mon Sep 17 00:00:00 2001 From: Donovan McCoy <144926888+donovm4@users.noreply.github.com> Date: Mon, 9 Sep 2024 16:35:22 -0400 Subject: [PATCH] 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 --- README.md | 74 ++++++++++++++----- avm.bat | 2 +- examples/auto_heal_enabled/README.md | 59 +-------------- examples/auto_heal_enabled/_header.md | 2 +- examples/auto_heal_enabled/locals.tf | 8 +- examples/auto_heal_enabled/main.tf | 53 +------------ examples/auto_heal_enabled/outputs.tf | 5 -- examples/basic_auth/README.md | 6 +- examples/basic_auth/locals.tf | 8 +- examples/basic_auth/main.tf | 2 +- examples/basic_auth/outputs.tf | 5 -- examples/custom_domain/README.md | 14 +++- examples/custom_domain/locals.tf | 8 +- examples/custom_domain/main.tf | 14 +++- examples/default/README.md | 30 +++++--- examples/default/locals.tf | 8 +- examples/default/main.tf | 12 +-- examples/default/outputs.tf | 28 +++++-- .../deployment_slot_with_interfaces/README.md | 6 +- .../deployment_slot_with_interfaces/locals.tf | 8 +- .../deployment_slot_with_interfaces/main.tf | 2 +- .../outputs.tf | 5 -- examples/function_app/README.md | 2 +- examples/function_app/locals.tf | 8 +- examples/function_app/main.tf | 2 +- examples/interfaces/README.md | 2 +- examples/interfaces/locals.tf | 8 +- examples/interfaces/main.tf | 2 +- examples/ip_restriction/README.md | 52 +------------ examples/ip_restriction/_header.md | 2 +- examples/ip_restriction/locals.tf | 8 +- examples/ip_restriction/main.tf | 50 +------------ examples/logs/README.md | 45 +---------- examples/logs/_header.md | 2 +- examples/logs/locals.tf | 8 +- examples/logs/main.tf | 43 +---------- .../storage_uses_managed_identity/README.md | 13 ++-- .../storage_uses_managed_identity/locals.tf | 8 +- .../storage_uses_managed_identity/main.tf | 11 +-- examples/web_app/README.md | 17 +---- examples/web_app/_header.md | 2 +- examples/web_app/locals.tf | 8 +- examples/web_app/main.tf | 14 +--- main.function_app.tf | 35 +++++---- main.function_app_slots.tf | 26 ++++--- main.service_plan.tf | 30 +++++++- main.storage_account.tf | 9 ++- main.web_app.tf | 16 ++-- main.web_app_slots.tf | 12 +-- outputs.tf | 16 +++- variables.slots.tf | 4 +- variables.tf | 49 +++++++++--- 52 files changed, 357 insertions(+), 506 deletions(-) diff --git a/README.md b/README.md index 8bb2c98..7852eb2 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,6 @@ The following resources are used by this module: - [azurerm_role_assignment.slot](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/role_assignment) (resource) - [azurerm_role_assignment.slot_pe](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/role_assignment) (resource) - [azurerm_role_assignment.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/role_assignment) (resource) -- [azurerm_service_plan.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/service_plan) (resource) - [azurerm_web_app_active_slot.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/web_app_active_slot) (resource) - [azurerm_windows_function_app.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/windows_function_app) (resource) - [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` ### [location](#input\_location) -Description: Azure region where the resource should be deployed. If null, the location will be inferred from the resource group location. +Description: Azure region where the resource should be deployed. Type: `string` @@ -1207,7 +1206,7 @@ map(object({ virtual_network_subnet_id = optional(string) headers = optional(map(object({ x_azure_fdid = optional(list(string)) - x_fd_health_probe = optional(number) + x_fd_health_probe = optional(list(string), ["1"]) x_forwarded_for = optional(list(string)) x_forwarded_host = optional(list(string)) })), {}) @@ -1221,7 +1220,7 @@ map(object({ virtual_network_subnet_id = optional(string) headers = optional(map(object({ x_azure_fdid = optional(list(string)) - x_fd_health_probe = optional(number) + x_fd_health_probe = optional(list(string), ["1"]) x_forwarded_for = optional(list(string)) x_forwarded_host = optional(list(string)) })), {}) @@ -1348,6 +1347,11 @@ Description: A map of objects that represent a Storage Account to mount to the - `name` - (Optional) The name of the Storage Account. - `resource_group_name` - (Optional) The name of the resource group to deploy the Storage Account in. - `location` - (Optional) The Azure region where the Storage Account will be deployed. + - `account_kind` - (Optional) The kind of the Storage Account. Defaults to `StorageV2`. + - `account_tier` - (Optional) The tier of the Storage Account. Defaults to `Standard`. + - `account_replication_type` - (Optional) The replication type of the Storage Account. + - `shared_access_key_enabled` - (Optional) Should the shared access key be enabled for the Storage Account? Defaults to `true`. + - `public_network_access_enabled` - (Optional) Should public network access be enabled for the Storage Account? Defaults to `true`. - `lock` - (Optional) The lock level to apply. - `role_assignments` - (Optional) A map of role assignments to assign to the Storage Account. @@ -1359,9 +1363,14 @@ Type: ```hcl object({ - name = optional(string) - resource_group_name = optional(string) - location = optional(string) + name = optional(string) + resource_group_name = optional(string) + location = optional(string) + account_kind = optional(string, "StorageV2") + account_tier = optional(string, "Standard") + account_replication_type = optional(string) + shared_access_key_enabled = optional(bool, true) + public_network_access_enabled = optional(bool, true) lock = optional(object({ kind = string name = optional(string, null) @@ -1509,10 +1518,11 @@ Description: A map of objects that represent a new App Service Plan to create - `name` - (Optional) The name of the App Service Plan. - `resource_group_name` - (Optional) The name of the resource group to deploy the App Service Plan in. - `location` - (Optional) The Azure region where the App Service Plan will be deployed. Defaults to the location of the resource group. - - `sku_name` - (Optional) The SKU name of the App Service Plan. Defaults to `B1`. + - `sku_name` - (Optional) The SKU name of the App Service Plan. Defaults to `P1v2`. + > 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`. - `app_service_environment_resource_id` - (Optional) The resource ID of the App Service Environment to deploy the App Service Plan in. - - `maximum_elastic_worker_count` - (Optional) The maximum number of workers that can be allocated to this App Service Plan. - - `worker_count` - (Optional) The number of workers to allocate to this App Service Plan. + - `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. + - `worker_count` - (Optional) The number of workers to allocate to this App Service Plan. Defaults to `3`. - `per_site_scaling_enabled` - (Optional) Should per site scaling be enabled for the App Service Plan? Defaults to `false`. - `zone_balancing_enabled` - (Optional) Should zone balancing be enabled for the App Service Plan? Changing this forces a new resource to be created. > **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({ name = optional(string) resource_group_name = optional(string) location = optional(string) - sku_name = optional(string) + sku_name = optional(string, "P1v2") app_service_environment_resource_id = optional(string) maximum_elastic_worker_count = optional(number) - worker_count = optional(number) + worker_count = optional(number, 3) per_site_scaling_enabled = optional(bool, false) - zone_balancing_enabled = optional(bool) + zone_balancing_enabled = optional(bool, true) + lock = optional(object({ + kind = string + name = optional(string, null) + }), null) + role_assignments = optional(map(object({ + role_definition_id_or_name = string + principal_id = string + description = optional(string, null) + skip_service_principal_aad_check = optional(bool, false) + condition = optional(string, null) + condition_version = optional(string, null) + delegated_managed_identity_resource_id = optional(string, null) + principal_type = optional(string, null) + })), {}) }) ``` @@ -1837,7 +1861,7 @@ object({ virtual_network_subnet_id = optional(string) headers = optional(map(object({ x_azure_fdid = optional(list(string)) - x_fd_health_probe = optional(number) + x_fd_health_probe = optional(list(string), ["1"]) x_forwarded_for = optional(list(string)) x_forwarded_host = optional(list(string)) })), {}) @@ -1851,7 +1875,7 @@ object({ virtual_network_subnet_id = optional(string) headers = optional(map(object({ x_azure_fdid = optional(list(string)) - x_fd_health_probe = optional(number) + x_fd_health_probe = optional(list(string), ["1"]) x_forwarded_for = optional(list(string)) x_forwarded_host = optional(list(string)) })), {}) @@ -2032,6 +2056,10 @@ Description: The object principal id of the resource. Description: The kind of app service. +### [location](#output\_location) + +Description: The location of the resource. + ### [name](#output\_name) 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 Description: The default hostname of the resource. -### [service\_plan](#output\_service\_plan) +### [service\_plan\_id](#output\_service\_plan\_id) -Description: The service plan resource. +Description: The resource id of the service plan. + +### [service\_plan\_name](#output\_service\_plan\_name) + +Description: The name of the created service plan. ### [storage\_account](#output\_storage\_account) @@ -2100,7 +2132,13 @@ The following Modules are called: Source: Azure/avm-res-storage-storageaccount/azurerm -Version: 0.1.2 +Version: 0.2.4 + +### [avm\_res\_web\_serverfarm](#module\_avm\_res\_web\_serverfarm) + +Source: Azure/avm-res-web-serverfarm/azurerm + +Version: 0.1.0 ## Data Collection diff --git a/avm.bat b/avm.bat index 2eea22f..6b177be 100644 --- a/avm.bat +++ b/avm.bat @@ -18,6 +18,6 @@ IF "%~1"=="" ( ) REM Run the make target with CONTAINER_RUNTIME -%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 +%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 ENDLOCAL diff --git a/examples/auto_heal_enabled/README.md b/examples/auto_heal_enabled/README.md index 76c0fff..90e97fc 100644 --- a/examples/auto_heal_enabled/README.md +++ b/examples/auto_heal_enabled/README.md @@ -1,7 +1,7 @@ # Default example -This deploys the module utilizing auto heal settings. +This deploys the module as a Linux Web App utilizing auto heal settings. ```hcl terraform { @@ -54,39 +54,11 @@ resource "azurerm_resource_group" "example" { name = module.naming.resource_group.name_unique } -/* -module "avm_res_storage_storageaccount" { - source = "Azure/avm-res-storage-storageaccount/azurerm" - version = "0.1.1" - - enable_telemetry = false - name = module.naming.storage_account.name_unique - resource_group_name = azurerm_resource_group.example.name - shared_access_key_enabled = true - public_network_access_enabled = true - network_rules = { - bypass = ["AzureServices"] - default_action = "Allow" - } -} -*/ - -/* -resource "azurerm_service_plan" "example" { - location = azurerm_resource_group.example.location - # This will equate to Consumption (Serverless) in portal - name = module.naming.app_service_plan.name_unique - os_type = "Windows" - resource_group_name = azurerm_resource_group.example.name - sku_name = "Y1" -} -*/ - module "test" { source = "../../" # source = "Azure/avm-res-web-site/azurerm" - # version = "0.9.1" + # version = "0.9.2" enable_telemetry = var.enable_telemetry @@ -134,31 +106,8 @@ module "test" { # } } - - /* - # Uses an existing app service plan - os_type = azurerm_service_plan.example.os_type - service_plan_resource_id = azurerm_service_plan.example.id - */ - # Creates a new app service plan create_service_plan = true - new_service_plan = { - sku_name = "S1" - } - - /* - # Uses an existing storage account - storage_account_name = module.avm_res_storage_storageaccount.name - storage_account_access_key = module.avm_res_storage_storageaccount.resource.primary_access_key - */ - - # Uses the avm-res-storage-storageaccount module to create a new storage account within root module - # function_app_create_storage_account = true - # function_app_storage_account = { - # name = module.naming.storage_account.name_unique - # resource_group_name = azurerm_resource_group.example.name - # } } ``` @@ -219,10 +168,6 @@ Description: This is the full output for the resource. Description: This is the full output for the resource. -### [service\_plan](#output\_service\_plan) - -Description: Full output of service plan created - ### [storage\_account](#output\_storage\_account) Description: Full output of storage account created diff --git a/examples/auto_heal_enabled/_header.md b/examples/auto_heal_enabled/_header.md index f3c5ddd..2564791 100644 --- a/examples/auto_heal_enabled/_header.md +++ b/examples/auto_heal_enabled/_header.md @@ -1,3 +1,3 @@ # Default example -This deploys the module utilizing auto heal settings. +This deploys the module as a Linux Web App utilizing auto heal settings. diff --git a/examples/auto_heal_enabled/locals.tf b/examples/auto_heal_enabled/locals.tf index e42b2c7..c8a92b0 100644 --- a/examples/auto_heal_enabled/locals.tf +++ b/examples/auto_heal_enabled/locals.tf @@ -1,8 +1,10 @@ locals { azure_regions = [ "eastus", - "westeurope", - "eastasia", - "japaneast" + "eastus2", + "centralus", + "southcentralus", + "westus2", + "westus3" ] } \ No newline at end of file diff --git a/examples/auto_heal_enabled/main.tf b/examples/auto_heal_enabled/main.tf index 04cb5e3..e15db0c 100644 --- a/examples/auto_heal_enabled/main.tf +++ b/examples/auto_heal_enabled/main.tf @@ -48,39 +48,11 @@ resource "azurerm_resource_group" "example" { name = module.naming.resource_group.name_unique } -/* -module "avm_res_storage_storageaccount" { - source = "Azure/avm-res-storage-storageaccount/azurerm" - version = "0.1.1" - - enable_telemetry = false - name = module.naming.storage_account.name_unique - resource_group_name = azurerm_resource_group.example.name - shared_access_key_enabled = true - public_network_access_enabled = true - network_rules = { - bypass = ["AzureServices"] - default_action = "Allow" - } -} -*/ - -/* -resource "azurerm_service_plan" "example" { - location = azurerm_resource_group.example.location - # This will equate to Consumption (Serverless) in portal - name = module.naming.app_service_plan.name_unique - os_type = "Windows" - resource_group_name = azurerm_resource_group.example.name - sku_name = "Y1" -} -*/ - module "test" { source = "../../" # source = "Azure/avm-res-web-site/azurerm" - # version = "0.9.1" + # version = "0.9.2" enable_telemetry = var.enable_telemetry @@ -128,29 +100,6 @@ module "test" { # } } - - /* - # Uses an existing app service plan - os_type = azurerm_service_plan.example.os_type - service_plan_resource_id = azurerm_service_plan.example.id - */ - # Creates a new app service plan create_service_plan = true - new_service_plan = { - sku_name = "S1" - } - - /* - # Uses an existing storage account - storage_account_name = module.avm_res_storage_storageaccount.name - storage_account_access_key = module.avm_res_storage_storageaccount.resource.primary_access_key - */ - - # Uses the avm-res-storage-storageaccount module to create a new storage account within root module - # function_app_create_storage_account = true - # function_app_storage_account = { - # name = module.naming.storage_account.name_unique - # resource_group_name = azurerm_resource_group.example.name - # } } diff --git a/examples/auto_heal_enabled/outputs.tf b/examples/auto_heal_enabled/outputs.tf index 59dccb1..77a57a0 100644 --- a/examples/auto_heal_enabled/outputs.tf +++ b/examples/auto_heal_enabled/outputs.tf @@ -20,11 +20,6 @@ output "resource" { value = module.test.resource } -output "service_plan" { - description = "Full output of service plan created" - value = module.test.service_plan -} - output "storage_account" { description = "Full output of storage account created" sensitive = true diff --git a/examples/basic_auth/README.md b/examples/basic_auth/README.md index 61b40ca..9602657 100644 --- a/examples/basic_auth/README.md +++ b/examples/basic_auth/README.md @@ -87,7 +87,7 @@ module "test" { source = "../../" # source = "Azure/avm-res-web-site/azurerm" - # version = "0.9.1" + # version = "0.9.2" enable_telemetry = var.enable_telemetry @@ -199,10 +199,6 @@ Description: This is the full output for the resource. Description: This is the full output for the resource. -### [service\_plan](#output\_service\_plan) - -Description: Full output of service plan created - ### [storage\_account](#output\_storage\_account) Description: Full output of storage account created diff --git a/examples/basic_auth/locals.tf b/examples/basic_auth/locals.tf index e42b2c7..c8a92b0 100644 --- a/examples/basic_auth/locals.tf +++ b/examples/basic_auth/locals.tf @@ -1,8 +1,10 @@ locals { azure_regions = [ "eastus", - "westeurope", - "eastasia", - "japaneast" + "eastus2", + "centralus", + "southcentralus", + "westus2", + "westus3" ] } \ No newline at end of file diff --git a/examples/basic_auth/main.tf b/examples/basic_auth/main.tf index ba42a3f..a9b47e7 100644 --- a/examples/basic_auth/main.tf +++ b/examples/basic_auth/main.tf @@ -80,7 +80,7 @@ module "test" { source = "../../" # source = "Azure/avm-res-web-site/azurerm" - # version = "0.9.1" + # version = "0.9.2" enable_telemetry = var.enable_telemetry diff --git a/examples/basic_auth/outputs.tf b/examples/basic_auth/outputs.tf index 5a199f9..4a3d95f 100644 --- a/examples/basic_auth/outputs.tf +++ b/examples/basic_auth/outputs.tf @@ -9,11 +9,6 @@ output "resource" { value = module.test.resource } -output "service_plan" { - description = "Full output of service plan created" - value = module.test.service_plan -} - output "storage_account" { description = "Full output of storage account created" sensitive = true diff --git a/examples/custom_domain/README.md b/examples/custom_domain/README.md index 4200038..512d3be 100644 --- a/examples/custom_domain/README.md +++ b/examples/custom_domain/README.md @@ -76,6 +76,18 @@ resource "azurerm_service_plan" "example" { sku_name = "S1" } +# module "avm_res_web_serverfarm" { + +# source = "Azure/avm-res-web-serverfarm/azurerm" +# version = "0.1.0" + +# name = module.naming.app_service_plan.name_unique +# os_type = "Windows" +# resource_group_name = azurerm_resource_group.example.name +# sku_name = "S1" + +# } + # Use data object to reference an existing Key Vault and stored certificate /* data "azurerm_key_vault" "existing_keyvault" { @@ -95,7 +107,7 @@ module "test" { source = "../../" # source = "Azure/avm-res-web-site/azurerm" - # version = "0.9.1" + # version = "0.9.2" enable_telemetry = var.enable_telemetry diff --git a/examples/custom_domain/locals.tf b/examples/custom_domain/locals.tf index 5bf63ae..51ceb1a 100644 --- a/examples/custom_domain/locals.tf +++ b/examples/custom_domain/locals.tf @@ -1,8 +1,10 @@ locals { azure_regions = [ "eastus", - "westeurope", - "eastasia", - "japaneast" + "eastus2", + "centralus", + "southcentralus", + "westus2", + "westus3" ] } diff --git a/examples/custom_domain/main.tf b/examples/custom_domain/main.tf index 1f6840c..d3c661d 100644 --- a/examples/custom_domain/main.tf +++ b/examples/custom_domain/main.tf @@ -72,6 +72,18 @@ resource "azurerm_service_plan" "example" { sku_name = "S1" } +# module "avm_res_web_serverfarm" { + +# source = "Azure/avm-res-web-serverfarm/azurerm" +# version = "0.1.0" + +# name = module.naming.app_service_plan.name_unique +# os_type = "Windows" +# resource_group_name = azurerm_resource_group.example.name +# sku_name = "S1" + +# } + # Use data object to reference an existing Key Vault and stored certificate /* data "azurerm_key_vault" "existing_keyvault" { @@ -91,7 +103,7 @@ module "test" { source = "../../" # source = "Azure/avm-res-web-site/azurerm" - # version = "0.9.1" + # version = "0.9.2" enable_telemetry = var.enable_telemetry diff --git a/examples/default/README.md b/examples/default/README.md index 0d89c14..6fe1f86 100644 --- a/examples/default/README.md +++ b/examples/default/README.md @@ -57,7 +57,7 @@ resource "azurerm_resource_group" "example" { /* module "avm_res_storage_storageaccount" { source = "Azure/avm-res-storage-storageaccount/azurerm" - version = "0.1.1" + version = "0.2.4" enable_telemetry = false name = module.naming.storage_account.name_unique @@ -78,7 +78,7 @@ resource "azurerm_service_plan" "example" { name = module.naming.app_service_plan.name_unique os_type = "Windows" resource_group_name = azurerm_resource_group.example.name - sku_name = "Y1" + sku_name = "P1v2" } */ @@ -86,7 +86,7 @@ module "test" { source = "../../" # source = "Azure/avm-res-web-site/azurerm" - # version = "0.9.1" + # version = "0.9.2" enable_telemetry = var.enable_telemetry @@ -105,9 +105,6 @@ module "test" { # Creates a new app service plan create_service_plan = true - new_service_plan = { - sku_name = "S1" - } /* # Uses an existing storage account @@ -118,8 +115,7 @@ module "test" { # Uses the avm-res-storage-storageaccount module to create a new storage account within root module function_app_create_storage_account = true function_app_storage_account = { - name = module.naming.storage_account.name_unique - resource_group_name = azurerm_resource_group.example.name + name = module.naming.storage_account.name_unique } } ``` @@ -165,19 +161,31 @@ Default: `true` The following outputs are exported: +### [location](#output\_location) + +Description: This is the full output for the resource. + ### [name](#output\_name) Description: This is the full output for the resource. -### [resource](#output\_resource) +### [resource\_id](#output\_resource\_id) Description: This is the full output for the resource. -### [service\_plan](#output\_service\_plan) +### [service\_plan\_id](#output\_service\_plan\_id) + +Description: The ID of the app service + +### [service\_plan\_name](#output\_service\_plan\_name) Description: Full output of service plan created -### [storage\_account](#output\_storage\_account) +### [storage\_account\_id](#output\_storage\_account\_id) + +Description: The ID of the storage account + +### [storage\_account\_name](#output\_storage\_account\_name) Description: Full output of storage account created diff --git a/examples/default/locals.tf b/examples/default/locals.tf index e42b2c7..c8a92b0 100644 --- a/examples/default/locals.tf +++ b/examples/default/locals.tf @@ -1,8 +1,10 @@ locals { azure_regions = [ "eastus", - "westeurope", - "eastasia", - "japaneast" + "eastus2", + "centralus", + "southcentralus", + "westus2", + "westus3" ] } \ No newline at end of file diff --git a/examples/default/main.tf b/examples/default/main.tf index 2f42d87..14b59b8 100644 --- a/examples/default/main.tf +++ b/examples/default/main.tf @@ -51,7 +51,7 @@ resource "azurerm_resource_group" "example" { /* module "avm_res_storage_storageaccount" { source = "Azure/avm-res-storage-storageaccount/azurerm" - version = "0.1.1" + version = "0.2.4" enable_telemetry = false name = module.naming.storage_account.name_unique @@ -72,7 +72,7 @@ resource "azurerm_service_plan" "example" { name = module.naming.app_service_plan.name_unique os_type = "Windows" resource_group_name = azurerm_resource_group.example.name - sku_name = "Y1" + sku_name = "P1v2" } */ @@ -80,7 +80,7 @@ module "test" { source = "../../" # source = "Azure/avm-res-web-site/azurerm" - # version = "0.9.1" + # version = "0.9.2" enable_telemetry = var.enable_telemetry @@ -99,9 +99,6 @@ module "test" { # Creates a new app service plan create_service_plan = true - new_service_plan = { - sku_name = "S1" - } /* # Uses an existing storage account @@ -112,7 +109,6 @@ module "test" { # Uses the avm-res-storage-storageaccount module to create a new storage account within root module function_app_create_storage_account = true function_app_storage_account = { - name = module.naming.storage_account.name_unique - resource_group_name = azurerm_resource_group.example.name + name = module.naming.storage_account.name_unique } } diff --git a/examples/default/outputs.tf b/examples/default/outputs.tf index 5a199f9..fc37eae 100644 --- a/examples/default/outputs.tf +++ b/examples/default/outputs.tf @@ -1,21 +1,35 @@ +output "location" { + description = "This is the full output for the resource." + value = module.test.location +} + output "name" { description = "This is the full output for the resource." value = module.test.name } -output "resource" { +output "resource_id" { description = "This is the full output for the resource." sensitive = true - value = module.test.resource + value = module.test.resource_id +} + +output "service_plan_id" { + description = "The ID of the app service" + value = module.test.service_plan_id } -output "service_plan" { +output "service_plan_name" { description = "Full output of service plan created" - value = module.test.service_plan + value = module.test.service_plan_name +} + +output "storage_account_id" { + description = "The ID of the storage account" + value = module.test.storage_account.resource_id } -output "storage_account" { +output "storage_account_name" { description = "Full output of storage account created" - sensitive = true - value = module.test.storage_account + value = module.test.storage_account.name } diff --git a/examples/deployment_slot_with_interfaces/README.md b/examples/deployment_slot_with_interfaces/README.md index e5f8eef..2c808f3 100644 --- a/examples/deployment_slot_with_interfaces/README.md +++ b/examples/deployment_slot_with_interfaces/README.md @@ -118,7 +118,7 @@ module "test" { source = "../../" # source = "Azure/avm-res-web-site/azurerm" - # version = "0.9.1" + # version = "0.9.2" enable_telemetry = var.enable_telemetry @@ -277,10 +277,6 @@ Description: This is the full output for the resource. Description: The locks of the resources. -### [service\_plan](#output\_service\_plan) - -Description: Full output of service plan created - ### [storage\_account](#output\_storage\_account) Description: Full output of storage account created diff --git a/examples/deployment_slot_with_interfaces/locals.tf b/examples/deployment_slot_with_interfaces/locals.tf index a9f91ed..f3da546 100644 --- a/examples/deployment_slot_with_interfaces/locals.tf +++ b/examples/deployment_slot_with_interfaces/locals.tf @@ -1,9 +1,11 @@ locals { azure_regions = [ "eastus", - "westeurope", - "eastasia", - "japaneast" + "eastus2", + "centralus", + "southcentralus", + "westus2", + "westus3" ] azurerm_private_dns_zone_resource_name = "privatelink.${local.reformatted_subdomain}" default_host_name = module.test.resource_uri diff --git a/examples/deployment_slot_with_interfaces/main.tf b/examples/deployment_slot_with_interfaces/main.tf index 88c3fe8..5d4892f 100644 --- a/examples/deployment_slot_with_interfaces/main.tf +++ b/examples/deployment_slot_with_interfaces/main.tf @@ -112,7 +112,7 @@ module "test" { source = "../../" # source = "Azure/avm-res-web-site/azurerm" - # version = "0.9.1" + # version = "0.9.2" enable_telemetry = var.enable_telemetry diff --git a/examples/deployment_slot_with_interfaces/outputs.tf b/examples/deployment_slot_with_interfaces/outputs.tf index 12b2f94..f9f3f94 100644 --- a/examples/deployment_slot_with_interfaces/outputs.tf +++ b/examples/deployment_slot_with_interfaces/outputs.tf @@ -35,11 +35,6 @@ output "resource_lock" { value = module.test.resource_lock } -output "service_plan" { - description = "Full output of service plan created" - value = module.test.service_plan -} - output "storage_account" { description = "Full output of storage account created" sensitive = true diff --git a/examples/function_app/README.md b/examples/function_app/README.md index 50e3ff5..a5b731e 100644 --- a/examples/function_app/README.md +++ b/examples/function_app/README.md @@ -83,7 +83,7 @@ module "test" { source = "../../" # source = "Azure/avm-res-web-site/azurerm" - # version = "0.9.1" + # version = "0.9.2" enable_telemetry = var.enable_telemetry diff --git a/examples/function_app/locals.tf b/examples/function_app/locals.tf index e42b2c7..c8a92b0 100644 --- a/examples/function_app/locals.tf +++ b/examples/function_app/locals.tf @@ -1,8 +1,10 @@ locals { azure_regions = [ "eastus", - "westeurope", - "eastasia", - "japaneast" + "eastus2", + "centralus", + "southcentralus", + "westus2", + "westus3" ] } \ No newline at end of file diff --git a/examples/function_app/main.tf b/examples/function_app/main.tf index 741edab..8194201 100644 --- a/examples/function_app/main.tf +++ b/examples/function_app/main.tf @@ -77,7 +77,7 @@ module "test" { source = "../../" # source = "Azure/avm-res-web-site/azurerm" - # version = "0.9.1" + # version = "0.9.2" enable_telemetry = var.enable_telemetry diff --git a/examples/interfaces/README.md b/examples/interfaces/README.md index fc7545d..8b8800d 100644 --- a/examples/interfaces/README.md +++ b/examples/interfaces/README.md @@ -131,7 +131,7 @@ module "test" { source = "../../" # source = "Azure/avm-res-web-site/azurerm" - # version = "0.9.1" + # version = "0.9.2" enable_telemetry = var.enable_telemetry diff --git a/examples/interfaces/locals.tf b/examples/interfaces/locals.tf index a374790..4dc1921 100644 --- a/examples/interfaces/locals.tf +++ b/examples/interfaces/locals.tf @@ -1,9 +1,11 @@ locals { azure_regions = [ "eastus", - "westeurope", - "eastasia", - "japaneast" + "eastus2", + "centralus", + "southcentralus", + "westus2", + "westus3" ] azurerm_private_dns_zone_resource_name = "privatelink.${local.reformatted_subdomain}" default_host_name = module.test.resource_uri diff --git a/examples/interfaces/main.tf b/examples/interfaces/main.tf index 8e9fc47..339fdf5 100644 --- a/examples/interfaces/main.tf +++ b/examples/interfaces/main.tf @@ -125,7 +125,7 @@ module "test" { source = "../../" # source = "Azure/avm-res-web-site/azurerm" - # version = "0.9.1" + # version = "0.9.2" enable_telemetry = var.enable_telemetry diff --git a/examples/ip_restriction/README.md b/examples/ip_restriction/README.md index 3ee14b7..cc80448 100644 --- a/examples/ip_restriction/README.md +++ b/examples/ip_restriction/README.md @@ -1,7 +1,7 @@ # Default example -This deploys the module as a Windows Function App using some of the interfaces. +This deploys the module as a Windows Function App utilizing ip restrictions. ```hcl terraform { @@ -53,39 +53,11 @@ resource "azurerm_resource_group" "example" { name = module.naming.resource_group.name_unique } -/* -module "avm_res_storage_storageaccount" { - source = "Azure/avm-res-storage-storageaccount/azurerm" - version = "0.1.1" - - enable_telemetry = false - name = module.naming.storage_account.name_unique - resource_group_name = azurerm_resource_group.example.name - shared_access_key_enabled = true - public_network_access_enabled = true - network_rules = { - bypass = ["AzureServices"] - default_action = "Allow" - } -} -*/ - -/* -resource "azurerm_service_plan" "example" { - location = azurerm_resource_group.example.location - # This will equate to Consumption (Serverless) in portal - name = module.naming.app_service_plan.name_unique - os_type = "Windows" - resource_group_name = azurerm_resource_group.example.name - sku_name = "Y1" -} -*/ - module "test" { source = "../../" # source = "Azure/avm-res-web-site/azurerm" - # version = "0.9.1" + # version = "0.9.2" enable_telemetry = var.enable_telemetry @@ -94,7 +66,7 @@ module "test" { location = azurerm_resource_group.example.location kind = "functionapp" - os_type = "Linux" + os_type = "Windows" site_config = { application_stack = { @@ -114,29 +86,13 @@ module "test" { } } - /* - # Uses an existing app service plan - os_type = azurerm_service_plan.example.os_type - service_plan_resource_id = azurerm_service_plan.example.id - */ - # Creates a new app service plan create_service_plan = true - new_service_plan = { - sku_name = "S1" - } - - /* - # Uses an existing storage account - storage_account_name = module.avm_res_storage_storageaccount.name - storage_account_access_key = module.avm_res_storage_storageaccount.resource.primary_access_key - */ # Uses the avm-res-storage-storageaccount module to create a new storage account within root module function_app_create_storage_account = true function_app_storage_account = { - name = module.naming.storage_account.name_unique - resource_group_name = azurerm_resource_group.example.name + name = module.naming.storage_account.name_unique } } ``` diff --git a/examples/ip_restriction/_header.md b/examples/ip_restriction/_header.md index 492861f..26e28dc 100644 --- a/examples/ip_restriction/_header.md +++ b/examples/ip_restriction/_header.md @@ -1,3 +1,3 @@ # Default example -This deploys the module as a Windows Function App using some of the interfaces. +This deploys the module as a Windows Function App utilizing ip restrictions. diff --git a/examples/ip_restriction/locals.tf b/examples/ip_restriction/locals.tf index e42b2c7..c8a92b0 100644 --- a/examples/ip_restriction/locals.tf +++ b/examples/ip_restriction/locals.tf @@ -1,8 +1,10 @@ locals { azure_regions = [ "eastus", - "westeurope", - "eastasia", - "japaneast" + "eastus2", + "centralus", + "southcentralus", + "westus2", + "westus3" ] } \ No newline at end of file diff --git a/examples/ip_restriction/main.tf b/examples/ip_restriction/main.tf index 83aac98..44d2501 100644 --- a/examples/ip_restriction/main.tf +++ b/examples/ip_restriction/main.tf @@ -47,39 +47,11 @@ resource "azurerm_resource_group" "example" { name = module.naming.resource_group.name_unique } -/* -module "avm_res_storage_storageaccount" { - source = "Azure/avm-res-storage-storageaccount/azurerm" - version = "0.1.1" - - enable_telemetry = false - name = module.naming.storage_account.name_unique - resource_group_name = azurerm_resource_group.example.name - shared_access_key_enabled = true - public_network_access_enabled = true - network_rules = { - bypass = ["AzureServices"] - default_action = "Allow" - } -} -*/ - -/* -resource "azurerm_service_plan" "example" { - location = azurerm_resource_group.example.location - # This will equate to Consumption (Serverless) in portal - name = module.naming.app_service_plan.name_unique - os_type = "Windows" - resource_group_name = azurerm_resource_group.example.name - sku_name = "Y1" -} -*/ - module "test" { source = "../../" # source = "Azure/avm-res-web-site/azurerm" - # version = "0.9.1" + # version = "0.9.2" enable_telemetry = var.enable_telemetry @@ -88,7 +60,7 @@ module "test" { location = azurerm_resource_group.example.location kind = "functionapp" - os_type = "Linux" + os_type = "Windows" site_config = { application_stack = { @@ -108,28 +80,12 @@ module "test" { } } - /* - # Uses an existing app service plan - os_type = azurerm_service_plan.example.os_type - service_plan_resource_id = azurerm_service_plan.example.id - */ - # Creates a new app service plan create_service_plan = true - new_service_plan = { - sku_name = "S1" - } - - /* - # Uses an existing storage account - storage_account_name = module.avm_res_storage_storageaccount.name - storage_account_access_key = module.avm_res_storage_storageaccount.resource.primary_access_key - */ # Uses the avm-res-storage-storageaccount module to create a new storage account within root module function_app_create_storage_account = true function_app_storage_account = { - name = module.naming.storage_account.name_unique - resource_group_name = azurerm_resource_group.example.name + name = module.naming.storage_account.name_unique } } diff --git a/examples/logs/README.md b/examples/logs/README.md index 08a6e67..b48ee6b 100644 --- a/examples/logs/README.md +++ b/examples/logs/README.md @@ -1,7 +1,7 @@ # Default example -This deploys the module with a Linux Function App in its simplest form. +This deploys the module with a Linux Web App with logs configured on both the main app and deployment slot. ```hcl terraform { @@ -53,36 +53,12 @@ resource "azurerm_resource_group" "example" { name = module.naming.resource_group.name_unique } -# module "avm_res_storage_storageaccount" { -# source = "Azure/avm-res-storage-storageaccount/azurerm" -# version = "0.1.2" - -# enable_telemetry = var.enable_telemetry -# name = module.naming.storage_account.name_unique -# resource_group_name = azurerm_resource_group.example.name -# location = azurerm_resource_group.example.location -# shared_access_key_enabled = true -# public_network_access_enabled = true -# network_rules = { -# bypass = ["AzureServices"] -# default_action = "Allow" -# } -# } - -# resource "azurerm_service_plan" "example" { -# location = azurerm_resource_group.example.location -# name = module.naming.app_service_plan.name_unique -# os_type = "Linux" -# resource_group_name = azurerm_resource_group.example.name -# sku_name = "Y1" -# } - # This is the module call module "test" { source = "../../" # source = "Azure/avm-res-web-site/azurerm" - # version = "0.9.1" + # version = "0.9.2" enable_telemetry = var.enable_telemetry @@ -94,9 +70,7 @@ module "test" { os_type = "Linux" create_service_plan = true - new_service_plan = { - sku_name = "S1" - } + site_config = { application_stack = { @@ -157,19 +131,6 @@ module "test" { } } } - - # service_plan_resource_id = azurerm_service_plan.example.id - - # function_app_create_storage_account = true - # function_app_storage_account = { - # name = module.naming.storage_account.name_unique - # location = azurerm_resource_group.example.location - # resource_group_name = azurerm_resource_group.example.name - # lock = null - # } - - # function_app_storage_account_name = module.avm_res_storage_storageaccount.name - # function_app_storage_account_access_key = module.avm_res_storage_storageaccount.resource.primary_access_key } ``` diff --git a/examples/logs/_header.md b/examples/logs/_header.md index 23de454..9c04ea1 100644 --- a/examples/logs/_header.md +++ b/examples/logs/_header.md @@ -1,3 +1,3 @@ # Default example -This deploys the module with a Linux Function App in its simplest form. +This deploys the module with a Linux Web App with logs configured on both the main app and deployment slot. diff --git a/examples/logs/locals.tf b/examples/logs/locals.tf index e42b2c7..c8a92b0 100644 --- a/examples/logs/locals.tf +++ b/examples/logs/locals.tf @@ -1,8 +1,10 @@ locals { azure_regions = [ "eastus", - "westeurope", - "eastasia", - "japaneast" + "eastus2", + "centralus", + "southcentralus", + "westus2", + "westus3" ] } \ No newline at end of file diff --git a/examples/logs/main.tf b/examples/logs/main.tf index c9c1c10..cb6898f 100644 --- a/examples/logs/main.tf +++ b/examples/logs/main.tf @@ -47,36 +47,12 @@ resource "azurerm_resource_group" "example" { name = module.naming.resource_group.name_unique } -# module "avm_res_storage_storageaccount" { -# source = "Azure/avm-res-storage-storageaccount/azurerm" -# version = "0.1.2" - -# enable_telemetry = var.enable_telemetry -# name = module.naming.storage_account.name_unique -# resource_group_name = azurerm_resource_group.example.name -# location = azurerm_resource_group.example.location -# shared_access_key_enabled = true -# public_network_access_enabled = true -# network_rules = { -# bypass = ["AzureServices"] -# default_action = "Allow" -# } -# } - -# resource "azurerm_service_plan" "example" { -# location = azurerm_resource_group.example.location -# name = module.naming.app_service_plan.name_unique -# os_type = "Linux" -# resource_group_name = azurerm_resource_group.example.name -# sku_name = "Y1" -# } - # This is the module call module "test" { source = "../../" # source = "Azure/avm-res-web-site/azurerm" - # version = "0.9.1" + # version = "0.9.2" enable_telemetry = var.enable_telemetry @@ -88,9 +64,7 @@ module "test" { os_type = "Linux" create_service_plan = true - new_service_plan = { - sku_name = "S1" - } + site_config = { application_stack = { @@ -151,17 +125,4 @@ module "test" { } } } - - # service_plan_resource_id = azurerm_service_plan.example.id - - # function_app_create_storage_account = true - # function_app_storage_account = { - # name = module.naming.storage_account.name_unique - # location = azurerm_resource_group.example.location - # resource_group_name = azurerm_resource_group.example.name - # lock = null - # } - - # function_app_storage_account_name = module.avm_res_storage_storageaccount.name - # function_app_storage_account_access_key = module.avm_res_storage_storageaccount.resource.primary_access_key } diff --git a/examples/storage_uses_managed_identity/README.md b/examples/storage_uses_managed_identity/README.md index 22e2457..7da0d7b 100644 --- a/examples/storage_uses_managed_identity/README.md +++ b/examples/storage_uses_managed_identity/README.md @@ -56,7 +56,7 @@ resource "azurerm_resource_group" "example" { # Deploying Storage Account outside of root module to avoid circular dependency for role assignment + managed identity module "avm_res_storage_storageaccount" { source = "Azure/avm-res-storage-storageaccount/azurerm" - version = "0.1.2" + version = "0.2.4" enable_telemetry = var.enable_telemetry name = module.naming.storage_account.name_unique @@ -81,21 +81,18 @@ module "test" { source = "../../" # source = "Azure/avm-res-web-site/azurerm" - # version = "0.9.1" + # version = "0.9.2" enable_telemetry = var.enable_telemetry - name = "${module.naming.function_app.name_unique}-linux" + name = "${module.naming.function_app.name_unique}-windows" resource_group_name = azurerm_resource_group.example.name location = azurerm_resource_group.example.location kind = "functionapp" - os_type = "Linux" + os_type = "Windows" create_service_plan = true - new_service_plan = { - sku_name = "Y1" - } function_app_storage_account_name = module.avm_res_storage_storageaccount.name function_app_storage_uses_managed_identity = true @@ -172,7 +169,7 @@ The following Modules are called: Source: Azure/avm-res-storage-storageaccount/azurerm -Version: 0.1.2 +Version: 0.2.4 ### [naming](#module\_naming) diff --git a/examples/storage_uses_managed_identity/locals.tf b/examples/storage_uses_managed_identity/locals.tf index e42b2c7..c8a92b0 100644 --- a/examples/storage_uses_managed_identity/locals.tf +++ b/examples/storage_uses_managed_identity/locals.tf @@ -1,8 +1,10 @@ locals { azure_regions = [ "eastus", - "westeurope", - "eastasia", - "japaneast" + "eastus2", + "centralus", + "southcentralus", + "westus2", + "westus3" ] } \ No newline at end of file diff --git a/examples/storage_uses_managed_identity/main.tf b/examples/storage_uses_managed_identity/main.tf index e29705b..18e8778 100644 --- a/examples/storage_uses_managed_identity/main.tf +++ b/examples/storage_uses_managed_identity/main.tf @@ -50,7 +50,7 @@ resource "azurerm_resource_group" "example" { # Deploying Storage Account outside of root module to avoid circular dependency for role assignment + managed identity module "avm_res_storage_storageaccount" { source = "Azure/avm-res-storage-storageaccount/azurerm" - version = "0.1.2" + version = "0.2.4" enable_telemetry = var.enable_telemetry name = module.naming.storage_account.name_unique @@ -75,21 +75,18 @@ module "test" { source = "../../" # source = "Azure/avm-res-web-site/azurerm" - # version = "0.9.1" + # version = "0.9.2" enable_telemetry = var.enable_telemetry - name = "${module.naming.function_app.name_unique}-linux" + name = "${module.naming.function_app.name_unique}-windows" resource_group_name = azurerm_resource_group.example.name location = azurerm_resource_group.example.location kind = "functionapp" - os_type = "Linux" + os_type = "Windows" create_service_plan = true - new_service_plan = { - sku_name = "Y1" - } function_app_storage_account_name = module.avm_res_storage_storageaccount.name function_app_storage_uses_managed_identity = true diff --git a/examples/web_app/README.md b/examples/web_app/README.md index 9b4b76e..763521d 100644 --- a/examples/web_app/README.md +++ b/examples/web_app/README.md @@ -1,5 +1,5 @@ -# Default example +# Web App This deploys the module with a Windows Web App in its simplest form. @@ -52,20 +52,12 @@ resource "azurerm_resource_group" "example" { name = module.naming.resource_group.name_unique } -resource "azurerm_service_plan" "example" { - location = azurerm_resource_group.example.location - name = module.naming.app_service_plan.name_unique - os_type = "Windows" - resource_group_name = azurerm_resource_group.example.name - sku_name = "S1" -} - # This is the module call module "test" { source = "../../" # source = "Azure/avm-res-web-site/azurerm" - # version = "0.9.1" + # version = "0.9.2" enable_telemetry = var.enable_telemetry @@ -74,9 +66,9 @@ module "test" { location = azurerm_resource_group.example.location kind = "webapp" - os_type = azurerm_service_plan.example.os_type + os_type = "Windows" - service_plan_resource_id = azurerm_service_plan.example.id + create_service_plan = true site_config = { application_stack = { @@ -106,7 +98,6 @@ The following requirements are needed by this module: The following resources are used by this module: - [azurerm_resource_group.example](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group) (resource) -- [azurerm_service_plan.example](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/service_plan) (resource) - [random_integer.region_index](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/integer) (resource) diff --git a/examples/web_app/_header.md b/examples/web_app/_header.md index d4a660f..fe49441 100644 --- a/examples/web_app/_header.md +++ b/examples/web_app/_header.md @@ -1,3 +1,3 @@ -# Default example +# Web App This deploys the module with a Windows Web App in its simplest form. diff --git a/examples/web_app/locals.tf b/examples/web_app/locals.tf index e42b2c7..c8a92b0 100644 --- a/examples/web_app/locals.tf +++ b/examples/web_app/locals.tf @@ -1,8 +1,10 @@ locals { azure_regions = [ "eastus", - "westeurope", - "eastasia", - "japaneast" + "eastus2", + "centralus", + "southcentralus", + "westus2", + "westus3" ] } \ No newline at end of file diff --git a/examples/web_app/main.tf b/examples/web_app/main.tf index a00018c..11378ca 100644 --- a/examples/web_app/main.tf +++ b/examples/web_app/main.tf @@ -46,20 +46,12 @@ resource "azurerm_resource_group" "example" { name = module.naming.resource_group.name_unique } -resource "azurerm_service_plan" "example" { - location = azurerm_resource_group.example.location - name = module.naming.app_service_plan.name_unique - os_type = "Windows" - resource_group_name = azurerm_resource_group.example.name - sku_name = "S1" -} - # This is the module call module "test" { source = "../../" # source = "Azure/avm-res-web-site/azurerm" - # version = "0.9.1" + # version = "0.9.2" enable_telemetry = var.enable_telemetry @@ -68,9 +60,9 @@ module "test" { location = azurerm_resource_group.example.location kind = "webapp" - os_type = azurerm_service_plan.example.os_type + os_type = "Windows" - service_plan_resource_id = azurerm_service_plan.example.id + create_service_plan = true site_config = { application_stack = { diff --git a/main.function_app.tf b/main.function_app.tf index 2667563..d4bc1a6 100644 --- a/main.function_app.tf +++ b/main.function_app.tf @@ -4,7 +4,7 @@ resource "azurerm_windows_function_app" "this" { location = var.location name = var.name resource_group_name = var.resource_group_name - service_plan_id = (var.create_service_plan == true && var.service_plan_resource_id == null) ? azurerm_service_plan.this[0].id : var.service_plan_resource_id + service_plan_id = (var.create_service_plan == true && var.service_plan_resource_id == null) ? module.avm_res_web_serverfarm[0].resource_id : var.service_plan_resource_id app_settings = var.app_settings builtin_logging_enabled = var.builtin_logging_enabled client_certificate_enabled = var.client_certificate_enabled @@ -106,7 +106,8 @@ resource "azurerm_windows_function_app" "this" { } } } - dynamic "scm_ip_restriction" { # one or more scm_ip_restriction blocks + dynamic "scm_ip_restriction" { + # one or more scm_ip_restriction blocks for_each = var.site_config.scm_ip_restriction content { @@ -275,6 +276,7 @@ resource "azurerm_windows_function_app" "this" { } dynamic "custom_oidc_v2" { for_each = auth_settings_v2.value.custom_oidc_v2 + content { client_id = custom_oidc_v2.value.client_id name = custom_oidc_v2.value.name @@ -288,17 +290,16 @@ resource "azurerm_windows_function_app" "this" { scopes = custom_oidc_v2.value.scopes token_endpoint = custom_oidc_v2.value.token_endpoint } - } dynamic "facebook_v2" { for_each = auth_settings_v2.value.facebook_v2 + content { app_id = facebook_v2.value.app_id app_secret_setting_name = facebook_v2.value.app_secret_setting_name graph_api_version = facebook_v2.value.graph_api_version login_scopes = facebook_v2.value.login_scopes } - } dynamic "github_v2" { for_each = auth_settings_v2.value.github_v2 @@ -311,16 +312,17 @@ resource "azurerm_windows_function_app" "this" { } dynamic "google_v2" { for_each = auth_settings_v2.value.google_v2 + content { client_id = google_v2.value.client_id client_secret_setting_name = google_v2.value.client_secret_setting_name allowed_audiences = google_v2.value.allowed_audiences login_scopes = google_v2.value.login_scopes } - } dynamic "microsoft_v2" { for_each = auth_settings_v2.value.microsoft_v2 + content { client_id = microsoft_v2.value.client_id client_secret_setting_name = microsoft_v2.value.client_secret_setting_name @@ -330,13 +332,13 @@ resource "azurerm_windows_function_app" "this" { } dynamic "twitter_v2" { for_each = auth_settings_v2.value.twitter_v2 + content { consumer_key = twitter_v2.value.consumer_key consumer_secret_setting_name = twitter_v2.value.consumer_secret_setting_name } } } - } dynamic "backup" { for_each = var.backup @@ -370,6 +372,7 @@ resource "azurerm_windows_function_app" "this" { } dynamic "identity" { for_each = local.managed_identities.system_assigned_user_assigned + content { type = identity.value.type identity_ids = identity.value.user_assigned_resource_ids @@ -382,7 +385,6 @@ resource "azurerm_windows_function_app" "this" { app_setting_names = sticky_settings.value.app_setting_names connection_string_names = sticky_settings.value.connection_string_names } - } dynamic "storage_account" { for_each = var.storage_shares_to_mount @@ -398,6 +400,7 @@ resource "azurerm_windows_function_app" "this" { } dynamic "timeouts" { for_each = var.timeouts == null ? [] : [var.timeouts] + content { create = timeouts.value.create delete = timeouts.value.delete @@ -413,7 +416,7 @@ resource "azurerm_linux_function_app" "this" { location = var.location name = var.name resource_group_name = var.resource_group_name - service_plan_id = (var.create_service_plan == true && var.service_plan_resource_id == null) ? azurerm_service_plan.this[0].id : var.service_plan_resource_id + service_plan_id = (var.create_service_plan == true && var.service_plan_resource_id == null) ? module.avm_res_web_serverfarm[0].resource_id : var.service_plan_resource_id app_settings = var.app_settings builtin_logging_enabled = var.builtin_logging_enabled client_certificate_enabled = var.client_certificate_enabled @@ -490,6 +493,7 @@ resource "azurerm_linux_function_app" "this" { dynamic "docker" { for_each = application_stack.value.docker == null ? [] : application_stack.value.docker + content { image_name = docker.value.image_name image_tag = docker.value.image_tag @@ -531,7 +535,8 @@ resource "azurerm_linux_function_app" "this" { } } } - dynamic "scm_ip_restriction" { # one or more scm_ip_restriction blocks + dynamic "scm_ip_restriction" { + # one or more scm_ip_restriction blocks for_each = var.site_config.scm_ip_restriction content { @@ -700,6 +705,7 @@ resource "azurerm_linux_function_app" "this" { } dynamic "custom_oidc_v2" { for_each = auth_settings_v2.value.custom_oidc_v2 + content { client_id = custom_oidc_v2.value.client_id name = custom_oidc_v2.value.name @@ -713,17 +719,16 @@ resource "azurerm_linux_function_app" "this" { scopes = custom_oidc_v2.value.scopes token_endpoint = custom_oidc_v2.value.token_endpoint } - } dynamic "facebook_v2" { for_each = auth_settings_v2.value.facebook_v2 + content { app_id = facebook_v2.value.app_id app_secret_setting_name = facebook_v2.value.app_secret_setting_name graph_api_version = facebook_v2.value.graph_api_version login_scopes = facebook_v2.value.login_scopes } - } dynamic "github_v2" { for_each = auth_settings_v2.value.github_v2 @@ -736,16 +741,17 @@ resource "azurerm_linux_function_app" "this" { } dynamic "google_v2" { for_each = auth_settings_v2.value.google_v2 + content { client_id = google_v2.value.client_id client_secret_setting_name = google_v2.value.client_secret_setting_name allowed_audiences = google_v2.value.allowed_audiences login_scopes = google_v2.value.login_scopes } - } dynamic "microsoft_v2" { for_each = auth_settings_v2.value.microsoft_v2 + content { client_id = microsoft_v2.value.client_id client_secret_setting_name = microsoft_v2.value.client_secret_setting_name @@ -755,13 +761,13 @@ resource "azurerm_linux_function_app" "this" { } dynamic "twitter_v2" { for_each = auth_settings_v2.value.twitter_v2 + content { consumer_key = twitter_v2.value.consumer_key consumer_secret_setting_name = twitter_v2.value.consumer_secret_setting_name } } } - } dynamic "backup" { for_each = var.backup @@ -795,6 +801,7 @@ resource "azurerm_linux_function_app" "this" { } dynamic "identity" { for_each = local.managed_identities.system_assigned_user_assigned + content { type = identity.value.type identity_ids = identity.value.user_assigned_resource_ids @@ -807,7 +814,6 @@ resource "azurerm_linux_function_app" "this" { app_setting_names = sticky_settings.value.app_setting_names connection_string_names = sticky_settings.value.connection_string_names } - } dynamic "storage_account" { for_each = var.storage_shares_to_mount @@ -823,6 +829,7 @@ resource "azurerm_linux_function_app" "this" { } dynamic "timeouts" { for_each = var.timeouts == null ? [] : [var.timeouts] + content { create = timeouts.value.create delete = timeouts.value.delete diff --git a/main.function_app_slots.tf b/main.function_app_slots.tf index 1949453..6e6da29 100644 --- a/main.function_app_slots.tf +++ b/main.function_app_slots.tf @@ -104,7 +104,8 @@ resource "azurerm_windows_function_app_slot" "this" { } } } - dynamic "scm_ip_restriction" { # one or more scm_ip_restriction blocks + dynamic "scm_ip_restriction" { + # one or more scm_ip_restriction blocks for_each = each.value.site_config.scm_ip_restriction content { @@ -273,6 +274,7 @@ resource "azurerm_windows_function_app_slot" "this" { } dynamic "custom_oidc_v2" { for_each = auth_settings_v2.value.custom_oidc_v2 + content { client_id = custom_oidc_v2.value.client_id name = custom_oidc_v2.value.name @@ -286,17 +288,16 @@ resource "azurerm_windows_function_app_slot" "this" { scopes = custom_oidc_v2.value.scopes token_endpoint = custom_oidc_v2.value.token_endpoint } - } dynamic "facebook_v2" { for_each = auth_settings_v2.value.facebook_v2 + content { app_id = facebook_v2.value.app_id app_secret_setting_name = facebook_v2.value.app_secret_setting_name graph_api_version = facebook_v2.value.graph_api_version login_scopes = facebook_v2.value.login_scopes } - } dynamic "github_v2" { for_each = auth_settings_v2.value.github_v2 @@ -309,16 +310,17 @@ resource "azurerm_windows_function_app_slot" "this" { } dynamic "google_v2" { for_each = auth_settings_v2.value.google_v2 + content { client_id = google_v2.value.client_id client_secret_setting_name = google_v2.value.client_secret_setting_name allowed_audiences = google_v2.value.allowed_audiences login_scopes = google_v2.value.login_scopes } - } dynamic "microsoft_v2" { for_each = auth_settings_v2.value.microsoft_v2 + content { client_id = microsoft_v2.value.client_id client_secret_setting_name = microsoft_v2.value.client_secret_setting_name @@ -328,13 +330,13 @@ resource "azurerm_windows_function_app_slot" "this" { } dynamic "twitter_v2" { for_each = auth_settings_v2.value.twitter_v2 + content { consumer_key = twitter_v2.value.consumer_key consumer_secret_setting_name = twitter_v2.value.consumer_secret_setting_name } } } - } dynamic "backup" { for_each = each.value.backup @@ -368,6 +370,7 @@ resource "azurerm_windows_function_app_slot" "this" { } dynamic "identity" { for_each = local.managed_identities.system_assigned_user_assigned + content { type = identity.value.type identity_ids = identity.value.user_assigned_resource_ids @@ -504,7 +507,8 @@ resource "azurerm_linux_function_app_slot" "this" { } } } - dynamic "scm_ip_restriction" { # one or more scm_ip_restriction blocks + dynamic "scm_ip_restriction" { + # one or more scm_ip_restriction blocks for_each = each.value.site_config.scm_ip_restriction content { @@ -673,6 +677,7 @@ resource "azurerm_linux_function_app_slot" "this" { } dynamic "custom_oidc_v2" { for_each = auth_settings_v2.value.custom_oidc_v2 + content { client_id = custom_oidc_v2.value.client_id name = custom_oidc_v2.value.name @@ -686,17 +691,16 @@ resource "azurerm_linux_function_app_slot" "this" { scopes = custom_oidc_v2.value.scopes token_endpoint = custom_oidc_v2.value.token_endpoint } - } dynamic "facebook_v2" { for_each = auth_settings_v2.value.facebook_v2 + content { app_id = facebook_v2.value.app_id app_secret_setting_name = facebook_v2.value.app_secret_setting_name graph_api_version = facebook_v2.value.graph_api_version login_scopes = facebook_v2.value.login_scopes } - } dynamic "github_v2" { for_each = auth_settings_v2.value.github_v2 @@ -709,16 +713,17 @@ resource "azurerm_linux_function_app_slot" "this" { } dynamic "google_v2" { for_each = auth_settings_v2.value.google_v2 + content { client_id = google_v2.value.client_id client_secret_setting_name = google_v2.value.client_secret_setting_name allowed_audiences = google_v2.value.allowed_audiences login_scopes = google_v2.value.login_scopes } - } dynamic "microsoft_v2" { for_each = auth_settings_v2.value.microsoft_v2 + content { client_id = microsoft_v2.value.client_id client_secret_setting_name = microsoft_v2.value.client_secret_setting_name @@ -728,13 +733,13 @@ resource "azurerm_linux_function_app_slot" "this" { } dynamic "twitter_v2" { for_each = auth_settings_v2.value.twitter_v2 + content { consumer_key = twitter_v2.value.consumer_key consumer_secret_setting_name = twitter_v2.value.consumer_secret_setting_name } } } - } dynamic "backup" { for_each = each.value.backup @@ -768,6 +773,7 @@ resource "azurerm_linux_function_app_slot" "this" { } dynamic "identity" { for_each = local.managed_identities.system_assigned_user_assigned + content { type = identity.value.type identity_ids = identity.value.user_assigned_resource_ids diff --git a/main.service_plan.tf b/main.service_plan.tf index 7b791fb..af0363d 100644 --- a/main.service_plan.tf +++ b/main.service_plan.tf @@ -1,7 +1,29 @@ -resource "azurerm_service_plan" "this" { +# resource "azurerm_service_plan" "this" { +# count = var.create_service_plan ? 1 : 0 + +# location = coalesce(var.new_service_plan.location, var.location) +# name = coalesce(var.new_service_plan.name, "${var.name}-asp") +# os_type = var.os_type +# resource_group_name = coalesce(var.new_service_plan.resource_group_name, var.resource_group_name) +# sku_name = var.new_service_plan.sku_name +# app_service_environment_id = var.new_service_plan.app_service_environment_resource_id +# maximum_elastic_worker_count = var.new_service_plan.maximum_elastic_worker_count +# per_site_scaling_enabled = var.new_service_plan.per_site_scaling_enabled +# tags = var.tags +# worker_count = var.new_service_plan.worker_count +# zone_balancing_enabled = var.new_service_plan.zone_balancing_enabled +# } + +# Testing the newly published App Service Plan module +module "avm_res_web_serverfarm" { count = var.create_service_plan ? 1 : 0 - location = coalesce(var.new_service_plan.location, var.location) + source = "Azure/avm-res-web-serverfarm/azurerm" + version = "0.1.0" + + enable_telemetry = var.enable_telemetry + + # location = coalesce(var.new_service_plan.location, var.location) name = coalesce(var.new_service_plan.name, "${var.name}-asp") os_type = var.os_type resource_group_name = coalesce(var.new_service_plan.resource_group_name, var.resource_group_name) @@ -12,4 +34,6 @@ resource "azurerm_service_plan" "this" { tags = var.tags worker_count = var.new_service_plan.worker_count zone_balancing_enabled = var.new_service_plan.zone_balancing_enabled -} + lock = var.new_service_plan.lock + role_assignments = var.new_service_plan.role_assignments +} \ No newline at end of file diff --git a/main.storage_account.tf b/main.storage_account.tf index d4cf192..f5c6b68 100644 --- a/main.storage_account.tf +++ b/main.storage_account.tf @@ -2,15 +2,18 @@ module "avm_res_storage_storageaccount" { count = var.function_app_create_storage_account ? 1 : 0 source = "Azure/avm-res-storage-storageaccount/azurerm" - version = "0.1.2" + version = "0.2.4" enable_telemetry = var.enable_telemetry name = var.function_app_storage_account.name resource_group_name = coalesce(var.function_app_storage_account.resource_group_name, var.resource_group_name) location = coalesce(var.function_app_storage_account.location, var.location) - shared_access_key_enabled = true - public_network_access_enabled = true + account_kind = var.function_app_storage_account.account_kind + account_tier = var.function_app_storage_account.account_tier + account_replication_type = var.function_app_storage_account.account_replication_type + shared_access_key_enabled = var.function_app_storage_account.shared_access_key_enabled + public_network_access_enabled = var.function_app_storage_account.public_network_access_enabled network_rules = { bypass = ["AzureServices"] default_action = "Allow" diff --git a/main.web_app.tf b/main.web_app.tf index 1d2b721..d289b3f 100644 --- a/main.web_app.tf +++ b/main.web_app.tf @@ -4,7 +4,7 @@ resource "azurerm_windows_web_app" "this" { location = var.location name = var.name resource_group_name = var.resource_group_name - service_plan_id = (var.create_service_plan == true && var.service_plan_resource_id == null) ? azurerm_service_plan.this[0].id : var.service_plan_resource_id + service_plan_id = (var.create_service_plan == true && var.service_plan_resource_id == null) ? module.avm_res_web_serverfarm[0].resource_id : var.service_plan_resource_id app_settings = var.enable_application_insights ? merge({ "APPLICATIONINSIGHTS_CONNECTION_STRING" = azurerm_application_insights.this[0].connection_string }, { "APPINSIGHTS_INSTRUMENTATIONKEY" = azurerm_application_insights.this[0].instrumentation_key }, var.app_settings) : var.app_settings client_affinity_enabled = var.client_affinity_enabled client_certificate_enabled = var.client_certificate_enabled @@ -149,7 +149,8 @@ resource "azurerm_windows_web_app" "this" { } } } - dynamic "scm_ip_restriction" { # one or more scm_ip_restriction blocks + dynamic "scm_ip_restriction" { + # one or more scm_ip_restriction blocks for_each = var.site_config.scm_ip_restriction content { @@ -350,7 +351,6 @@ resource "azurerm_windows_web_app" "this" { scopes = custom_oidc_v2.value.scopes token_endpoint = custom_oidc_v2.value.token_endpoint } - } dynamic "facebook_v2" { for_each = auth_settings_v2.value.facebook_v2 @@ -361,7 +361,6 @@ resource "azurerm_windows_web_app" "this" { graph_api_version = facebook_v2.value.graph_api_version login_scopes = facebook_v2.value.login_scopes } - } dynamic "github_v2" { for_each = auth_settings_v2.value.github_v2 @@ -381,7 +380,6 @@ resource "azurerm_windows_web_app" "this" { allowed_audiences = google_v2.value.allowed_audiences login_scopes = google_v2.value.login_scopes } - } dynamic "microsoft_v2" { for_each = auth_settings_v2.value.microsoft_v2 @@ -531,7 +529,7 @@ resource "azurerm_linux_web_app" "this" { location = var.location name = var.name resource_group_name = var.resource_group_name - service_plan_id = (var.create_service_plan == true && var.service_plan_resource_id == null) ? azurerm_service_plan.this[0].id : var.service_plan_resource_id + service_plan_id = (var.create_service_plan == true && var.service_plan_resource_id == null) ? module.avm_res_web_serverfarm[0].resource_id : var.service_plan_resource_id app_settings = var.enable_application_insights ? merge({ "APPLICATIONINSIGHTS_CONNECTION_STRING" = azurerm_application_insights.this[0].connection_string }, { "APPINSIGHTS_INSTRUMENTATIONKEY" = azurerm_application_insights.this[0].instrumentation_key }, var.app_settings) : var.app_settings client_affinity_enabled = var.client_affinity_enabled client_certificate_enabled = var.client_certificate_enabled @@ -672,7 +670,8 @@ resource "azurerm_linux_web_app" "this" { } } } - dynamic "scm_ip_restriction" { # one or more scm_ip_restriction blocks + dynamic "scm_ip_restriction" { + # one or more scm_ip_restriction blocks for_each = var.site_config.scm_ip_restriction content { @@ -855,7 +854,6 @@ resource "azurerm_linux_web_app" "this" { scopes = custom_oidc_v2.value.scopes token_endpoint = custom_oidc_v2.value.token_endpoint } - } dynamic "facebook_v2" { for_each = auth_settings_v2.value.facebook_v2 @@ -866,7 +864,6 @@ resource "azurerm_linux_web_app" "this" { graph_api_version = facebook_v2.value.graph_api_version login_scopes = facebook_v2.value.login_scopes } - } dynamic "github_v2" { for_each = auth_settings_v2.value.github_v2 @@ -886,7 +883,6 @@ resource "azurerm_linux_web_app" "this" { allowed_audiences = google_v2.value.allowed_audiences login_scopes = google_v2.value.login_scopes } - } dynamic "microsoft_v2" { for_each = auth_settings_v2.value.microsoft_v2 diff --git a/main.web_app_slots.tf b/main.web_app_slots.tf index 1ad56b1..585840b 100644 --- a/main.web_app_slots.tf +++ b/main.web_app_slots.tf @@ -148,7 +148,8 @@ resource "azurerm_windows_web_app_slot" "this" { } } } - dynamic "scm_ip_restriction" { # one or more scm_ip_restriction blocks + dynamic "scm_ip_restriction" { + # one or more scm_ip_restriction blocks for_each = each.value.site_config.scm_ip_restriction content { @@ -331,7 +332,6 @@ resource "azurerm_windows_web_app_slot" "this" { scopes = custom_oidc_v2.value.scopes token_endpoint = custom_oidc_v2.value.token_endpoint } - } dynamic "facebook_v2" { for_each = auth_settings_v2.value.facebook_v2 @@ -342,7 +342,6 @@ resource "azurerm_windows_web_app_slot" "this" { graph_api_version = facebook_v2.value.graph_api_version login_scopes = facebook_v2.value.login_scopes } - } dynamic "github_v2" { for_each = auth_settings_v2.value.github_v2 @@ -362,7 +361,6 @@ resource "azurerm_windows_web_app_slot" "this" { allowed_audiences = google_v2.value.allowed_audiences login_scopes = google_v2.value.login_scopes } - } dynamic "microsoft_v2" { for_each = auth_settings_v2.value.microsoft_v2 @@ -641,7 +639,8 @@ resource "azurerm_linux_web_app_slot" "this" { } } } - dynamic "scm_ip_restriction" { # one or more scm_ip_restriction blocks + dynamic "scm_ip_restriction" { + # one or more scm_ip_restriction blocks for_each = each.value.site_config.scm_ip_restriction content { @@ -824,7 +823,6 @@ resource "azurerm_linux_web_app_slot" "this" { scopes = custom_oidc_v2.value.scopes token_endpoint = custom_oidc_v2.value.token_endpoint } - } dynamic "facebook_v2" { for_each = auth_settings_v2.value.facebook_v2 @@ -835,7 +833,6 @@ resource "azurerm_linux_web_app_slot" "this" { graph_api_version = facebook_v2.value.graph_api_version login_scopes = facebook_v2.value.login_scopes } - } dynamic "github_v2" { for_each = auth_settings_v2.value.github_v2 @@ -855,7 +852,6 @@ resource "azurerm_linux_web_app_slot" "this" { allowed_audiences = google_v2.value.allowed_audiences login_scopes = google_v2.value.login_scopes } - } dynamic "microsoft_v2" { for_each = auth_settings_v2.value.microsoft_v2 diff --git a/outputs.tf b/outputs.tf index 9833dc3..c390dc8 100644 --- a/outputs.tf +++ b/outputs.tf @@ -29,6 +29,11 @@ output "kind" { value = var.kind } +output "location" { + description = "The location of the resource." + value = var.location +} + output "name" { description = "The name of the resource." value = (var.kind == "functionapp" || var.kind == "webapp") ? (var.kind == "functionapp" ? (var.os_type == "Windows" ? azurerm_windows_function_app.this[0].name : azurerm_linux_function_app.this[0].name) : (var.os_type == "Windows" ? azurerm_windows_web_app.this[0].name : azurerm_linux_web_app.this[0].name)) : null @@ -73,9 +78,14 @@ output "resource_uri" { value = (var.kind == "functionapp" || var.kind == "webapp") ? (var.kind == "functionapp" ? (var.os_type == "Windows" ? azurerm_windows_function_app.this[0].default_hostname : azurerm_linux_function_app.this[0].default_hostname) : (var.os_type == "Windows" ? azurerm_windows_web_app.this[0].default_hostname : azurerm_linux_web_app.this[0].default_hostname)) : null } -output "service_plan" { - description = "The service plan resource." - value = var.create_service_plan ? azurerm_service_plan.this[0] : null +output "service_plan_id" { + description = "The resource id of the service plan." + value = var.create_service_plan ? module.avm_res_web_serverfarm[0].resource_id : null +} + +output "service_plan_name" { + description = "The name of the created service plan." + value = var.create_service_plan ? module.avm_res_web_serverfarm[0].name : null } output "storage_account" { diff --git a/variables.slots.tf b/variables.slots.tf index e853c50..5e5af7e 100644 --- a/variables.slots.tf +++ b/variables.slots.tf @@ -392,7 +392,7 @@ variable "deployment_slots" { virtual_network_subnet_id = optional(string) headers = optional(map(object({ x_azure_fdid = optional(list(string)) - x_fd_health_probe = optional(number) + x_fd_health_probe = optional(list(string), ["1"]) x_forwarded_for = optional(list(string)) x_forwarded_host = optional(list(string)) })), {}) @@ -406,7 +406,7 @@ variable "deployment_slots" { virtual_network_subnet_id = optional(string) headers = optional(map(object({ x_azure_fdid = optional(list(string)) - x_fd_health_probe = optional(number) + x_fd_health_probe = optional(list(string), ["1"]) x_forwarded_for = optional(list(string)) x_forwarded_host = optional(list(string)) })), {}) diff --git a/variables.tf b/variables.tf index 413c018..259bea1 100644 --- a/variables.tf +++ b/variables.tf @@ -11,7 +11,7 @@ variable "kind" { variable "location" { type = string - description = "Azure region where the resource should be deployed. If null, the location will be inferred from the resource group location." + description = "Azure region where the resource should be deployed." nullable = false } @@ -790,9 +790,14 @@ variable "function_app_create_storage_account" { variable "function_app_storage_account" { type = object({ - name = optional(string) - resource_group_name = optional(string) - location = optional(string) + name = optional(string) + resource_group_name = optional(string) + location = optional(string) + account_kind = optional(string, "StorageV2") + account_tier = optional(string, "Standard") + account_replication_type = optional(string) + shared_access_key_enabled = optional(bool, true) + public_network_access_enabled = optional(bool, true) lock = optional(object({ kind = string name = optional(string, null) @@ -817,6 +822,11 @@ variable "function_app_storage_account" { - `name` - (Optional) The name of the Storage Account. - `resource_group_name` - (Optional) The name of the resource group to deploy the Storage Account in. - `location` - (Optional) The Azure region where the Storage Account will be deployed. + - `account_kind` - (Optional) The kind of the Storage Account. Defaults to `StorageV2`. + - `account_tier` - (Optional) The tier of the Storage Account. Defaults to `Standard`. + - `account_replication_type` - (Optional) The replication type of the Storage Account. + - `shared_access_key_enabled` - (Optional) Should the shared access key be enabled for the Storage Account? Defaults to `true`. + - `public_network_access_enabled` - (Optional) Should public network access be enabled for the Storage Account? Defaults to `true`. - `lock` - (Optional) The lock level to apply. - `role_assignments` - (Optional) A map of role assignments to assign to the Storage Account. @@ -935,12 +945,26 @@ variable "new_service_plan" { name = optional(string) resource_group_name = optional(string) location = optional(string) - sku_name = optional(string) + sku_name = optional(string, "P1v2") app_service_environment_resource_id = optional(string) maximum_elastic_worker_count = optional(number) - worker_count = optional(number) + worker_count = optional(number, 3) per_site_scaling_enabled = optional(bool, false) - zone_balancing_enabled = optional(bool) + zone_balancing_enabled = optional(bool, true) + lock = optional(object({ + kind = string + name = optional(string, null) + }), null) + role_assignments = optional(map(object({ + role_definition_id_or_name = string + principal_id = string + description = optional(string, null) + skip_service_principal_aad_check = optional(bool, false) + condition = optional(string, null) + condition_version = optional(string, null) + delegated_managed_identity_resource_id = optional(string, null) + principal_type = optional(string, null) + })), {}) }) default = { @@ -951,10 +975,11 @@ variable "new_service_plan" { - `name` - (Optional) The name of the App Service Plan. - `resource_group_name` - (Optional) The name of the resource group to deploy the App Service Plan in. - `location` - (Optional) The Azure region where the App Service Plan will be deployed. Defaults to the location of the resource group. - - `sku_name` - (Optional) The SKU name of the App Service Plan. Defaults to `B1`. + - `sku_name` - (Optional) The SKU name of the App Service Plan. Defaults to `P1v2`. + > 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`. - `app_service_environment_resource_id` - (Optional) The resource ID of the App Service Environment to deploy the App Service Plan in. - - `maximum_elastic_worker_count` - (Optional) The maximum number of workers that can be allocated to this App Service Plan. - - `worker_count` - (Optional) The number of workers to allocate to this App Service Plan. + - `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. + - `worker_count` - (Optional) The number of workers to allocate to this App Service Plan. Defaults to `3`. - `per_site_scaling_enabled` - (Optional) Should per site scaling be enabled for the App Service Plan? Defaults to `false`. - `zone_balancing_enabled` - (Optional) Should zone balancing be enabled for the App Service Plan? Changing this forces a new resource to be created. > **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. @@ -1151,7 +1176,7 @@ variable "site_config" { virtual_network_subnet_id = optional(string) headers = optional(map(object({ x_azure_fdid = optional(list(string)) - x_fd_health_probe = optional(number) + x_fd_health_probe = optional(list(string), ["1"]) x_forwarded_for = optional(list(string)) x_forwarded_host = optional(list(string)) })), {}) @@ -1165,7 +1190,7 @@ variable "site_config" { virtual_network_subnet_id = optional(string) headers = optional(map(object({ x_azure_fdid = optional(list(string)) - x_fd_health_probe = optional(number) + x_fd_health_probe = optional(list(string), ["1"]) x_forwarded_for = optional(list(string)) x_forwarded_host = optional(list(string)) })), {})