Skip to content

Commit

Permalink
feat(terraform): define variable-driven IP address restrictions
Browse files Browse the repository at this point in the history
  • Loading branch information
angela-tran committed Nov 7, 2022
1 parent 4909393 commit 749f6ca
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion terraform/app_service.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ resource "azurerm_linux_web_app" "main" {
https_only = true

site_config {
ftps_state = "Disabled"
ftps_state = "Disabled"
dynamic "ip_restriction" {
for_each = var.IP_ADDRESS_WHITELIST
content {
ip_address = ip_restriction.value
}
}
vnet_route_all_enabled = true
application_stack {
docker_image = "ghcr.io/cal-itp/eligibility-server"
Expand Down
4 changes: 4 additions & 0 deletions terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@
variable "VELOCITY_ETL_SERVICE_PRINCIPAL_ID" {
description = "Object ID from the registered application for the Velocity server ETL uploading: https://cloudsight.zendesk.com/hc/en-us/articles/360016785598-Azure-finding-your-service-principal-object-ID"
}
variable "IP_ADDRESS_WHITELIST" {
description = "List of IP addresses allowed to connect to the app service."
type = list(any)
}

0 comments on commit 749f6ca

Please sign in to comment.