Skip to content

Commit fb370ba

Browse files
authored
Merge pull request #36 from datafold/gerard-eng-2004-migrate-postgres-to-17x
fix: Add database edition
2 parents 01bf142 + be2a6e4 commit fb370ba

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ module "database" {
7373
database_name = var.database_name
7474
postgres_ro_username = var.postgres_ro_username
7575
database_version = var.database_version
76+
database_edition = var.database_edition
7677
common_tags = var.common_tags
7778

7879
depends_on = [module.project_factory_project_services]

modules/database/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module "db" {
1919

2020
database_version = var.database_version
2121
db_name = var.database_name
22+
edition = var.database_edition
2223
tier = var.postgres_instance
2324
disk_size = var.postgres_allocated_storage
2425
user_name = var.postgres_username

modules/database/variables.tf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,17 @@ variable "database_version" {
7878
description = "Version of the database"
7979
}
8080

81+
variable "database_edition" {
82+
type = string
83+
default = null # Auto determined by module or API
84+
description = "The edition of the database (ENTERPRISE or ENTERPRISE_PLUS). If null, automatically determined based on version."
85+
86+
validation {
87+
condition = var.database_edition == null ? true : contains(["ENTERPRISE", "ENTERPRISE_PLUS"], var.database_edition)
88+
error_message = "database_edition must be either ENTERPRISE or ENTERPRISE_PLUS."
89+
}
90+
}
91+
8192
variable "common_tags" {
8293
type = map(string)
8394
}

variables.tf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,17 @@ variable "database_version" {
361361
description = "Version of the database"
362362
}
363363

364+
variable "database_edition" {
365+
type = string
366+
default = null # Auto determined by module or API
367+
description = "The edition of the database (ENTERPRISE or ENTERPRISE_PLUS). If null, automatically determined based on version."
368+
369+
validation {
370+
condition = var.database_edition == null ? true : contains(["ENTERPRISE", "ENTERPRISE_PLUS"], var.database_edition)
371+
error_message = "database_edition must be either ENTERPRISE or ENTERPRISE_PLUS."
372+
}
373+
}
374+
364375
# ┏━╸╻ ╻┏━╸╻┏ ╻ ╻┏━┓╻ ╻┏━┓┏━╸
365376
# ┃ ┃ ┃┃ ┣┻┓┣━┫┃ ┃┃ ┃┗━┓┣╸
366377
# ┗━╸┗━╸╹┗━╸╹ ╹╹ ╹┗━┛┗━┛┗━┛┗━╸

0 commit comments

Comments
 (0)