- Newest
- Most votes
- Most comments
Hello.
Can you confirm the public IP address by resolving the RDS endpoint using a command such as "dig"?
Also, please make sure that all subnets used by the RDS instance are public subnets.
If a subnet group contains both private and public subnets, a failover may occur during maintenance, and the instance may be moved to a private subnet.
Based on your description, it sounds like the RDS maintenance window has caused connectivity issues to your PostgreSQL database on port 5432. Since you can still access the RDS instance from an EC2 maintenance VM but not from Fargate containers or outside AWS, this suggests a networking or security configuration change rather than a database-level issue.
Here are several potential causes and solutions to investigate:
-
Public Accessibility Setting: The maintenance might have changed the "Publicly accessible" setting on your RDS instance. Check if this setting is still enabled in the RDS console under "Connectivity & security" if you need external access.
-
Security Group Configuration: Verify that the security group associated with your RDS instance still has the correct inbound rules allowing traffic on port 5432 from your Fargate containers and external sources.
-
Subnet Configuration: If your RDS instance is connected to both private and public subnets, the maintenance might have caused a failover to a private subnet. This can cause connectivity issues even if public access is enabled. Consider configuring your RDS to use only public subnets if external access is required.
-
Network ACLs: Check if the Network ACLs associated with your RDS instance's subnet allow inbound and outbound traffic on port 5432.
-
Route Tables: Ensure that the route tables for your VPC are correctly configured to allow traffic between your Fargate containers and the RDS instance.
-
Database Port: Confirm that the database port hasn't changed from 5432 during maintenance.
-
Database User Permissions: Verify that the database users still have CONNECT access to the database.
Since you can connect from an EC2 instance in the same VPC but not from Fargate or external sources, the most likely issues are related to public accessibility settings or security group configurations. Try temporarily allowing all inbound traffic to your RDS instance (for testing purposes only) to rule out security group issues.
Sources
Troubleshooting connection issues to your Amazon RDS DB instance - Amazon Relational Database Service
Lost public access to AWS RDS postgresql instance | AWS re:Post
Troubleshooting connections to your RDS for PostgreSQL instance - Amazon Relational Database Service
Cannot connect to RDS(postgres) from EC2 via application code | AWS re:Post
I've already checked the networking. Since this post, the Fargate instance is now magically working. But my off-aws network connection still fails. It is slowly fixing itself, which implies it is some AWS issue.
Relevant content
- asked a year ago
- asked 2 years ago
- AWS OFFICIALUpdated 9 months ago
