I have an ec2 instance with its own security group. I am trying to setup Route 53 health checks.
For this to work, I need to allow the traffic originating from route 53 health check ip's into my instance.
我有一个EC2实例,它有自己的安全组。我正在尝试设置53号公路的健康检查。为此,我需要允许来自路由53运行状况检查IP的流量进入我的实例。
As indicated in the official documentation
https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-router-firewall-rules.html
https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/route-53-ip-addresses.html
正如官方文件https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-router-firewall-rules.html https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/route-53-ip-addresses.html中所述
I have taken the ip's mentioned in the json and added to the inbound rule of the security group(to which the instance belong). This is working fine.
我已经将json中提到的IP添加到(实例所属的)安全组的入站规则中。这个很好用。
But I have many instances running with its own security group. I do not want to edit each security group to make the same changes. Is there an easier or simpler way to achieve this?
但我有许多实例在其自己的安全组中运行。我不想编辑每个安全组以进行相同的更改。有没有更容易或更简单的方法来实现这一点?
更多回答
Depends. Are the instances in same VPC? If yes, then they can use same SG.
视情况而定。实例是否在同一个VPC内?如果是,则他们可以使用相同的SG。
While these IPs might not change often, they are technically dynamic so you should consider creating Security Group ingress rules that are dynamically populated with the Route 53 IPs. Create that mechanism and then you can more easily apply it to all relevant Security Groups (e.g. via Scheduled Lambda).
虽然这些IP可能不会经常更改,但它们在技术上是动态的,因此您应该考虑创建使用路由53 IP动态填充的安全组入口规则。创建该机制,然后您可以更轻松地将其应用于所有相关的安全组(例如,通过计划的Lambda)。
@Marcin they are in same vpc
@Marcin他们在同一个VPC中
优秀答案推荐
Assume you don't have NACL configured in the subnet, you just need to create a separate Security Group which allow the requests from Route53 Health Check.
假设您没有在子网中配置NACL,您只需要创建一个单独的安全组来允许来自Route53 Health Check的请求。
As EC2 Instances and Security Groups are in many-to-many relationship, that mean you can attach instances to multiple security groups, so as a Security Group can be attached by multiple instances.
由于EC2实例和安全组是多对多关系,这意味着您可以将实例附加到多个安全组,因此一个安全组可以由多个实例附加。
I think you can go with Manage Prefix list for your case. Because Amazon Route53 supports AWS Managed Prefix lists for health checks. So you don't need to update anything in Security group. Editing security group is not good practice. Just create a managed prefix lists in VPC console and associate any IP address ranges on there. Then you can mapped the managed prefix lists to your target security group. You can use below link to check.
我认为您可以针对您的情况选择管理前缀列表。因为Amazon Route53支持用于运行状况检查的AWS托管前缀列表。因此,您不需要更新安全组中的任何内容。编辑安全组不是很好的做法。只需在私有网络控制台创建托管前缀列表,并在列表上关联任意网段即可。然后,您可以将托管前缀列表映射到您的目标安全组。您可以使用下面的链接进行查看。
Managed Prefix lists for AWS Route53 Healthchecks
AWS Route53运行状况检查的托管前缀列表
更多回答
我是一名优秀的程序员,十分优秀!