Terraform tips & tricks: loops, if-statements, and gotchas
<p><strong><em>Update, November 17, 2016</em></strong><em>: We took this blog post series, expanded it, and turned it into a book called </em><a href="http://www.terraformupandrunning.com/?ref=gruntwork-blog-comprehensive-terraform" rel="noopener ugc nofollow" target="_blank"><em>Terraform: Up & Running</em></a><em>!</em></p>
<p><strong><em>Update, July 8, 2019</em></strong><em>: We’ve updated this blog post series for Terraform 0.12 and released the </em><a href="https://blog.gruntwork.io/terraform-up-running-2nd-edition-early-release-is-now-available-b104fc29783f" rel="noopener ugc nofollow" target="_blank"><em>2nd edition of Terraform: Up & Running</em></a><em>!</em></p>
<p><strong><em>Update, Sep 28, 2022: </em></strong><em>We’ve updated this blog post series for Terraform 1.2 and released the </em><a href="https://blog.gruntwork.io/terraform-up-running-3rd-edition-is-now-published-4b99804d922a" rel="noopener ugc nofollow" target="_blank"><em>3rd edition of Terraform: Up & Running</em></a><em>!</em></p>
<p>This is Part 5 of the <a href="https://blog.gruntwork.io/a-comprehensive-guide-to-terraform-b3d32832baca#.b6sun4nkn" rel="noopener ugc nofollow" target="_blank">Comprehensive Guide to Terraform</a> series. In previous parts, you learned <a href="https://blog.gruntwork.io/why-we-use-terraform-and-not-chef-puppet-ansible-saltstack-or-cloudformation-7989dad2865c#.63ls7fpkq" rel="noopener ugc nofollow" target="_blank">why we picked Terraform</a>, how to use the <a href="https://blog.gruntwork.io/an-introduction-to-terraform-f17df9c6d180" rel="noopener ugc nofollow" target="_blank">basic syntax and features of Terraform</a>, <a href="https://blog.gruntwork.io/how-to-manage-terraform-state-28f5697e68fa" rel="noopener ugc nofollow" target="_blank">how to manage Terraform state</a>, and <a href="https://blog.gruntwork.io/how-to-create-reusable-infrastructure-with-terraform-modules-25526d65f73d" rel="noopener ugc nofollow" target="_blank">how to create reusable infrastructure with Terraform modules</a>. In this part, you are going to expand your Terraform toolbox with some more advanced tips & tricks, such as how to do loops and if-statements. You’ll also learn about some of Terraform’s weaknesses so you can avoid the most common gotchas.</p>
<p><a href="https://blog.gruntwork.io/terraform-tips-tricks-loops-if-statements-and-gotchas-f739bbae55f9"><strong>Read More</strong></a></p>