简体   繁体   中英

AWS EC2 Private Instance DB Connection

I have a VPC with public & private subnets (Windows 2019). I installed Postgres database (not RDS) manually in the private instance. As recommended by AWS I have created all the security group rules in public & private instance security groups. I wasn't able to connect to the DB from public instance. Please advise. Thanks.

Public instance security group:

  • HTTP TCP 80 0.0.0.0/0 -
  • PostgreSQL TCP 5432 0.0.0.0/0
  • RDP TCP 3389 0.0.0.0/0 -
  • HTTPS TCP 443 0.0.0.0/0

Outbound:

  • PostgreSQL TCP 5432 sg-0f189eca6a0f783dd (PRIVATE-SG)

Private instance security group:

  • PostgreSQL TCP 5432 sg-008ffcfcdec814a91 (PUBLIC-SG)
  • RDP TCP 3389 sg-008ffcfcdec814a91 (PUBLIC-SG)

Based on the comments.

The connection issue was caused by build-in firewall on Windows instances.

The solution was to add rule to the firewall enabling port 5432.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM