When it comes to Amazon Web Services (AWS), infrastructure scripting is typically done using either CloudFormation (CF), which is an AWS service, or Terraform (an open-source tool). These tools allow you to represent all the resources in your cloud environment using template files, thereby allowing you to easily create additional similar environments for purposes such as development, testing, and quality assurance. These test environments are not necessarily always needed--sometimes they're only needed during daytime hours, or sometimes only during certain project phases. Using the template files to remove/restore your environment is not the only way to cut nightly costs--there's also scheduled autoscaling groups, and an instance scheduler tool. However, maintaining the templates is unquestionably useful for testing infrastructure changes without much risk of impacting your other environments. How will you know that the template you wrote and used today will still work when you need it again months from now? A simple daily test should give you that confidence and notify you if anything breaks. So, how can we set up daily CF stack creation and removal? Answer: Lambda + CloudWatch Rules. This article works through a template that sets up this kind of daily test.