Skip to content

Commit d160145

Browse files
authored
Merge pull request #19 from data-platform-hq/protected-registry
feat: private registry config
2 parents 66063a7 + b7b44f2 commit d160145

File tree

3 files changed

+25
-21
lines changed

3 files changed

+25
-21
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Terraform module for creation Azure Linux Web App
99
| Name | Version |
1010
|------|---------|
1111
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0.0 |
12-
| <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) | >= 3.40.0 |
12+
| <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) | >= 3.49.0 |
1313

1414
## Providers
1515

@@ -55,12 +55,11 @@ No modules.
5555
| <a name="input_resource_group"></a> [resource\_group](#input\_resource\_group) | Resource group name | `string` | n/a | yes |
5656
| <a name="input_scm_ip_restriction"></a> [scm\_ip\_restriction](#input\_scm\_ip\_restriction) | Firewall settings for the function app | <pre>list(object({<br> name = string<br> ip_address = optional(string, null)<br> service_tag = optional(string, null)<br> virtual_network_subnet_id = optional(string, null)<br> priority = optional(string, "100")<br> action = string<br> headers = optional(list(object({<br> x_azure_fdid = optional(list(string), null)<br> x_fd_health_probe = optional(list(string), null)<br> x_forwarded_for = optional(list(string), null)<br> x_forwarded_host = optional(list(string), null)<br> })), [])<br> }))</pre> | <pre>[<br> {<br> "action": "Allow",<br> "name": "allow_azure",<br> "service_tag": "AzureCloud"<br> }<br>]</pre> | no |
5757
| <a name="input_service_plan_id"></a> [service\_plan\_id](#input\_service\_plan\_id) | App Service plan ID | `string` | n/a | yes |
58+
| <a name="input_site_config"></a> [site\_config](#input\_site\_config) | Site configuration | <pre>object({<br> always_on = optional(bool, true)<br> ftps_state = optional(string, "Disabled")<br> http2_enabled = optional(bool, true)<br> websockets_enabled = optional(bool, false)<br> use_32_bit_worker = optional(bool, false)<br> container_registry_use_managed_identity = optional(bool, false)<br> container_registry_managed_identity_client_id = optional(string, null)<br> worker_count = optional(number, null)<br> })</pre> | `{}` | no |
5859
| <a name="input_storage_account"></a> [storage\_account](#input\_storage\_account) | BYOS storage mount configuration | <pre>list(object({<br> access_key = string<br> account_name = string<br> name = string<br> share_name = string<br> type = string<br> mount_path = string<br> }))</pre> | `[]` | no |
5960
| <a name="input_subnet_id"></a> [subnet\_id](#input\_subnet\_id) | Subnet ID for the web app | `string` | `null` | no |
6061
| <a name="input_tags"></a> [tags](#input\_tags) | Tags | `map(string)` | n/a | yes |
6162
| <a name="input_use_private_net"></a> [use\_private\_net](#input\_use\_private\_net) | Use private network injection | `bool` | `false` | no |
62-
| <a name="input_websockets_enabled"></a> [websockets\_enabled](#input\_websockets\_enabled) | Enable websockets | `bool` | `false` | no |
63-
| <a name="input_worker_count"></a> [worker\_count](#input\_worker\_count) | Number of workers | `number` | `null` | no |
6463

6564
## Outputs
6665

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)