Tag Archives: How To

Supply optional Security Groups to an EC2 instance in CloudFormation

When developing your Infrastructure as Code CloudFormation templates, you sometimes need to associate your resources with a list of Security Groups (SG) which may need to be configurable. For example, your resource may have a primary SG, and a list of optional SGs that can be specified at template deployment time.

I recently went through a somewhat painful exercise figuring out how to implement this, and that’s what I’m here to share with you.

Continue reading