[英]AWS: Can't connect EC2 instance to RDS instance after configuring security groups
After starting up a MySql RDS t2.micro instance and configuring the security groups accordingly to grant access from both my own ip and the public ip of my EC2 instance I received a connection timeout when trying to connect. 启动MySql RDS t2.micro实例并相应地配置安全组以授予来自我自己的IP和EC2实例的公共IP的访问权限后,尝试连接时收到连接超时。 The connection works perfectly fine locally, Multi AZ is set to None and the regions on both the RDS and EC2 are exactly the same.
该连接在本地运行良好,Multi AZ设置为None,RDS和EC2上的区域完全相同。
There is probably something small I'm missing but I've read through countless documentation now trying to find out what it is. 我可能遗漏了一些小东西,但现在我已经阅读了无数文档,试图找出它是什么。
both my own ip and the public ip of my EC2 instance
我自己的IP和EC2实例的公共IP
You should use the private IP in the security group instead of the public IP. 您应该在安全组中使用私有IP,而不要使用公共IP。 An even better method would be to list the security group the EC2 instance belongs to, instead of its IP address.
更好的方法是列出EC2实例所属的安全组,而不是其IP地址。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.