From 7a367a7e4d847c33924fe79f3d239903f35cd8fe Mon Sep 17 00:00:00 2001 From: Nick Ross Date: Tue, 13 Feb 2024 13:28:24 +0000 Subject: [PATCH] feat: make rds datasets db engine configurable (#3024) --- infra/environment-template/main.tf | 1 + infra/main.tf | 1 + infra/rds_datasets.tf | 6 +++--- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/infra/environment-template/main.tf b/infra/environment-template/main.tf index 5a912df6f6..a853b30aa3 100644 --- a/infra/environment-template/main.tf +++ b/infra/environment-template/main.tf @@ -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" diff --git a/infra/main.tf b/infra/main.tf index 0b369f6c43..094b0b7bd6 100644 --- a/infra/main.tf +++ b/infra/main.tf @@ -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 {} diff --git a/infra/rds_datasets.tf b/infra/rds_datasets.tf index 2f7c02cb05..78fa8332ef 100644 --- a/infra/rds_datasets.tf +++ b/infra/rds_datasets.tf @@ -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}" @@ -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}" @@ -51,4 +51,4 @@ resource "random_string" "aws_rds_cluster_instance_datasets_password" { lifecycle { ignore_changes = all } -} \ No newline at end of file +}