Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terraform: define variable-driven IP address restrictions #181

Merged
merged 2 commits into from
Nov 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fancy!

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(string)
}