Using single cloud formation script to create more then 2 ec2 instance and attach different Security group

Viewed 18

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)

1 Answers

You can do this in CF. You have to specify every resource you gonna create/use. But CF don't have loop functionality like terraform for this.

A cloudformation template (script you call it) allows you to create multiple resources in it not just one.

Related