I want to create variable number of EC2 instances within my cloudformation template (YAML). I am planning to create a stack for EC2 instance creation and loop the same. I read this is achievable using Troposphere. Can someone help me with a template or example?
Asked
Active
Viewed 271 times
-1
-
While that's also probably achievable using Troposphere, you should also check out AWS CDK (https://aws.amazon.com/cdk/). – Dunedan Sep 29 '19 at 06:39
-
@Dunedan can you help me find an example? – Reshma Sep 29 '19 at 06:46
1 Answers
0
Write the below into a class you can reuse for each instance.
https://github.com/cloudtools/troposphere/blob/master/examples/EC2InstanceSample.py

OllieB
- 81
- 2