Terraform 1.4.3: Unable to Set Up Multi-Region AWS RDS Instances with Cross-Region Replication
I'm converting an old project and After trying multiple solutions online, I still can't figure this out... I'm trying to set up multi-region AWS RDS instances using Terraform, specifically version 1.4.3, and I'm running into an issue with cross-region replication. My goal is to create a primary RDS instance in the us-east-1 region and a read replica in the eu-west-1 region. I thought I had everything configured correctly, but when I apply the plan, I get the following error: ``` Error: InvalidParameterCombination: The source DB instance must be in "available" state. on main.tf line 22, in resource "aws_db_instance" "read_replica": 22: resource "aws_db_instance" "read_replica" { ``` I've confirmed that the primary DB instance is indeed in the "available" state prior to applying. Here's a snippet of my Terraform configuration: ```hcl provider "aws" { region = "us-east-1" } resource "aws_db_instance" "primary" { allocated_storage = 20 engine = "mysql" engine_version = "8.0" instance_class = "db.t3.micro" identifier = "primary-db-instance" username = "admin" password = "password123" db_name = "mydb" skip_final_snapshot = true } provider "aws" { alias = "eu" region = "eu-west-1" } resource "aws_db_instance" "read_replica" { depends_on = [aws_db_instance.primary] identifier = "read-replica-db-instance" instance_class = "db.t3.micro" engine = aws_db_instance.primary.engine source_db_instance_identifier = aws_db_instance.primary.id skip_final_snapshot = true } ``` I've tried adding a `depends_on` block to ensure that the primary instance is fully created before the read replica is attempted, but it hasn’t resolved the issue. I also double-checked the configuration syntax and AWS documentation for any missed parameters. Is there something I'm overlooking related to the instance state or the timing of the resource creation? Any help would be appreciated! For context: I'm using Hcl on Windows. Any ideas what could be causing this? Any suggestions would be helpful.