Skip to content

Commit

Permalink
fix: change coalesce function to try
Browse files Browse the repository at this point in the history
  • Loading branch information
JianLi-Expedia committed Sep 11, 2024
1 parent d4d32e4 commit 334aca3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion k8s-readonly.tf
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ resource "kubernetes_deployment_v1" "apiary_hms_readonly" {

env {
name = "MYSQL_HOST"
value = var.external_database_host == "" ? join("", aws_rds_cluster.apiary_cluster.*.endpoint) : coalesce(var.external_database_host_readonly,var.external_database_host)
value = var.external_database_host == "" ? join("", aws_rds_cluster.apiary_cluster.*.endpoint) : try(var.external_database_host_readonly,var.external_database_host)
}

env {
Expand Down
2 changes: 1 addition & 1 deletion templates.tf
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ locals{
})

hms_readonly_template = templatefile("${path.module}/templates/apiary-hms-readonly.json", {
mysql_db_host = "${var.external_database_host == "" ? join("", aws_rds_cluster.apiary_cluster.*.reader_endpoint) : coalesce(var.external_database_host_readonly,var.external_database_host)}"
mysql_db_host = "${var.external_database_host == "" ? join("", aws_rds_cluster.apiary_cluster.*.reader_endpoint) : try(var.external_database_host_readonly,var.external_database_host)}"
mysql_db_name = "${var.apiary_database_name}"
mysql_secret_arn = "${data.aws_secretsmanager_secret.db_ro_user.arn}"
hive_metastore_access_mode = "readonly"
Expand Down

0 comments on commit 334aca3

Please sign in to comment.