0

I'm setting up logical replication between Cloud SQL Postgres (as a replica) and AWS RDS Postgres (source). I'm using guideline provided by GCP -> https://cloud.google.com/sql/docs/postgres/replication/configure-replication-from-external.

I was creating a source representation instance using request:

curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
 --header 'Content-Type: application/json' \
 --data @./source.json \
 -X POST \
 https://sqladmin.googleapis.com/sql/v1beta4/projects/${project_id}/instances

where source.json looks like this:

{
  "name": "aws-boa-source",
  "region": "us-east4",
  "databaseVersion": "POSTGRES_14",
  "onPremisesConfiguration": {
    "hostPort": "{aws_rds_endpoint}:{aws_rds_port}",
    "username": "test",
    "password": "test!"
  }
}

Also, I'm creating a CloudSQL Postgres replica using such request:

curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
 --header 'Content-Type: application/json' \
 --data '{"settings":{"tier":"db-custom-2-7680","dataDiskSizeGb":"100","ipConfiguration":{"privateNetwork":"projects/${project_id}/global/networks/${network}"},"availabilityType":"ZONAL"},"masterInstanceName":"aws-boa-source","region":"us-east4","databaseVersion":"POSTGRES_14","name":"aws-boa-replica"}' \
 -X POST \
 https://sqladmin.googleapis.com/sql/v1beta4/projects/${project_id}/instances

When I'm checking whether the setup is configured properly using this request:

curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
 --header 'Content-Type: application/json' \
 --data '{
     "syncMode": "EXTERNAL_SYNC_MODE_UNSPECIFIED"
   }' \
 -X POST \
 https://sqladmin.googleapis.com/sql/v1beta4/projects/${project_id}/instances/aws-boa-source/verifyExternalSyncSettings

I'm receiving such error:

{
  "error": {
    "code": 500,
    "message": "Internal error encountered.",
    "errors": [
      {
        "message": "Internal error encountered.",
        "domain": "global",
        "reason": "backendError"
      }
    ],
    "status": "INTERNAL"
  }
}

Additionally, my AWS RDS Postgres instance is publicly accessible and I'm able to connect to to it from my local PC.

What is more curious, I was able to set up replication once using the same configuration. But then I destroyed the whole infrastructure and I wanted to setup it again. Now I'm encountered such problems.

Does anybody know why I'm receiving such error?

Dharmaraj
  • 47,845
  • 8
  • 52
  • 84
Olsson
  • 25
  • 1
  • 4

1 Answers1

0

Ok, I've solved my problem. I was placing in the request source representation instance name instead of the name of cloud sql replica.

Olsson
  • 25
  • 1
  • 4