简体   繁体   English

如何在启动后自动将 EC2 IP 地址添加到 CloudFront WAF

[英]How to add EC2 IP address to CloudFront WAF automatically after start

Our team has isolated instance of EC2 that's shutdown overnight to save resources.我们的团队隔离了 EC2 实例,该实例会在一夜之间关闭以节省资源。 When it starts up, it has different IP address and they can't access it from internal network as its IP address has changed and need to be added to the WAF.当它启动时,它有不同的 IP 地址,他们无法从内部网络访问它,因为它的 IP 地址已更改,需要添加到 WAF。

Is there a process via SNS, Lambda or something that I can run after launch that automates it?是否有一个通过 SNS、Lambda 或我可以在启动后自动运行的进程?

The easiest method is to create an Elastic IP addresses , which is a static public IP address.最简单的方法是创建一个弹性 IP 地址,即 static 公共 IP 地址。 Then, allocate that Elastic IP address to the Amazon EC2 instance.然后,将该弹性 IP 地址分配给 Amazon EC2 实例。

The Elastic IP address will remain the same even when the instance is stopped and started.即使实例停止和启动,弹性 IP 地址也将保持不变。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM