I cannot connect to my rds instance from ec2 instance, the error I am getting is connect: connection timed out. However, I am able to connect from mysql workbench running on my local machine.
- RDS instance set to publicly available
- RDS instance and ec2 instance are in the same security group
- Security group when configured to allow connections from anywhere still produces same error
- traceroute outputs *** for all when run from ec2 to rds, however provides normal output when run from local machine provides output showing that it's not blocked by firewall
- RDS instance and ec2 instance are in same availability zone, not multi-zone rds
- Opening the connection using the following golang:
conn, err = sql.Open("mysql", fmt.Sprintf("%s:%s@tcp(%s:%s)/%s", os.Getenv("db_user"), os.Getenv("db_pass"), os.Getenv("db_endpoint"), os.Getenv("db_port"), os.Getenv("db_name")) + "?parseTime=true")
It seems like a firewall issue but changing security group permissions is not helping.