Skip to content

Commit 0519c6f

Browse files
Release/grept (#171)
* fix: grept apply (#168) Co-authored-by: azure-verified-modules[bot] <187664033+azure-verified-modules[bot]@users.noreply.github.com> * inital commit --------- Co-authored-by: azure-verified-modules[bot] <187664033+azure-verified-modules[bot]@users.noreply.github.com>
1 parent 0ff2c23 commit 0519c6f

31 files changed

Lines changed: 867 additions & 844 deletions

File tree

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
indent_style = space
8+
indent_size = 2
9+
trim_trailing_whitespace = true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,4 @@ avm.tflint_module.hcl
4646
avm.tflint.merged.hcl
4747
avm.tflint_example.merged.hcl
4848
avm.tflint_module.merged.hcl
49+
examples/*/policy

CONTRIBUTING.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Contributing
2+
3+
This project welcomes contributions and suggestions. Most contributions require you to
4+
agree to a Contributor License Agreement (CLA) declaring that you have the right to,
5+
and actually do, grant us the rights to use your contribution. For details, visit
6+
https://cla.microsoft.com.
7+
8+
When you submit a pull request, a CLA-bot will automatically determine whether you need
9+
to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the
10+
instructions provided by the bot. You will only need to do this once across all repositories using our CLA.
11+
12+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
13+
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
14+
or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

avm

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,15 @@ if [ -z "$1" ]; then
1818
exit 1
1919
fi
2020

21-
# Mount .azure directory if it exists
22-
AZURE_VOLUME=""
23-
if [ -d "$HOME/.azure" ]; then
24-
AZURE_VOLUME="-v $HOME/.azure:/home/runtimeuser/.azure"
21+
# Check if AZURE_CONFIG_DIR is set, if not, set it to ~/.azure
22+
if [ -z "$AZURE_CONFIG_DIR" ]; then
23+
AZURE_CONFIG_DIR="$HOME/.azure"
2524
fi
2625

2726
# Check if we are running in a container
2827
# If we are then just run make directly
2928
if [ -z "$AVM_IN_CONTAINER" ]; then
30-
$CONTAINER_RUNTIME run --pull always --user "$(id -u):$(id -g)" --rm $AZURE_VOLUME -v "$(pwd)":/src -w /src -e GITHUB_TOKEN -e GITHUB_REPOSITORY -e ARM_SUBSCRIPTION_ID -e GITHUB_REPOSITORY_OWNER mcr.microsoft.com/azterraform make "$1"
29+
$CONTAINER_RUNTIME run --pull always --user "$(id -u):$(id -g)" --rm -v "$(pwd)":/src -w /src -v $AZURE_CONFIG_DIR:/azureconfig -e AZURE_CONFIG_DIR=/azureconfig -e GITHUB_TOKEN -e GITHUB_REPOSITORY -e ARM_SUBSCRIPTION_ID -e ARM_TENANT_ID -e ARM_CLIENT_ID -e GITHUB_REPOSITORY_OWNER mcr.microsoft.com/azterraform make "$1"
3130
else
3231
make "$1"
3332
fi

avm.bat

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

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

2323
ENDLOCAL

examples/auto_heal_enabled/README.md

Lines changed: 84 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -4,93 +4,93 @@
44
This deploys the module as a Linux Web App utilizing auto heal settings.
55

66
```hcl
7-
## Section to provide a random Azure region for the resource group
8-
# This allows us to randomize the region for the resource group.
9-
module "regions" {
10-
source = "Azure/regions/azurerm"
11-
version = ">= 0.8.0"
12-
}
13-
14-
# This allows us to randomize the region for the resource group.
7+
## Section to provide a random Azure region for the resource group
8+
# This allows us to randomize the region for the resource group.
9+
module "regions" {
10+
source = "Azure/regions/azurerm"
11+
version = ">= 0.8.0"
12+
}
13+
14+
# This allows us to randomize the region for the resource group.
1515
resource "random_integer" "region_index" {
16-
max = length(local.azure_regions) - 1
17-
min = 0
18-
}
19-
## End of section to provide a random Azure region for the resource group
20-
21-
# This ensures we have unique CAF compliant names for our resources.
22-
module "naming" {
23-
source = "Azure/naming/azurerm"
24-
version = ">= 0.3.0"
25-
}
26-
16+
max = length(local.azure_regions) - 1
17+
min = 0
18+
}
19+
## End of section to provide a random Azure region for the resource group
20+
21+
# This ensures we have unique CAF compliant names for our resources.
22+
module "naming" {
23+
source = "Azure/naming/azurerm"
24+
version = ">= 0.3.0"
25+
}
26+
2727
resource "azurerm_resource_group" "example" {
28-
location = local.azure_regions[random_integer.region_index.result]
29-
name = module.naming.resource_group.name_unique
30-
}
31-
28+
location = local.azure_regions[random_integer.region_index.result]
29+
name = module.naming.resource_group.name_unique
30+
}
31+
3232
resource "azurerm_service_plan" "example" {
33-
location = azurerm_resource_group.example.location
34-
name = module.naming.app_service_plan.name_unique
35-
os_type = "Linux"
36-
resource_group_name = azurerm_resource_group.example.name
37-
sku_name = "P1v2"
38-
tags = {
39-
app = "${module.naming.function_app.name_unique}-default"
40-
}
41-
}
42-
43-
module "avm_res_web_site" {
44-
source = "../../"
45-
46-
# source = "Azure/avm-res-web-site/azurerm"
47-
# version = "0.15.1"
48-
49-
enable_telemetry = var.enable_telemetry
50-
51-
name = "${module.naming.function_app.name_unique}-auto-heal"
52-
resource_group_name = azurerm_resource_group.example.name
53-
location = azurerm_resource_group.example.location
54-
55-
kind = "webapp"
56-
57-
os_type = azurerm_service_plan.example.os_type
58-
service_plan_resource_id = azurerm_service_plan.example.id
59-
60-
site_config = {
61-
62-
}
63-
auto_heal_setting = { # auto_heal_setting should only be specified if auto_heal_enabled is set to `true`
64-
setting_1 = {
65-
action = {
66-
action_type = "Recycle"
67-
minimum_process_execution_time = "00:01:00"
68-
}
69-
trigger = {
70-
requests = {
71-
count = 100
72-
interval = "00:00:30"
73-
}
74-
status_code = {
75-
status_5000 = {
76-
count = 5000
77-
interval = "00:05:00"
78-
path = "/HealthCheck"
79-
status_code_range = 500
80-
sub_status = 0
81-
}
82-
status_6000 = {
83-
count = 6000
84-
interval = "00:05:00"
85-
path = "/Get"
86-
status_code_range = 500
87-
sub_status = 0
88-
}
89-
}
90-
}
91-
}
92-
}
93-
}
33+
location = azurerm_resource_group.example.location
34+
name = module.naming.app_service_plan.name_unique
35+
os_type = "Linux"
36+
resource_group_name = azurerm_resource_group.example.name
37+
sku_name = "P1v2"
38+
tags = {
39+
app = "${module.naming.function_app.name_unique}-default"
40+
}
41+
}
42+
43+
module "avm_res_web_site" {
44+
source = "../../"
45+
46+
# source = "Azure/avm-res-web-site/azurerm"
47+
# version = "0.15.2"
48+
49+
enable_telemetry = var.enable_telemetry
50+
51+
name = "${module.naming.function_app.name_unique}-auto-heal"
52+
resource_group_name = azurerm_resource_group.example.name
53+
location = azurerm_resource_group.example.location
54+
55+
kind = "webapp"
56+
57+
os_type = azurerm_service_plan.example.os_type
58+
service_plan_resource_id = azurerm_service_plan.example.id
59+
60+
site_config = {
61+
62+
}
63+
auto_heal_setting = { # auto_heal_setting should only be specified if auto_heal_enabled is set to `true`
64+
setting_1 = {
65+
action = {
66+
action_type = "Recycle"
67+
minimum_process_execution_time = "00:01:00"
68+
}
69+
trigger = {
70+
requests = {
71+
count = 100
72+
interval = "00:00:30"
73+
}
74+
status_code = {
75+
status_5000 = {
76+
count = 5000
77+
interval = "00:05:00"
78+
path = "/HealthCheck"
79+
status_code_range = 500
80+
sub_status = 0
81+
}
82+
status_6000 = {
83+
count = 6000
84+
interval = "00:05:00"
85+
path = "/Get"
86+
status_code_range = 500
87+
sub_status = 0
88+
}
89+
}
90+
}
91+
}
92+
}
93+
}
9494
```
9595

9696
<!-- markdownlint-disable MD033 -->

0 commit comments

Comments
 (0)