mercredi 25 février 2015

Is there a way to do inheritance or code reuse in an AWS CloudFormation template?

I'm building a CloudFormation template that includes an AWS::AutoScaling::LaunchConfiguration and an AWS::AutoScaling::AutoScalingGroup that uses that LaunchConfiguration. For my stack I'm going to need multiple AutoScalingGroups, but I want them in separate security groups.


I'm also going to be using CodeDeploy, so my LaunchConfiguration includes the Metadata and UserData properties to install and run the CodeDeploy agent (as shown in line 262 of http://ift.tt/1DU8SLT). Because I have to specify the security group in the LaunchConfiguration instead of in the AutoScalingGroup, I have to have multiple copies of the LaunchConfiguration in my template with only a single-line difference.


Is there a way to reduce the number of times the lengthy Metadata and UserData sections will appear in my template? I tried creating a mapping, but they only allow alphanumeric characters.





Aucun commentaire:

Enregistrer un commentaire