diff --git a/rds.tf b/rds.tf index dabbe32..3bc44f9 100644 --- a/rds.tf +++ b/rds.tf @@ -125,7 +125,7 @@ resource "aws_db_instance" "rds_replica" { storage_type = var.storage_type parameter_group_name = var.create_db_parameter_group == true ? aws_db_parameter_group.rds_custom_db_pg[count.index].name : "" skip_final_snapshot = var.skip_final_snapshot - replicate_source_db = aws_db_instance.rds_db[0].arn + replicate_source_db = length(aws_db_instance.rds_db) > 0 ? aws_db_instance.rds_db[0].arn : null vpc_security_group_ids = [aws_security_group.rds_db_replica.id] storage_encrypted = var.storage_encrypted db_subnet_group_name = try(var.db_subnet_group_replica_id, null)