Skip to content

Commit fc531df

Browse files
authored
Modify variables for container app jobs (#247)
1 parent c48e06a commit fc531df

File tree

3 files changed

+24
-7
lines changed

3 files changed

+24
-7
lines changed

infrastructure/modules/container-app-job/alerts.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ resource "azurerm_monitor_scheduled_query_rules_alert" "job_failure" {
33

44
name = "${azurerm_container_app_job.this.name}-containerjob-failure-alert"
55
location = var.location
6-
resource_group_name = var.resource_group_name
6+
resource_group_name = var.resource_group_name_monitoring != null ? var.resource_group_name_monitoring : var.resource_group_name
77

88
action {
99
action_group = [var.action_group_id]

infrastructure/modules/container-app-job/tfdocs.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@ Description: Docker image and tag. Format: <registry>/<repository>:<tag>
1616

1717
Type: `string`
1818

19-
### <a name="input_log_analytics_workspace_id"></a> [log\_analytics\_workspace\_id](#input\_log\_analytics\_workspace\_id)
20-
21-
Description: Log analytics workspace ID
22-
23-
Type: `string`
24-
2519
### <a name="input_name"></a> [name](#input\_name)
2620

2721
Description: Name of the container app. Limited to 32 characters
@@ -144,6 +138,14 @@ Type: `string`
144138

145139
Default: `"UK South"`
146140

141+
### <a name="input_log_analytics_workspace_id"></a> [log\_analytics\_workspace\_id](#input\_log\_analytics\_workspace\_id)
142+
143+
Description: Log analytics workspace ID
144+
145+
Type: `string`
146+
147+
Default: `null`
148+
147149
### <a name="input_memory"></a> [memory](#input\_memory)
148150

149151
Description: Memory allocated to the app (GiB). Also dictates the CPU allocation: CPU(%)=MEMORY(Gi)/2. Maximum: 4Gi
@@ -176,6 +178,14 @@ Type: `number`
176178

177179
Default: `300`
178180

181+
### <a name="input_resource_group_name_monitoring"></a> [resource\_group\_name\_monitoring](#input\_resource\_group\_name\_monitoring)
182+
183+
Description: The name of the resource group in which to create the Monitoring resources for the Container App Job if the default group is not used. Changing this forces a new resource to be created.
184+
185+
Type: `string`
186+
187+
Default: `null`
188+
179189
### <a name="input_secret_variables"></a> [secret\_variables](#input\_secret\_variables)
180190

181191
Description: Secret environment variables to pass to the container app.

infrastructure/modules/container-app-job/variables.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ variable "resource_group_name" {
88
type = string
99
}
1010

11+
variable "resource_group_name_monitoring" {
12+
type = string
13+
description = "The name of the resource group in which to create the Monitoring resources for the Container App Job if the default group is not used. Changing this forces a new resource to be created."
14+
default = null
15+
}
16+
1117
variable "app_key_vault_id" {
1218
description = "ID of the key vault to store app secrets. Each secret is mapped to an environment variable. Required when fetch_secrets_from_app_key_vault is true."
1319
type = string
@@ -140,6 +146,7 @@ variable "action_group_id" {
140146
variable "log_analytics_workspace_id" {
141147
description = "Log analytics workspace ID"
142148
type = string
149+
default = null
143150
}
144151

145152
variable "alert_frequency" {

0 commit comments

Comments
 (0)