CloudFormation: functions like ImportValue and GetAtt inside a Sub

Hello! In CloudFormation, I think !Sub is the best way to generate strings that contain dynamic values. It's better to interpolate, like this: Than to join, like this: Both are common solutions, ${SG} resolves to the same value as !Ref SG, but I think interpolation is the right tool here. Join is better for other … Continue reading CloudFormation: functions like ImportValue and GetAtt inside a Sub

CloudFormation Custom Resources: Avoiding the Two Hour Exception Timeout

There's a gotcha when writing CloudFormation Custom Resources that's easy to miss and if you miss it your stack can get stuck, ignoring its timeout setting. It'll fail on its own after an hour, but if it tries to roll back you have to wait a second hour. Here's how to avoid that. This post … Continue reading CloudFormation Custom Resources: Avoiding the Two Hour Exception Timeout

3 Tools to Validate CloudFormation

Update August 2019: cfn-nag replaced with cfn-lint, a newer tool. Hello! If you haven't read the AWS page on validating CloudFormation templates, check that out first. It's a better starting place. I run three tools before applying CF templates. Here they are! #1 AWS CLI's validator This is the native tool. It's ok. It's really only … Continue reading 3 Tools to Validate CloudFormation