Terraform scenarios to provision AWS RDS with 'DBSubnetGroupNotFound' scenarios despite correct subnet configuration
I'm working through a tutorial and I've been working on this all day and I'm trying to provision an AWS RDS instance using Terraform, but I'm working with an behavior: `DBSubnetGroupNotFound` during the apply phase... I've defined my subnet group in the following way: ```hcl resource "aws_db_subnet_group" "default" { name = "my-db-subnet-group" subnet_ids = [aws_subnet.public.id, aws_subnet.private.id] tags = { Name = "my-db-subnet-group" } } ``` The subnets are defined as: ```hcl resource "aws_subnet" "public" { vpc_id = aws_vpc.main.id cidr_block = "10.0.1.0/24" availability_zone = "us-west-2a" map_public_ip_on_launch = true tags = { Name = "PublicSubnet" } } resource "aws_subnet" "private" { vpc_id = aws_vpc.main.id cidr_block = "10.0.2.0/24" availability_zone = "us-west-2a" tags = { Name = "PrivateSubnet" } } ``` And hereβs how Iβm trying to create the RDS instance: ```hcl resource "aws_db_instance" "default" { allocated_storage = 20 engine = "mysql" engine_version = "8.0" instance_class = "db.t3.micro" name = "mydb" username = "admin" password = "P@ssw0rd123" db_subnet_group_name = aws_db_subnet_group.default.name vpc_security_group_ids = [aws_security_group.db_sg.id] multi_az = false tags = { Name = "my-db-instance" } } ``` I've double-checked the subnet IDs and the subnet group name in the RDS resource block, and they seem to be correct. When I run `terraform apply`, the behavior message states that the DB subnet group want to be found, even though it appears to be created successfully in the previous steps. Iβm using Terraform version 1.5.0. Is there a known scenario with this type of configuration, or am I possibly missing a dependency that isn't being correctly recognized during apply? I'm working on a API that needs to handle this. I've been using Hcl for about a year now. Is there a simpler solution I'm overlooking? Is there a simpler solution I'm overlooking? What am I doing wrong? Has anyone else encountered this?