Skip to content

Commit

Permalink
updating examples to azurerm 4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
donovm4 committed Oct 28, 2024
1 parent 6d323ff commit 515cd06
Show file tree
Hide file tree
Showing 51 changed files with 1,045 additions and 1,391 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The following requirements are needed by this module:

- <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) (~> 1.9)

- <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) (>= 3.71.0, < 4.0.0)
- <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) (>= 4.0.0, < 5.0.0)

- <a name="requirement_modtm"></a> [modtm](#requirement\_modtm) (~> 0.3)

Expand Down
277 changes: 131 additions & 146 deletions examples/auto_heal_enabled/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!-- BEGIN_TF_DOCS -->
# Default example

This deploys the module as a Linux Web App utilizing auto heal settings.

```hcl
<!-- BEGIN_TF_DOCS -->
# Default example

This deploys the module as a Linux Web App utilizing auto heal settings.

```hcl
## Section to provide a random Azure region for the resource group
# This allows us to randomize the region for the resource group.
module "regions" {
Expand All @@ -12,7 +12,7 @@ module "regions" {
}
# This allows us to randomize the region for the resource group.
resource "random_integer" "region_index" {
resource "random_integer" "region_index" {
max = length(local.azure_regions) - 1
min = 0
}
Expand All @@ -24,46 +24,41 @@ module "naming" {
version = ">= 0.3.0"
}
module "avm_res_resources_resourcegroup" {
source = "Azure/avm-res-resources-resourcegroup/azurerm"
version = "0.1.0"
resource "azurerm_resource_group" "example" {
location = local.azure_regions[random_integer.region_index.result]
name = module.naming.resource_group.name_unique
}
module "avm_res_web_serverfarm" {
source = "Azure/avm-res-web-serverfarm/azurerm"
version = "0.2.0"
enable_telemetry = var.enable_telemetry
resource "azurerm_service_plan" "example" {
location = azurerm_resource_group.example.location
name = module.naming.app_service_plan.name_unique
resource_group_name = module.avm_res_resources_resourcegroup.name
location = module.avm_res_resources_resourcegroup.resource.location
os_type = "Linux"
resource_group_name = azurerm_resource_group.example.name
sku_name = "P1v2"
tags = {
app = "${module.naming.function_app.name_unique}-default"
}
}
module "avm_res_web_site" {
source = "../../"
# source = "Azure/avm-res-web-site/azurerm"
# version = "0.11.0"
# version = "0.12.0"
enable_telemetry = var.enable_telemetry
name = "${module.naming.function_app.name_unique}-auto-heal"
resource_group_name = module.avm_res_resources_resourcegroup.name
location = module.avm_res_resources_resourcegroup.resource.location
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
kind = "webapp"
os_type = module.avm_res_web_serverfarm.resource.os_type
service_plan_resource_id = module.avm_res_web_serverfarm.resource_id
os_type = azurerm_service_plan.example.os_type
service_plan_resource_id = azurerm_service_plan.example.id
site_config = {
auto_heal_enabled = true # `auto_heal_enabled` deprecated in azurerm 4.x
}
auto_heal_setting = { # auto_heal_setting should only be specified if auto_heal_enabled is set to `true`
setting_1 = {
Expand Down Expand Up @@ -96,124 +91,114 @@ module "avm_res_web_site" {
}
}
}
```

<!-- markdownlint-disable MD033 -->
## Requirements

The following requirements are needed by this module:

- <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) (>= 1.6.1)

- <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) (>= 3.7.0, < 4.0.0)

- <a name="requirement_random"></a> [random](#requirement\_random) (>= 3.5.0, < 4.0.0)

## Resources

The following resources are used by this module:

- [random_integer.region_index](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/integer) (resource)

<!-- markdownlint-disable MD013 -->
## Required Inputs

No required inputs.

## Optional Inputs

The following input variables are optional (have default values):

### <a name="input_enable_telemetry"></a> [enable\_telemetry](#input\_enable\_telemetry)

Description: This variable controls whether or not telemetry is enabled for the module.
For more information see <https://aka.ms/avm/telemetryinfo>.
If it is set to false, then no telemetry will be collected.

Type: `bool`

Default: `true`

## Outputs

The following outputs are exported:

### <a name="output_active_slot"></a> [active\_slot](#output\_active\_slot)

Description: ID of active slot

### <a name="output_deployment_slots"></a> [deployment\_slots](#output\_deployment\_slots)

Description: Full output of deployment slots created

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

Description: This is the full output for the resource.

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

Description: This is the full output for the resource.

### <a name="output_resource_id"></a> [resource\_id](#output\_resource\_id)

Description: This is the full output for the resource.

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

Description: The ID of the app service

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

Description: Full output of service plan created

### <a name="output_sku_name"></a> [sku\_name](#output\_sku\_name)

Description: The number of workers

### <a name="output_worker_count"></a> [worker\_count](#output\_worker\_count)

Description: The number of workers

### <a name="output_zone_redundant"></a> [zone\_redundant](#output\_zone\_redundant)

Description: The number of workers

## Modules

The following Modules are called:

### <a name="module_avm_res_resources_resourcegroup"></a> [avm\_res\_resources\_resourcegroup](#module\_avm\_res\_resources\_resourcegroup)

Source: Azure/avm-res-resources-resourcegroup/azurerm

Version: 0.1.0

### <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.2.0

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

Source: ../../

Version:

### <a name="module_naming"></a> [naming](#module\_naming)

Source: Azure/naming/azurerm

Version: >= 0.3.0

### <a name="module_regions"></a> [regions](#module\_regions)

Source: Azure/regions/azurerm

Version: >= 0.3.0

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

The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at <https://go.microsoft.com/fwlink/?LinkID=824704>. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.
```

<!-- markdownlint-disable MD033 -->
## Requirements

The following requirements are needed by this module:

- <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) (~> 1.9)

- <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) (~> 4.0)

- <a name="requirement_random"></a> [random](#requirement\_random) (>= 3.5.0, < 4.0.0)

## Resources

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)

<!-- markdownlint-disable MD013 -->
## Required Inputs

No required inputs.

## Optional Inputs

The following input variables are optional (have default values):

### <a name="input_enable_telemetry"></a> [enable\_telemetry](#input\_enable\_telemetry)

Description: This variable controls whether or not telemetry is enabled for the module.
For more information see <https://aka.ms/avm/telemetryinfo>.
If it is set to false, then no telemetry will be collected.

Type: `bool`

Default: `true`

## Outputs

The following outputs are exported:

### <a name="output_active_slot"></a> [active\_slot](#output\_active\_slot)

Description: ID of active slot

### <a name="output_deployment_slots"></a> [deployment\_slots](#output\_deployment\_slots)

Description: Full output of deployment slots created

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

Description: This is the full output for the resource.

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

Description: This is the full output for the resource.

### <a name="output_resource_id"></a> [resource\_id](#output\_resource\_id)

Description: This is the full output for the resource.

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

Description: The ID of the app service

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

Description: Full output of service plan created

### <a name="output_sku_name"></a> [sku\_name](#output\_sku\_name)

Description: The number of workers

### <a name="output_worker_count"></a> [worker\_count](#output\_worker\_count)

Description: The number of workers

### <a name="output_zone_redundant"></a> [zone\_redundant](#output\_zone\_redundant)

Description: The number of workers

## Modules

The following Modules are called:

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

Source: ../../

Version:

### <a name="module_naming"></a> [naming](#module\_naming)

Source: Azure/naming/azurerm

Version: >= 0.3.0

### <a name="module_regions"></a> [regions](#module\_regions)

Source: Azure/regions/azurerm

Version: >= 0.3.0

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

The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at <https://go.microsoft.com/fwlink/?LinkID=824704>. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.
<!-- END_TF_DOCS -->
8 changes: 4 additions & 4 deletions examples/auto_heal_enabled/_footer.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- markdownlint-disable-next-line MD041 -->
## Data Collection

The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at <https://go.microsoft.com/fwlink/?LinkID=824704>. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.
<!-- markdownlint-disable-next-line MD041 -->
## Data Collection

The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at <https://go.microsoft.com/fwlink/?LinkID=824704>. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.
6 changes: 3 additions & 3 deletions 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 as a Linux Web App utilizing auto heal settings.
# Default example

This deploys the module as a Linux Web App utilizing auto heal settings.
2 changes: 1 addition & 1 deletion examples/auto_heal_enabled/locals.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
locals {
locals {
azure_regions = [
"eastus",
"westus"
Expand Down
Loading

0 comments on commit 515cd06

Please sign in to comment.