tomwwright / littleorange

Minimalist AWS multi-account cloud leveraging CloudFormation and Lambda.
GNU General Public License v3.0
4 stars 1 forks source link

SAM Templates cannot be deployed by CloudFormation Stack Sets #15

Open tomwwright opened 3 years ago

tomwwright commented 3 years ago

CloudFormation Stack Sets cannot be used to deploy SAM templates because Stack Sets do not support CloudFormation Macro Transform definitions in templates

https://docs.amazonaws.cn/en_us/AWSCloudFormation/latest/UserGuide/template-macros.html

The solution here is to "pre-transform" the template with the SAM library

https://pypi.org/project/aws-sam-translator/ https://github.com/aws/serverless-application-model/blob/develop/bin/sam-translate.py

Once rendered into a regular CloudFormation template it can be deployed in a Stack Set

This functionality is important to Little Orange as it intends to deploy lots of functionality via Stack Sets

tomwwright commented 3 years ago

BuildSAM module has support for a ApplySAMTranslate property to "pre-transform" the SAM template into vanilla CloudFormation suitable for use with Stack Sets

Note that due to #16 this functionality is only specifically useful -- for cases where a Stack Set needs to be deployed across many accounts but not many regions