Skip to content

Commit

Permalink
update networking to include azurerm_postgresql_flexible_server_firew…
Browse files Browse the repository at this point in the history
…all_rule for app_service
  • Loading branch information
marycrawford committed Dec 12, 2024
1 parent c9b568f commit 8af1587
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions ops/terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ module "networking" {

# The DNS zone and DNS link are managed inside the networking module.
postgres_server_id = module.database.postgres_server_id

}

module "securitygroup" {
Expand Down Expand Up @@ -73,6 +74,7 @@ module "middleware_api" {

app_settings = {
WEBSITES_PORT = "8081"
POSTGRES_PORT = "5432"
POSTGRES_HOST = module.database.postgres_fqdn
POSTGRES_DB = module.database.postgres_db_name
POSTGRES_USER = module.database.postgres_user
Expand Down
8 changes: 8 additions & 0 deletions ops/terraform/modules/network/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,11 @@ resource "azurerm_private_dns_zone_virtual_network_link" "dns_link" {
virtual_network_id = azurerm_virtual_network.vnet.id
depends_on = [var.postgres_server_id]
}

resource "azurerm_postgresql_flexible_server_firewall_rule" "app_service_firewall_rule" {
name = "allow-app-service"
server_id = var.postgres_server_id
start_ip_address = cidrhost(var.middlewaresubnetcidr, 0) # CIDR block start
end_ip_address = cidrhost(var.middlewaresubnetcidr, 255) # CIDR block end
}

2 changes: 0 additions & 2 deletions ops/terraform/modules/network/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,3 @@ variable "location" {

variable "postgres_server_id" {
}

# variable "postgres_fs_server" {}

0 comments on commit 8af1587

Please sign in to comment.