12

我在 AWS 上有以下设置

  • 区域 1 中的一个 RDS 实例。
  • 区域 2 中的一个 Ec2 实例。
  • 区域 2 中的 EC2-安全组 sgrg2。

我正在尝试通过将安全组添加到 RDS 实例列表来从 EC2 访问 RDS。它没有授权。

此外,在将 sgrg2 添加到 RDS 安全组时,它说“帐户 xxx 的 EC2 安全组 sgrg2 不存在”。

请帮忙。

4

2 回答 2

11

Communication between regions on AWS goes through the untrusted internet. You need to add the external IP of the EC2 instance to the security group of the RDS instance to get that to work. However, I would recommend you to move the EC2 instance into the RDS instance region, both for safety and cost. Safety as you need to expose your RDS instance to the internet (also make sure you use SSL connetions to the db). Cost as Amazon charges for traffic across regions as regular in/out traffic.

于 2014-03-21T06:58:42.383 回答
2

以下链接帮助我从不同区域的 EC2 实例连接到 RDS

https://forums.aws.amazon.com/thread.jspa?threadID=102827

诀窍是使用 http://baremetal.com/cgi-bin/dnsip来确认 RDS 安全组将接受哪个 IP 号,从而可以访问我的 EC2 实例。

这就是说,在可行/实用的情况下,将 RDS 和 EC2 实例保持在同一区域中确实很有意义。

于 2014-05-28T02:24:55.927 回答