I’m trying to create a AWS RDS proxy via terraform for an aurora psgres database. all is good except section below fails when it tries to add the db to target group. I already checked and db id is correct. I even hard coded the cluster id in the code but still getting below error message. any help will be appreciated.
#assing aurora db to target group
resource “aws_db_proxy_target” “proxy_target” {
db_instance_identifier = module.aurora_psql.cluster_id
db_proxy_name = aws_db_proxy.aurora_proxy.name
target_group_name = aws_db_proxy_default_target_group.default_target.name
}
error:
aws_db_proxy_target.proxy_target: Creating…
╷
│ Error: error registering RDS DB Proxy (dssandbox-proxy/default) Target: DBInstanceNotFound: Requested resource not found - Instance: dssandbox-aurora-postgres
│ status code: 404, request id: eeaa62d4-7433-485c-b76c-f56027021cbb
│
│ with aws_db_proxy_target.proxy_target,
│ on rds_proxy.tf line 128, in resource “aws_db_proxy_target” “proxy_target”:
│ 128: resource “aws_db_proxy_target” “proxy_target” {