Skip to content

Commit

Permalink
Merge pull request #253 from hashicorp/hbaig/postgresql-public-networ…
Browse files Browse the repository at this point in the history
…k-access

Re-enabling `public_network_access_enabled` flag to stop azure postgres errors
  • Loading branch information
sandrampeter authored Jul 19, 2024
2 parents e66b2a0 + f6f0e71 commit 528e3f1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
28 changes: 14 additions & 14 deletions modules/database/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ resource "random_string" "tfe_pg_password" {
}

resource "azurerm_postgresql_flexible_server" "tfe" {
location = var.location
name = "${var.friendly_name_prefix}-pg"
resource_group_name = var.resource_group_name

administrator_login = var.database_user
administrator_password = random_string.tfe_pg_password.result
backup_retention_days = var.database_backup_retention_days
delegated_subnet_id = var.database_subnet_id
private_dns_zone_id = var.database_private_dns_zone_id
sku_name = var.database_machine_type
storage_mb = var.database_size_mb
tags = var.tags
version = var.database_version
zone = var.database_availability_zone
location = var.location
name = "${var.friendly_name_prefix}-pg"
resource_group_name = var.resource_group_name
public_network_access_enabled = var.public_network_access_enabled
administrator_login = var.database_user
administrator_password = random_string.tfe_pg_password.result
backup_retention_days = var.database_backup_retention_days
delegated_subnet_id = var.database_subnet_id
private_dns_zone_id = var.database_private_dns_zone_id
sku_name = var.database_machine_type
storage_mb = var.database_size_mb
tags = var.tags
version = var.database_version
zone = var.database_availability_zone
}

resource "azurerm_postgresql_flexible_server_configuration" "tfe" {
Expand Down
6 changes: 6 additions & 0 deletions modules/database/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ variable "database_size_mb" {
description = "Postgres storage size in MB"
}

variable "public_network_access_enabled" {
default = "false"
type = string
description = "Public network access with virtual network interface"
}

variable "database_version" {
type = string
description = "Postgres version"
Expand Down

0 comments on commit 528e3f1

Please sign in to comment.