Skip to content

Commit

Permalink
Merge pull request #176 from ministryofjustice/replica-fix
Browse files Browse the repository at this point in the history
chore: 🤖 fix conditional check for replica db name and engine version
  • Loading branch information
sj-williams authored Aug 30, 2024
2 parents a94f778 + 20481ff commit 11ec178
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ resource "aws_db_instance" "rds" {
max_allocated_storage = var.db_max_allocated_storage
apply_immediately = true
engine = var.replicate_source_db == null ? var.db_engine : null
engine_version = var.replicate_source_db == null ? var.db_engine_version : null
engine_version = var.db_engine_version
instance_class = var.db_instance_class
db_name = can(regex("sqlserver", var.db_engine)) ? null : local.db_name
db_name = var.replicate_source_db != null || can(regex("sqlserver", var.db_engine)) ? null : local.db_name
username = var.replicate_source_db != null ? null : sensitive("cp${random_string.username.result}")
password = var.replicate_source_db != null ? null : random_password.password.result
backup_retention_period = var.db_backup_retention_period
Expand Down

0 comments on commit 11ec178

Please sign in to comment.