Foundations / Lesson 1 of 3
What is Infrastructure as Code?
See why teams stopped clicking through consoles and started describing infrastructure in files.
6 min Beginner 7 steps
IN THIS LESSON
Step 1 of 7
STEP 1 / 7
The manual way
An engineer signs in to the cloud console and clicks through forms to create a server. It works, and it is how almost everyone starts. But nothing records what was clicked or why.
← → step · R replay · Space play/pause
YOU'LL LEARN
- Why manual infrastructure changes do not scale
- What it means to describe infrastructure as code
- How version control improves infrastructure changes
- Where Terraform fits in
- The manual way. An engineer signs in to the cloud console and clicks through forms to create a server. It works, and it is how almost everyone starts. But nothing records what was clicked or why.
- It does not scale. More servers and a database means more clicking. Two engineers configure the same thing slightly differently, a step gets forgotten, and the environment slowly drifts from what anyone remembers building.
- Describe it in code. Infrastructure as Code replaces the clicking with a file. You write down what you want, such as two web servers and a database, in a language a tool can read. The file becomes the definition of your infrastructure.
- Keep it in version control. Because the infrastructure is now text, it can live in Git. Every change is a commit with an author and a message. Teammates review pull requests before anything changes, and a bad change can be reverted.
- A tool makes it real. Terraform reads the files and works out what must be created or changed to make the real world match them. It talks to the cloud's API for you, so nobody needs to open the console.
- Same code, same result. Point the same code at another account and you get the same infrastructure again. Environments stop being hand-built snowflakes. They become copies of one reviewed definition.
- Recap. Infrastructure as Code turns infrastructure into something you can read, review, repeat and roll back.