Help Center > > Getting Started> Getting Started with RDS for PostgreSQL> Connecting to a DB Instance Through a Private Network> Overview


Updated at: May 26, 2020 GMT+08:00

This section describes how to buy a PostgreSQL DB instance on the management console and connect to the DB instance through an ECS.

If you are using RDS for the first time, see the constraints described in section PostgreSQL Constraints.


Figure 1 illustrates the process of connecting to a PostgreSQL DB instance through a private network.

Figure 1 Connecting to a DB instance through a private network
  • Step 1: Buy a DB instance. Confirm the specifications, storage, network, and database account configurations of the PostgreSQL DB instances based on service requirements.
  • Step 2: Configure security group rules.
    • If the ECS and RDS DB instance are in the same security group, they can communicate with each other by default. No security group rule needs to be configured. Go to Step 3: Connect to a DB Instance Through psql.
    • If the ECS and RDS DB instance are in different security groups, you need to configure security group rules for them, separately.
      • RDS DB instance: Configure an inbound rule for the security group with which the RDS DB instance is associated.
      • ECS: The default security group rule allows all outgoing data packets. In this case, you do not need to configure a security rule for the ECS. If not all outbound traffic is allowed in the security group, you need to configure an outbound rule for the ECS.
  • Step 3: Connect to a DB instance through a private network. You can connect to a DB instance through a common connection or an SSL connection. The SSL connection encrypts data and is more secure. The CLI tool psql is used as an example to describe the connection method.

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?

Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel