Skip to content

Commit fe50928

Browse files
authored
Merge pull request #8 from data-platform-hq/extend-fw
feat: separate scm_ip_restriction
2 parents d2e8e0e + 1133447 commit fe50928

File tree

3 files changed

+27
-7
lines changed

3 files changed

+27
-7
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,16 @@ No modules.
3939
| <a name="input_enable_appinsights"></a> [enable\_appinsights](#input\_enable\_appinsights) | Enable application insights | `bool` | `true` | no |
4040
| <a name="input_env"></a> [env](#input\_env) | Environment | `string` | n/a | yes |
4141
| <a name="input_identity_ids"></a> [identity\_ids](#input\_identity\_ids) | List of user assigned identity IDs | `list(string)` | `null` | no |
42-
| <a name="input_ip_restriction"></a> [ip\_restriction](#input\_ip\_restriction) | Firewall settings for the function app | <pre>list(object({<br> name = string<br> ip_address = string<br> service_tag = string<br> virtual_network_subnet_id = string<br> priority = string<br> action = string<br> headers = list(object({<br> x_azure_fdid = list(string)<br> x_fd_health_probe = list(string)<br> x_forwarded_for = list(string)<br> x_forwarded_host = list(string)<br> }))<br> }))</pre> | <pre>[<br> {<br> "action": "Allow",<br> "headers": null,<br> "ip_address": null,<br> "name": "allow_azure",<br> "priority": "100",<br> "service_tag": "AzureCloud",<br> "virtual_network_subnet_id": null<br> }<br>]</pre> | no |
42+
| <a name="input_ip_restriction"></a> [ip\_restriction](#input\_ip\_restriction) | Firewall settings for the web app | <pre>list(object({<br> name = string<br> ip_address = string<br> service_tag = string<br> virtual_network_subnet_id = string<br> priority = string<br> action = string<br> headers = list(object({<br> x_azure_fdid = list(string)<br> x_fd_health_probe = list(string)<br> x_forwarded_for = list(string)<br> x_forwarded_host = list(string)<br> }))<br> }))</pre> | <pre>[<br> {<br> "action": "Allow",<br> "headers": null,<br> "ip_address": null,<br> "name": "allow_azure",<br> "priority": "100",<br> "service_tag": "AzureCloud",<br> "virtual_network_subnet_id": null<br> }<br>]</pre> | no |
4343
| <a name="input_location"></a> [location](#input\_location) | Location | `string` | n/a | yes |
4444
| <a name="input_logs"></a> [logs](#input\_logs) | Logs configuration | <pre>object({<br> detailed_error_messages = bool<br> failed_request_tracing = bool<br> http_logs = object({<br> file_system = object({<br> retention_in_days = number<br> retention_in_mb = number<br> })<br> })<br> })</pre> | <pre>{<br> "detailed_error_messages": false,<br> "failed_request_tracing": false,<br> "http_logs": {<br> "file_system": {<br> "retention_in_days": 7,<br> "retention_in_mb": 35<br> }<br> }<br>}</pre> | no |
45-
| <a name="input_name"></a> [name](#input\_name) | Function index/name (like 007) | `string` | n/a | yes |
45+
| <a name="input_name"></a> [name](#input\_name) | Web index/name (like 007) | `string` | n/a | yes |
4646
| <a name="input_project"></a> [project](#input\_project) | Project name | `string` | n/a | yes |
4747
| <a name="input_resource_group"></a> [resource\_group](#input\_resource\_group) | Resource group name | `string` | n/a | yes |
48+
| <a name="input_scm_ip_restriction"></a> [scm\_ip\_restriction](#input\_scm\_ip\_restriction) | Firewall settings for the SCM web app | <pre>list(object({<br> name = string<br> ip_address = string<br> service_tag = string<br> virtual_network_subnet_id = string<br> priority = string<br> action = string<br> headers = list(object({<br> x_azure_fdid = list(string)<br> x_fd_health_probe = list(string)<br> x_forwarded_for = list(string)<br> x_forwarded_host = list(string)<br> }))<br> }))</pre> | `null` | no |
4849
| <a name="input_service_plan_id"></a> [service\_plan\_id](#input\_service\_plan\_id) | App Service plan ID | `string` | n/a | yes |
4950
| <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 |
50-
| <a name="input_subnet_id"></a> [subnet\_id](#input\_subnet\_id) | Subnet ID for the function app | `string` | `null` | no |
51+
| <a name="input_subnet_id"></a> [subnet\_id](#input\_subnet\_id) | Subnet ID for the web app | `string` | `null` | no |
5152
| <a name="input_tags"></a> [tags](#input\_tags) | Tags | `map(string)` | n/a | yes |
5253
| <a name="input_use_private_net"></a> [use\_private\_net](#input\_use\_private\_net) | Use private network injection | `bool` | `false` | no |
5354
| <a name="input_websockets_enabled"></a> [websockets\_enabled](#input\_websockets\_enabled) | Enable websockets | `bool` | `false` | no |

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ resource "azurerm_linux_web_app" "this" {
5353
websockets_enabled = var.websockets_enabled
5454
use_32_bit_worker = false
5555
ip_restriction = var.ip_restriction
56-
scm_ip_restriction = var.ip_restriction
56+
scm_ip_restriction = var.scm_ip_restriction == null ? var.ip_restriction : var.scm_ip_restriction
5757
application_stack {
5858
docker_image = local.application_stack["docker_image"]
5959
docker_image_tag = local.application_stack["docker_image_tag"]

variables.tf

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ variable "service_plan_id" {
3131

3232
variable "name" {
3333
type = string
34-
description = "Function index/name (like 007)"
34+
description = "Web index/name (like 007)"
3535
}
3636

3737
variable "application_type" {
@@ -41,7 +41,7 @@ variable "application_type" {
4141
}
4242

4343
variable "ip_restriction" {
44-
description = "Firewall settings for the function app"
44+
description = "Firewall settings for the web app"
4545
type = list(object({
4646
name = string
4747
ip_address = string
@@ -69,6 +69,25 @@ variable "ip_restriction" {
6969
]
7070
}
7171

72+
variable "scm_ip_restriction" {
73+
description = "Firewall settings for the SCM web app"
74+
type = list(object({
75+
name = string
76+
ip_address = string
77+
service_tag = string
78+
virtual_network_subnet_id = string
79+
priority = string
80+
action = string
81+
headers = list(object({
82+
x_azure_fdid = list(string)
83+
x_fd_health_probe = list(string)
84+
x_forwarded_for = list(string)
85+
x_forwarded_host = list(string)
86+
}))
87+
}))
88+
default = null
89+
}
90+
7291
variable "app_settings" {
7392
type = map(string)
7493
default = {}
@@ -77,7 +96,7 @@ variable "app_settings" {
7796

7897
variable "subnet_id" {
7998
type = string
80-
description = "Subnet ID for the function app"
99+
description = "Subnet ID for the web app"
81100
default = null
82101
}
83102

0 commit comments

Comments
 (0)