简体   繁体   English

使用单个云形成脚本创建超过 2 个 ec2 实例并附加不同的安全组

[英]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.

相关问题 使用云形成脚本将卷附加到Windows EC2实例 - Attach volume to windows ec2 instance using cloud formation script AWS云形成-使用安全组名称创建EC2实例 - AWS Cloud formation - create EC2 instance with security group name 如何使用 Terraform 创建不同大小的 EBS 卷并附加到单个 EC2 实例? - How to create the different size of EBS volume and attach to single EC2 instance using Terraform? 使用云形成为不同区域创建Ubuntu 16.04 EC2实例? - Use cloud formation to create an Ubuntu 16.04 EC2 instance for different regions? AWS Cloud Formation模板可创建EC2实例的映像? - AWS Cloud Formation template to create an Image of an EC2 Instance? 获取使用云形成模板创建的EC2实例信息 - Getting EC2 instance information created using cloud formation template 使用云形成创建ec2实例以及IAM角色 - Creating an ec2 instance along with IAM roles using cloud formation 是否可以使用Cloud模板从用户获取“ instancecount”并相应地创建ec2实例? - Is it possible to get “instancecount” from user and create ec2 instance accordingly by using Cloud formation template.? 使用云形成在 AWS EC2 实例中创建文件的最佳实践 - Best practice to create a file in AWS EC2 instance using cloud formation BOTO3 - 从EC2实例连接/分离安全组 - BOTO3 — Attach / Detach Security Group from EC2 instance
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM