diff --git a/examples/complete/main.tf b/examples/complete/main.tf index 0e65a24..2cec762 100644 --- a/examples/complete/main.tf +++ b/examples/complete/main.tf @@ -10,6 +10,8 @@ locals { instance_class = "db.t4g.micro" storage_type = "gp3" cluster_name = "" + replica_count = 1 + replica_enable = false current_identity = data.aws_caller_identity.current.arn allowed_security_groups = ["sg-xxxxxxxxxxxxxx"] custom_user_password = "" diff --git a/examples/complete/output.tf b/examples/complete/output.tf index f7ef643..e6fd035 100644 --- a/examples/complete/output.tf +++ b/examples/complete/output.tf @@ -12,6 +12,11 @@ output "instance_name" { value = module.rds-pg.db_instance_name } +output "db_name" { + description = "Database name" + value = module.rds-pg.db_name +} + output "rds-mysql_replica_db_instance_name" { description = "The name of the database instance" value = module.rds-pg.replica_db_instance_name diff --git a/modules/db-backup-restore/main.tf b/modules/db-backup-restore/main.tf index 60c0f71..ebf3fcd 100644 --- a/modules/db-backup-restore/main.tf +++ b/modules/db-backup-restore/main.tf @@ -14,7 +14,7 @@ resource "helm_release" "postgresdb_backup" { timeout = 600 namespace = var.namespace values = [ - templatefile("../../helm/values/backup/values.yaml", { + templatefile("${path.module}/../../helm/values/backup/values.yaml", { bucket_uri = var.postgresdb_backup_config.bucket_uri, postgres_database_name = var.postgresdb_backup_config.postgres_database_name, db_endpoint = var.postgresdb_backup_config.db_endpoint, @@ -37,7 +37,7 @@ resource "helm_release" "postgresdb_restore" { timeout = 600 namespace = var.namespace values = [ - templatefile("../../helm/values/restore/values.yaml", { + templatefile("${path.module}/../../helm/values/restore/values.yaml", { bucket_uri = var.postgresdb_restore_config.bucket_uri, db_endpoint = var.postgresdb_restore_config.db_endpoint, db_password = var.postgresdb_restore_config.db_password, @@ -46,4 +46,4 @@ resource "helm_release" "postgresdb_restore" { annotations = var.bucket_provider_type == "s3" ? "eks.amazonaws.com/role-arn: ${aws_iam_role.postgres_restore_role.arn}" : "iam.gke.io/gcp-service-account: ${var.service_account_restore}" }) ] -} +} diff --git a/outputs.tf b/outputs.tf index eefb182..dd0df87 100644 --- a/outputs.tf +++ b/outputs.tf @@ -23,6 +23,11 @@ output "db_instance_username" { value = nonsensitive(module.db.db_instance_username) } +output "db_name" { + description = "The database name used in the RDS module" + value = var.db_name +} + output "db_instance_password" { description = "Password for accessing the database." value = var.custom_user_password != "" ? var.custom_user_password : nonsensitive(random_password.master[0].result)