[英]Using single cloud formation script to create more then 2 ec2 instance and attach different Security group
I have a situation were i need to use single cloudformation script to create ec2 instance, each ect instance will have its own SG and rules example ec2 1, SG1 (2 ports open any 22 80 etc) ec2 2, SG2 (3 ports not same as above) ec2 3, SG3 (4 ports not same as above two)我的情况是我需要使用单个 cloudformation 脚本来创建 ec2 实例,每个 ect 实例都有自己的 SG 和规则示例 ec2 1、SG1(2 个端口打开任何 22 80 等)ec2 2、SG2(3 个端口不相同同上) ec2 3, SG3 (4 个端口与上述两个不同)
You can do this in CF.您可以在 CF 中执行此操作。 You have to specify every resource you gonna create/use.您必须指定要创建/使用的每个资源。 But CF don't have loop functionality like terraform for this.但是 CF 没有像 terraform 这样的循环功能。
A cloudformation template (script you call it) allows you to create multiple resources in it not just one. cloudformation 模板(您称之为脚本)允许您在其中创建多个资源,而不仅仅是一个。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.