Good day y’all,
You’re here because you probably had issues using the Transform::Include feature of Cloudformation.
Note: by the time you get to this blog, AWS might have fixed this bug.
Let me tell you .. it’s awesome!
Most people I’ve worked with have been looking for this for a while! To achieve it, they were using Nested stacks.
But we all know that it’s very different.
I was personally very excited to see that announcement. But really … I only had an opportunity to start using it yesterday.
And it’s awesome!
Now there’s a few gotchas … that might get fixed in the future, but for now there’s a few issue.
Let’s consider the following cloudformation template:
This cloudformation teamplte basically is just gonna to create an s3 bucket.
The definition of the S3 resource would be done in the s3.yaml
file, hosted in our artifact bucket.
The s3.yaml
would have the following content:
So far, easy hey!
Note: Before you try to deploy the template, make sure you’ve uploaded the s3.yaml
snippet in the right location first
Now, let’s try to deploy that cloudformation template:
|
|
Wait … what ?! Is that telling me that the s3.yaml
file is not valid?? But .. when I lint my yaml file, it says it’s valid!!
Well well… actually, not sure if it’s a bug, or not (although it smells like one), but basically you cannot use the short notation of the Cloudformation intrinsic functions.
You can’t use !Ref BucketName
in this case.
Instead the correct snippet would be:
Try that, and let me know on Twitter!