Skip to content

Commit 25f157a

Browse files
committed
Add health path to variables
1 parent 91d55fd commit 25f157a

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

code/infra/variables.tf

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,27 @@ variable "route_table_id" {
6262
}
6363
}
6464

65-
variable "python_version" {
65+
variable "function_python_version" {
6666
description = "Specifies the python version of the Azure Function."
6767
type = string
6868
sensitive = false
6969
default = "3.10"
7070
validation {
71-
condition = contains(["3.9", "3.10"], var.python_version)
71+
condition = contains(["3.9", "3.10"], var.function_python_version)
7272
error_message = "Please specify a valid Python version."
7373
}
7474
}
7575

76+
variable "function_health_path" {
77+
description = "Specifies the health endpoint of the Azure Function."
78+
type = string
79+
sensitive = false
80+
validation {
81+
condition = startswith(var.function_health_path, "/")
82+
error_message = "Please specify a valid path."
83+
}
84+
}
85+
7686
variable "private_dns_zone_id_blob" {
7787
description = "Specifies the resource ID of the private DNS zone for Azure Storage blob endpoints. Not required if DNS A-records get created via Azue Policy."
7888
type = string

code/infra/vars.dev.tfvars

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ location = "northeurope"
22
environment = "dev"
33
prefix = "myfunc"
44
tags = {}
5-
python_version = "3.10"
5+
function_python_version = "3.10"
6+
function_health_path = "/v1/health/heartbeat"
67
vnet_id = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGroups/mycrp-prd-function-network-rg/providers/Microsoft.Network/virtualNetworks/mycrp-prd-function-vnet001"
78
nsg_id = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGroups/mycrp-prd-function-network-rg/providers/Microsoft.Network/networkSecurityGroups/mycrp-prd-function-nsg001"
89
route_table_id = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGroups/mycrp-prd-function-network-rg/providers/Microsoft.Network/routeTables/mycrp-prd-function-rt001"

0 commit comments

Comments
 (0)