Skip to content

Commit 8ca61f0

Browse files
authored
aligning module to res specifications (#118)
* removing support for creating service plan and storage account * linting fixes * removing suggestive settings from e2e test examples * fixing references to resource modules * running pre-commit * fixing locals.tf in slots examples * default_action added for windows function app and function app slots * updating linting and version-check
1 parent 887d421 commit 8ca61f0

70 files changed

Lines changed: 2159 additions & 1695 deletions

Some content is hidden

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

.github/workflows/linting.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- name: checkout repository
24-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7
24+
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 #v4.2.1
2525

2626
- name: check docs
2727
uses: Azure/terraform-azurerm-avm-template/.github/actions/docs-check@main
@@ -32,7 +32,7 @@ jobs:
3232
runs-on: ubuntu-latest
3333
steps:
3434
- name: checkout repository
35-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7
35+
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 #v4.2.1
3636

3737
- name: lint terraform
3838
uses: Azure/terraform-azurerm-avm-template/.github/actions/linting@main
@@ -45,7 +45,7 @@ jobs:
4545
runs-on: ubuntu-latest
4646
steps:
4747
- name: checkout repository
48-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7
48+
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 #v4.2.1
4949

5050
- name: avmfix
5151
uses: Azure/terraform-azurerm-avm-template/.github/actions/avmfix@main

.github/workflows/version-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
if: github.event.repository.name != 'terraform-azurerm-avm-template'
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7
19+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 #v4.2.1
2020
- name: Check version
2121
uses: Azure/terraform-azurerm-avm-template/.github/actions/version-check@main
2222
with:

README.md

Lines changed: 97 additions & 192 deletions
Large diffs are not rendered by default.
File renamed without changes.

examples/auto_heal_enabled/README.md

Lines changed: 96 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -24,69 +24,76 @@ module "naming" {
2424
version = ">= 0.3.0"
2525
}
2626
27-
# This is required for resource modules
28-
resource "azurerm_resource_group" "example" {
27+
module "avm_res_resources_resourcegroup" {
28+
source = "Azure/avm-res-resources-resourcegroup/azurerm"
29+
version = "0.1.0"
30+
2931
location = local.azure_regions[random_integer.region_index.result]
3032
name = module.naming.resource_group.name_unique
3133
}
3234
33-
module "test" {
35+
module "avm_res_web_serverfarm" {
36+
source = "Azure/avm-res-web-serverfarm/azurerm"
37+
version = "0.2.0"
38+
39+
enable_telemetry = var.enable_telemetry
40+
41+
name = module.naming.app_service_plan.name_unique
42+
resource_group_name = module.avm_res_resources_resourcegroup.name
43+
location = module.avm_res_resources_resourcegroup.resource.location
44+
os_type = "Linux"
45+
46+
}
47+
48+
module "avm_res_web_site" {
3449
source = "../../"
3550
3651
# source = "Azure/avm-res-web-site/azurerm"
37-
# version = "0.10.1"
52+
# version = "0.11.0"
3853
3954
enable_telemetry = var.enable_telemetry
4055
41-
name = "${module.naming.function_app.name_unique}-slots"
42-
resource_group_name = azurerm_resource_group.example.name
43-
location = azurerm_resource_group.example.location
56+
name = "${module.naming.function_app.name_unique}-auto-heal"
57+
resource_group_name = module.avm_res_resources_resourcegroup.name
58+
location = module.avm_res_resources_resourcegroup.resource.location
4459
45-
kind = "webapp"
46-
os_type = "Linux"
60+
kind = "webapp"
4761
48-
site_config = {
49-
# auto_heal_enabled = true
50-
# auto_heal_enabled = false # This will throw a module and provider error.
51-
auto_heal_enabled = null # `auto_heal_setting` cannot be set if `auto_heal_enabled` is set to `null`. `null` is the default value for `auto_heal_enabled`
62+
os_type = module.avm_res_web_serverfarm.resource.os_type
63+
service_plan_resource_id = module.avm_res_web_serverfarm.resource_id
5264
65+
site_config = {
66+
auto_heal_enabled = true # `auto_heal_enabled` deprecated in azurerm 4.x
5367
}
5468
auto_heal_setting = { # auto_heal_setting should only be specified if auto_heal_enabled is set to `true`
55-
# setting_1 = {
56-
# action = {
57-
# action_type = "Recycle"
58-
# minimum_process_execution_time = "00:01:00"
59-
# }
60-
# trigger = {
61-
# requests = {
62-
# count = 100
63-
# interval = "00:00:30"
64-
# }
65-
# status_code = {
66-
# status_5000 = {
67-
# count = 5000
68-
# interval = "00:05:00"
69-
# path = "/HealthCheck"
70-
# status_code_range = 500
71-
# sub_status = 0
72-
# }
73-
# status_6000 = {
74-
# count = 6000
75-
# interval = "00:05:00"
76-
# path = "/Get"
77-
# status_code_range = 500
78-
# sub_status = 0
79-
# }
80-
# }
81-
# }
82-
# }
83-
}
84-
85-
# Creates a new app service plan
86-
create_service_plan = true
87-
new_service_plan = {
88-
sku_name = var.sku_for_testing
89-
zone_balancing_enabled = var.redundancy_for_testing
69+
setting_1 = {
70+
action = {
71+
action_type = "Recycle"
72+
minimum_process_execution_time = "00:01:00"
73+
}
74+
trigger = {
75+
requests = {
76+
count = 100
77+
interval = "00:00:30"
78+
}
79+
status_code = {
80+
status_5000 = {
81+
count = 5000
82+
interval = "00:05:00"
83+
path = "/HealthCheck"
84+
status_code_range = 500
85+
sub_status = 0
86+
}
87+
status_6000 = {
88+
count = 6000
89+
interval = "00:05:00"
90+
path = "/Get"
91+
status_code_range = 500
92+
sub_status = 0
93+
}
94+
}
95+
}
96+
}
9097
}
9198
}
9299
```
@@ -106,7 +113,6 @@ The following requirements are needed by this module:
106113

107114
The following resources are used by this module:
108115

109-
- [azurerm_resource_group.example](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group) (resource)
110116
- [random_integer.region_index](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/integer) (resource)
111117

112118
<!-- markdownlint-disable MD013 -->
@@ -128,22 +134,6 @@ Type: `bool`
128134

129135
Default: `true`
130136

131-
### <a name="input_redundancy_for_testing"></a> [redundancy\_for\_testing](#input\_redundancy\_for\_testing)
132-
133-
Description: n/a
134-
135-
Type: `string`
136-
137-
Default: `"false"`
138-
139-
### <a name="input_sku_for_testing"></a> [sku\_for\_testing](#input\_sku\_for\_testing)
140-
141-
Description: n/a
142-
143-
Type: `string`
144-
145-
Default: `"S1"`
146-
147137
## Outputs
148138

149139
The following outputs are exported:
@@ -156,22 +146,60 @@ Description: ID of active slot
156146

157147
Description: Full output of deployment slots created
158148

149+
### <a name="output_location"></a> [location](#output\_location)
150+
151+
Description: This is the full output for the resource.
152+
159153
### <a name="output_name"></a> [name](#output\_name)
160154

161155
Description: This is the full output for the resource.
162156

163-
### <a name="output_resource"></a> [resource](#output\_resource)
157+
### <a name="output_resource_id"></a> [resource\_id](#output\_resource\_id)
164158

165159
Description: This is the full output for the resource.
166160

167-
### <a name="output_storage_account"></a> [storage\_account](#output\_storage\_account)
161+
### <a name="output_service_plan_id"></a> [service\_plan\_id](#output\_service\_plan\_id)
162+
163+
Description: The ID of the app service
168164

169-
Description: Full output of storage account created
165+
### <a name="output_service_plan_name"></a> [service\_plan\_name](#output\_service\_plan\_name)
166+
167+
Description: Full output of service plan created
168+
169+
### <a name="output_sku_name"></a> [sku\_name](#output\_sku\_name)
170+
171+
Description: The number of workers
172+
173+
### <a name="output_worker_count"></a> [worker\_count](#output\_worker\_count)
174+
175+
Description: The number of workers
176+
177+
### <a name="output_zone_redundant"></a> [zone\_redundant](#output\_zone\_redundant)
178+
179+
Description: The number of workers
170180

171181
## Modules
172182

173183
The following Modules are called:
174184

185+
### <a name="module_avm_res_resources_resourcegroup"></a> [avm\_res\_resources\_resourcegroup](#module\_avm\_res\_resources\_resourcegroup)
186+
187+
Source: Azure/avm-res-resources-resourcegroup/azurerm
188+
189+
Version: 0.1.0
190+
191+
### <a name="module_avm_res_web_serverfarm"></a> [avm\_res\_web\_serverfarm](#module\_avm\_res\_web\_serverfarm)
192+
193+
Source: Azure/avm-res-web-serverfarm/azurerm
194+
195+
Version: 0.2.0
196+
197+
### <a name="module_avm_res_web_site"></a> [avm\_res\_web\_site](#module\_avm\_res\_web\_site)
198+
199+
Source: ../../
200+
201+
Version:
202+
175203
### <a name="module_naming"></a> [naming](#module\_naming)
176204

177205
Source: Azure/naming/azurerm
@@ -184,12 +212,6 @@ Source: Azure/regions/azurerm
184212

185213
Version: >= 0.3.0
186214

187-
### <a name="module_test"></a> [test](#module\_test)
188-
189-
Source: ../../
190-
191-
Version:
192-
193215
<!-- markdownlint-disable-next-line MD041 -->
194216
## Data Collection
195217

examples/auto_heal_enabled/main.tf

Lines changed: 55 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -18,68 +18,75 @@ module "naming" {
1818
version = ">= 0.3.0"
1919
}
2020

21-
# This is required for resource modules
22-
resource "azurerm_resource_group" "example" {
21+
module "avm_res_resources_resourcegroup" {
22+
source = "Azure/avm-res-resources-resourcegroup/azurerm"
23+
version = "0.1.0"
24+
2325
location = local.azure_regions[random_integer.region_index.result]
2426
name = module.naming.resource_group.name_unique
2527
}
2628

27-
module "test" {
29+
module "avm_res_web_serverfarm" {
30+
source = "Azure/avm-res-web-serverfarm/azurerm"
31+
version = "0.2.0"
32+
33+
enable_telemetry = var.enable_telemetry
34+
35+
name = module.naming.app_service_plan.name_unique
36+
resource_group_name = module.avm_res_resources_resourcegroup.name
37+
location = module.avm_res_resources_resourcegroup.resource.location
38+
os_type = "Linux"
39+
40+
}
41+
42+
module "avm_res_web_site" {
2843
source = "../../"
2944

3045
# source = "Azure/avm-res-web-site/azurerm"
31-
# version = "0.10.1"
46+
# version = "0.11.0"
3247

3348
enable_telemetry = var.enable_telemetry
3449

35-
name = "${module.naming.function_app.name_unique}-slots"
36-
resource_group_name = azurerm_resource_group.example.name
37-
location = azurerm_resource_group.example.location
50+
name = "${module.naming.function_app.name_unique}-auto-heal"
51+
resource_group_name = module.avm_res_resources_resourcegroup.name
52+
location = module.avm_res_resources_resourcegroup.resource.location
3853

39-
kind = "webapp"
40-
os_type = "Linux"
54+
kind = "webapp"
4155

42-
site_config = {
43-
# auto_heal_enabled = true
44-
# auto_heal_enabled = false # This will throw a module and provider error.
45-
auto_heal_enabled = null # `auto_heal_setting` cannot be set if `auto_heal_enabled` is set to `null`. `null` is the default value for `auto_heal_enabled`
56+
os_type = module.avm_res_web_serverfarm.resource.os_type
57+
service_plan_resource_id = module.avm_res_web_serverfarm.resource_id
4658

59+
site_config = {
60+
auto_heal_enabled = true # `auto_heal_enabled` deprecated in azurerm 4.x
4761
}
4862
auto_heal_setting = { # auto_heal_setting should only be specified if auto_heal_enabled is set to `true`
49-
# setting_1 = {
50-
# action = {
51-
# action_type = "Recycle"
52-
# minimum_process_execution_time = "00:01:00"
53-
# }
54-
# trigger = {
55-
# requests = {
56-
# count = 100
57-
# interval = "00:00:30"
58-
# }
59-
# status_code = {
60-
# status_5000 = {
61-
# count = 5000
62-
# interval = "00:05:00"
63-
# path = "/HealthCheck"
64-
# status_code_range = 500
65-
# sub_status = 0
66-
# }
67-
# status_6000 = {
68-
# count = 6000
69-
# interval = "00:05:00"
70-
# path = "/Get"
71-
# status_code_range = 500
72-
# sub_status = 0
73-
# }
74-
# }
75-
# }
76-
# }
77-
}
78-
79-
# Creates a new app service plan
80-
create_service_plan = true
81-
new_service_plan = {
82-
sku_name = var.sku_for_testing
83-
zone_balancing_enabled = var.redundancy_for_testing
63+
setting_1 = {
64+
action = {
65+
action_type = "Recycle"
66+
minimum_process_execution_time = "00:01:00"
67+
}
68+
trigger = {
69+
requests = {
70+
count = 100
71+
interval = "00:00:30"
72+
}
73+
status_code = {
74+
status_5000 = {
75+
count = 5000
76+
interval = "00:05:00"
77+
path = "/HealthCheck"
78+
status_code_range = 500
79+
sub_status = 0
80+
}
81+
status_6000 = {
82+
count = 6000
83+
interval = "00:05:00"
84+
path = "/Get"
85+
status_code_range = 500
86+
sub_status = 0
87+
}
88+
}
89+
}
90+
}
8491
}
8592
}

0 commit comments

Comments
 (0)