Skip to content

Commit

Permalink
fix conditions on postgresql_replicate_source_db var
Browse files Browse the repository at this point in the history
  • Loading branch information
bennsimon committed May 16, 2024
1 parent 5780967 commit e9b96e1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion network.tf
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,5 @@ resource "aws_route53_record" "main" {
type = "CNAME"
allow_overwrite = var.allow_dns_record_overwrite
ttl = "300"
records = [length(var.postgresql_source_snapshot_identifier) == 0 ? (length(var.postgresql_replicate_source_db) == 0 ? aws_db_instance.blank-database[0].address : aws_db_instance.replica-database[0].address) : aws_db_instance.from-snapshot[0].address]
records = [length(var.postgresql_source_snapshot_identifier) == 0 ? (var.postgresql_replicate_source_db == null ? aws_db_instance.blank-database[0].address : aws_db_instance.replica-database[0].address) : aws_db_instance.from-snapshot[0].address]
}
2 changes: 1 addition & 1 deletion storage.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ resource "aws_db_instance" "blank-database" {
final_snapshot_identifier = var.postgresql_name
backup_retention_period = var.postgresql_backup_retention_period
backup_window = var.postgresql_backup_window
replicate_source_db = length(var.postgresql_source_snapshot_identifier) == 0 && var.postgresql_replicate_source_db == null ? var.postgresql_replicate_source_db : null
replicate_source_db = length(var.postgresql_source_snapshot_identifier) == 0 && var.postgresql_replicate_source_db != null ? var.postgresql_replicate_source_db : null
publicly_accessible = var.postgresql_publicly_accessible
performance_insights_enabled = var.postgresql_performance_insights_enabled
enabled_cloudwatch_logs_exports = ["postgresql"]
Expand Down

0 comments on commit e9b96e1

Please sign in to comment.