Skip to content

Commit

Permalink
add var to db module (#430)
Browse files Browse the repository at this point in the history
Co-authored-by: Administrator <[email protected]>
  • Loading branch information
derekadombek and Administrator authored Nov 26, 2024
1 parent e90afae commit 1f6bca9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions ops/terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ module "ocr_autoscale" {

module "database" {
source = "./modules/database"
env = local.environment
resource_group_name = data.azurerm_resource_group.rg.name
subnet = module.networking.dbsubnet_id
private_dns_zone_id = module.networking.private_dns_zone_id
Expand Down
2 changes: 1 addition & 1 deletion ops/terraform/modules/database/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# As a result we are using Azure Database for PostgreSQL Flexible Server
# with granular control, flexibility and better cost optimization.
resource "azurerm_postgresql_flexible_server" "postgres_flexible_server" {
name = "reportvisionpostgresql-flexible-server"
name = "reportvisionpostgresql-flexible-server-${var.env}"
location = var.location
resource_group_name = var.resource_group_name
sku_name = var.postgres_sku_name
Expand Down
5 changes: 5 additions & 0 deletions ops/terraform/modules/database/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,8 @@ variable "private_dns_zone_id" {
type = string
description = "Private DNS Zone for PostgreSQL Flexible Server"
}

variable "env" {
type = string
description = "Environment variable for the environment being provisioned"
}

0 comments on commit 1f6bca9

Please sign in to comment.