You can use the one-click cloud migration feature of RDS PostgreSQL to migrate a self-managed PostgreSQL database from an ECS instance to an RDS PostgreSQL instance. This topic describes how to configure the security group for the self-managed PostgreSQL database to allow the RDS PostgreSQL instance to access the database port.
Prerequisites
The ECS instance that hosts your self-managed PostgreSQL database must meet the following requirements:
The ECS instance and the RDS PostgreSQL instance are in the same VPC.
A PostgreSQL database is deployed on the ECS instance.
Procedure
Log on to the ECS console.
In the navigation pane on the left, choose .
In the top navigation bar, select a region.
Find the target ECS instance and click its instance ID.
On the Security Groups tab, click the ID of the security group.
On the Security Group Details page, go to the Rules section. On the Inbound tab, click the Add Rule button to add the rules described in the following table.
The following table describes the protocols and key parameters for the rules to add.
Protocol
Destination (This Instance)
Source
All ICMP
No configuration is required. The default is All(
-1/-1).Set this parameter to the VPC CIDR Block of the RDS PostgreSQL instance.
Custom TCP
Set this parameter to the port of the self-managed PostgreSQL database on the ECS instance. You can run the
netstat -a | grep PGSQLcommand to view the port.
