On DevOps — 9. Infrastructure as Code — Clean Code, Terraform Introduction, and Best Practices

Tiexin Guo
4th Coffee
Published in
10 min readFeb 11, 2021

--

Walhalla, Donaustauf, Germany

In my previous article, I talked a little bit about Infrastructure as Code (hereafter IaC), mainly about the difference between IaC and configuration management, the best practices on IaC, and making decisions. If you haven’t read it yet, here’s a quick link:

This chapter will have a relatively detailed look at one of the most popular choices: Terraform.

On (Clean) Code

Before we talk about these tools, let’s have a look at coding/programming. And I want to start this conversation by quoting Knuth:

Programs are meant to be read by humans and only incidentally for computers to execute.

The computer has no problem with ambiguous variable names, extended functions, or a single file of thousands of lines of code. It will still execute properly. All the methodologies and ideas like refactoring, clean code, naming conventions, code smell, etc., are invented so…

--

--