1

我有一个 RDS MySQL 持久实例,我正在尝试运行每 8 小时创建一次然后销毁的 Spot 实例。

我遇到的问题是我不明白如何将那些具有动态 IP 的 Spot 实例添加到我的 RDS 实例的安全组中,以便让它们执行查询等。

我是否应该在创建 Spot 实例后立即获取 IP,并在每次创建新的 Spot 实例时将其添加到 RDS 实例的安全组中?每次终止现场实例时也要销毁它吗?

任何关于采取何种方法的提示将不胜感激!谢谢!

4

1 回答 1

3

Assuming that both your spot instances and RDS are in the same region: when setting up an RDS security group, you can also allow machines in EC2 security groups to connect to your RDS machine. Simply add all your spot instances to a EC2 security group and grant access to RDS for this security group.

If your RDS and spot instances are in different regions, you could use the AWS API or an AWS API client like boto for Python to add the IPs automatically.

于 2012-09-04T06:03:49.350 回答