Skip to content

Commit

Permalink
feat: Added support for server custom name (#50)
Browse files Browse the repository at this point in the history
Co-authored-by: Vishal Sharma <[email protected]>
  • Loading branch information
NotMaharshi and vjdbj authored Oct 15, 2024
1 parent 6c3e193 commit 21dfaa3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ module "labels" {
##-----------------------------------------------------------------------------
resource "azurerm_postgresql_flexible_server" "main" {
count = var.enabled ? 1 : 0
name = format("%s-pgsql-flexible-server", module.labels.id)
name = var.server_custom_name != null ? var.server_custom_name : format("%s-pgsql-flexible-server", module.labels.id)
resource_group_name = local.resource_group_name
location = local.location
administrator_login = var.admin_username
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ variable "name" {
description = "Name (e.g. `app` or `cluster`)."
}

variable "server_custom_name" {
description = "User defined name for the PostgreSQL flexible server"
type = string
default = null
}

variable "environment" {
type = string
default = ""
Expand Down

0 comments on commit 21dfaa3

Please sign in to comment.