Skip to content

Commit 7208bb5

Browse files
committed
feat: add container registry configuration
1 parent 66063a7 commit 7208bb5

File tree

2 files changed

+23
-18
lines changed

2 files changed

+23
-18
lines changed

main.tf

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,14 @@ resource "azurerm_linux_web_app" "this" {
8080
identity_ids = var.identity_ids
8181
}
8282
site_config {
83-
always_on = true
84-
ftps_state = "Disabled"
85-
http2_enabled = true
86-
websockets_enabled = var.websockets_enabled
87-
use_32_bit_worker = false
83+
always_on = var.site_config.always_on
84+
container_registry_managed_identity_client_id = var.site_config.container_registry_managed_identity_client_id
85+
container_registry_use_managed_identity = var.site_config.container_registry_use_managed_identity
86+
ftps_state = var.site_config.ftps_state
87+
http2_enabled = var.site_config.http2_enabled
88+
use_32_bit_worker = var.site_config.use_32_bit_worker
89+
websockets_enabled = var.site_config.websockets_enabled
90+
worker_count = var.site_config.worker_count
8891
dynamic "ip_restriction" {
8992
for_each = var.ip_restriction
9093
content {
@@ -125,7 +128,6 @@ resource "azurerm_linux_web_app" "this" {
125128
}
126129
}
127130
}
128-
worker_count = var.worker_count
129131
application_stack {
130132
docker_image = local.application_stack["docker_image"]
131133
docker_image_tag = local.application_stack["docker_image_tag"]

variables.tf

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,6 @@ variable "storage_account" {
165165
description = "BYOS storage mount configuration"
166166
}
167167

168-
variable "websockets_enabled" {
169-
type = bool
170-
description = "Enable websockets"
171-
default = false
172-
}
173-
174168
variable "enable_appinsights" {
175169
type = bool
176170
description = "Enable application insights"
@@ -201,12 +195,6 @@ variable "client_affinity_enabled" {
201195
default = false
202196
}
203197

204-
variable "worker_count" {
205-
type = number
206-
description = "Number of workers"
207-
default = null
208-
}
209-
210198
variable "key_vault" {
211199
description = "Configure Linux Function App to Key Vault"
212200
type = object({
@@ -217,3 +205,18 @@ variable "key_vault" {
217205
})
218206
default = {}
219207
}
208+
209+
variable "site_config" {
210+
type = object({
211+
always_on = optional(bool, true)
212+
ftps_state = optional(string, "Disabled")
213+
http2_enabled = optional(bool, true)
214+
websockets_enabled = optional(bool, false)
215+
use_32_bit_worker = optional(bool, false)
216+
container_registry_use_managed_identity = optional(bool, false)
217+
container_registry_managed_identity_client_id = optional(string, null)
218+
worker_count = optional(number, null)
219+
})
220+
default = {}
221+
description = "Site configuration"
222+
}

0 commit comments

Comments
 (0)