Conditional Resources

In this lesson, you'll learn how to handle conditional​ resources by using CloudFormation template and SAM CLI!

Email subscriptions are not the right solution for production deployments. Emailing after each individual event would most likely cause too much noise, and people will just start ignoring it. It would be much better to set up error logging in a different way completely. You can make the email subscription optional by adding a condition to your resource.

CloudFormation can activate or deactivate resources based on certain conditions, which you need to set up in a separate template section titled Conditions. I usually put this between parameters and resources. The following lines are added to your template as a top-level section, for example above Resources.

Get hands-on with 1000+ tech skills courses.