Skip to content

Commit

Permalink
feat: make rds datasets db engine configurable (#3024)
Browse files Browse the repository at this point in the history
  • Loading branch information
niross authored Feb 13, 2024
1 parent 3a0c421 commit 7a367a7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions infra/environment-template/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ module "jupyterhub" {
superset_admin_users = "REPLACE_ME"
superset_db_instance_class = "db.t3.medium"

datasets_rds_cluster_database_engine = "aurora-postgresql"
datasets_rds_cluster_backup_retention_period = 10
datasets_rds_cluster_database_name = "REPLACE_ME"
datasets_rds_cluster_master_username = "REPLACE_ME"
Expand Down
1 change: 1 addition & 0 deletions infra/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ variable superset_internal_domain {}
variable superset_dw_user_username {}
variable superset_dw_user_password {}

variable datasets_rds_cluster_database_engine {}
variable datasets_rds_cluster_backup_retention_period {}
variable datasets_rds_cluster_database_name {}
variable datasets_rds_cluster_master_username {}
Expand Down
6 changes: 3 additions & 3 deletions infra/rds_datasets.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ resource "aws_rds_cluster" "datasets" {
cluster_identifier = "${var.datasets_rds_cluster_cluster_identifier}"
database_name = "${var.datasets_rds_cluster_database_name}"
db_subnet_group_name = "${aws_db_subnet_group.datasets.name}"
engine = "aurora-postgresql"
engine = var.datasets_rds_cluster_database_engine
master_password = "${random_string.aws_rds_cluster_instance_datasets_password.result}"
master_username = "${var.datasets_rds_cluster_master_username}"
storage_encrypted = "${var.datasets_rds_cluster_storage_encryption_enabled}"
Expand All @@ -22,7 +22,7 @@ resource "aws_rds_cluster" "datasets" {
resource "aws_rds_cluster_instance" "datasets" {
cluster_identifier = "${aws_rds_cluster.datasets.cluster_identifier}"
db_subnet_group_name = "${aws_db_subnet_group.datasets.name}"
engine = "aurora-postgresql"
engine = var.datasets_rds_cluster_database_engine
identifier = "${var.datasets_rds_cluster_instance_identifier}"
instance_class = "${var.datasets_rds_cluster_instance_class}"
performance_insights_enabled = "${var.datasets_rds_cluster_instance_performance_insights_enabled}"
Expand Down Expand Up @@ -51,4 +51,4 @@ resource "random_string" "aws_rds_cluster_instance_datasets_password" {
lifecycle {
ignore_changes = all
}
}
}

0 comments on commit 7a367a7

Please sign in to comment.