Skip to content

Commit

Permalink
overhaul of az support and doc updates (#114)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
donovm4 authored Sep 9, 2024
1 parent c2a8901 commit 572eae0
Show file tree
Hide file tree
Showing 52 changed files with 357 additions and 506 deletions.
74 changes: 56 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -72,7 +71,7 @@ Type: `string`

### <a name="input_location"></a> [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`

Expand Down Expand Up @@ -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))
})), {})
Expand All @@ -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))
})), {})
Expand Down Expand Up @@ -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.

Expand All @@ -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)
Expand Down Expand Up @@ -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.
Expand All @@ -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)
})), {})
})
```

Expand Down Expand Up @@ -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))
})), {})
Expand All @@ -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))
})), {})
Expand Down Expand Up @@ -2032,6 +2056,10 @@ Description: The object principal id of the resource.

Description: The kind of app service.

### <a name="output_location"></a> [location](#output\_location)

Description: The location of the resource.

### <a name="output_name"></a> [name](#output\_name)

Description: The name of the resource.
Expand Down Expand Up @@ -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.

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

Description: The service plan resource.
Description: The resource id of the service plan.

### <a name="output_service_plan_name"></a> [service\_plan\_name](#output\_service\_plan\_name)

Description: The name of the created service plan.

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

Expand Down Expand Up @@ -2100,7 +2132,13 @@ The following Modules are called:

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

Version: 0.1.2
Version: 0.2.4

### <a name="module_avm_res_web_serverfarm"></a> [avm\_res\_web\_serverfarm](#module\_avm\_res\_web\_serverfarm)

Source: Azure/avm-res-web-serverfarm/azurerm

Version: 0.1.0

<!-- markdownlint-disable-next-line MD041 -->
## Data Collection
Expand Down
2 changes: 1 addition & 1 deletion avm.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
59 changes: 2 additions & 57 deletions examples/auto_heal_enabled/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- BEGIN_TF_DOCS -->
# 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 {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
# }
}
```

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

Description: This is the full output for the resource.

### <a name="output_service_plan"></a> [service\_plan](#output\_service\_plan)

Description: Full output of service plan created

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

Description: Full output of storage account created
Expand Down
2 changes: 1 addition & 1 deletion examples/auto_heal_enabled/_header.md
Original file line number Diff line number Diff line change
@@ -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.
8 changes: 5 additions & 3 deletions examples/auto_heal_enabled/locals.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
locals {
azure_regions = [
"eastus",
"westeurope",
"eastasia",
"japaneast"
"eastus2",
"centralus",
"southcentralus",
"westus2",
"westus3"
]
}
53 changes: 1 addition & 52 deletions examples/auto_heal_enabled/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
# }
}
5 changes: 0 additions & 5 deletions examples/auto_heal_enabled/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions examples/basic_auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -199,10 +199,6 @@ Description: This is the full output for the resource.

Description: This is the full output for the resource.

### <a name="output_service_plan"></a> [service\_plan](#output\_service\_plan)

Description: Full output of service plan created

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

Description: Full output of storage account created
Expand Down
Loading

0 comments on commit 572eae0

Please sign in to comment.