将竞价型实例添加到RDS实例的安全组 [英] Adding Spot Instances to the Security Group of an RDS Instance

查看:67
本文介绍了将竞价型实例添加到RDS实例的安全组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个RDS MySQL持久性实例,我正在尝试运行现货实例,该实例每8小时创建一次,然后销毁.

I have an RDS MySQL persistant instance, and I am trying to run spot instances which are created once every 8 hours and then destroyed.

我遇到的问题是我不明白如何将具有动态IP的竞价型实例添加到我的RDS实例的安全组中,以使其能够执行查询等.

The issue I am having is that I don't understand how can I add those spot instances which have dynamic IPs to the security group of my RDS Instance in order to let them perform queries,etc.

是否应该在创建竞价型实例后立即获取IP,并在每次创建新的竞价型实例时将其添加到RDS实例的安全组中?还会在每次现货实例终止时销毁它吗?

Should I grab the IP as soon as the spot instance is created and the add it to the security group of the RDS instance each time a new spot instances is created? Also destroy it every time the spot instance is terminated?

任何采用哪种方法的提示都将不胜感激!谢谢!

Any tip on what approach to take will be much appreciated! Thanks!

推荐答案

假定竞价型实例和RDS都位于同一区域:设置RDS安全组时,还可以允许EC2安全组中的计算机连接到您的RDS机器.只需将您的所有竞价型实例添加到EC2安全组中,然后授予该安全组对RDS的访问权限即可.

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.

如果您的RDS和竞价型实例位于不同的区域,则可以使用AWS API或AWS API客户端,例如 botofor Python 自动添加IP.

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.

这篇关于将竞价型实例添加到RDS实例的安全组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆