Infrastructure as Code in 3 minutes
Tags: devops, iac, infra, codenewbie
Published: 2021-05-07 04:33:55

__Infrastructure as Code__ is becoming more and more important in the DevOps Context, due to the many __benefits__ it brings.

Today I have for you a ___quick intro___ to the topic, so you can understand what it is and why more and more companies and developers are looking into adopting it.

I will not go into specific languages and tools but let me know in the comment section below if you'd like me to create another post, video, or a series about specific implementations.

### Video

As usual, if you are a __visual learner__, or simply prefer to watch and listen instead of reading, here you have __the video with the whole explanation__.

{% youtube fE4gY-SydKo %}

[Link to the video: https://youtu.be/fE4gY-SydKo](https://youtu.be/fE4gY-SydKo)

If you rather prefer reading, well... let's just continue :)

### What

Infrastructure as Code (__IaC__) is the management of infrastructure (networks, virtual machines, load balancers, and so on so forth) in a __descriptive model__, using the same versioning as DevOps team uses for source code.

Like the principle that the same source code generates the same binary, an __IaC model generates the same environment every time__ it is applied.

### Why

Thanks to this, Infrastructure as Code __solves__ the problem of "_environment drift_".

__Without IaC__, teams must maintain the settings of __individual deployment environments__. Over time, each environment ends up having a __unique configuration__ that cannot be reproduced automatically. __Inconsistency__ among environments can cause issues during deployments, and administration and maintenance of infrastructure involves manual processes which are hard to track and __contribute to errors__.

__With IaC__, instead, teams make changes to the environment description and version the __configuration model__, which is typically in __well-documented code__ formats. The release pipeline executes the model to configure target environments. If the team needs to make changes, they __edit the source, not the target__.

Additionally, IaC enables DevOps teams to test applications in __production-like environments__ early in the development cycle. These teams expect to provision multiple test environments reliably and on demand. Infrastructure represented as code can also be validated and tested to prevent common deployment issues. At the same time, the cloud __dynamically provisions__ and tears down environments based on IaC definitions.

Teams who implement IaC can deliver __stable environments rapidly and at scale__. They avoid manual configuration of environments and __enforce consistency__ by representing the desired state of their environments via code. 

Infrastructure deployments with IaC are __repeatable__ and prevent runtime issues caused by configuration drift or missing dependencies.

DevOps teams can work together with a __unified set of practices__ and tools to deliver applications and their supporting infrastructure rapidly, reliably, and at scale.

These are the reasons why __IaC is a key DevOps practice__ and is used in conjunction with continuous delivery.

### Conclusions

We should now have a clearer understanding of what Infrastructure as Code is, and of the benefits it provides.

Let me know in the comment section below if you have any question about IaC and, as I've mentioned before, if you'd like me to make another post or video about a specific tool or framework for Infrastructure as Code.

__Like, share and follow me__ 🚀 for more content:

📽 [YouTube](https://www.youtube.com/CoderDave)
☕ [Buy me a coffee](https://buymeacoffee.com/CoderDave)
💖 [Patreon](https://patreon.com/CoderDave)
👕 [Merch](https://geni.us/cdmerch)
👦🏻 [Facebook page](https://www.facebook.com/CoderDaveYT)
🐱‍💻 [GitHub](https://github.com/n3wt0n)
👲🏻 [Twitter](https://www.twitter.com/davide.benvegnu)
👴🏻 [LinkedIn](https://www.linkedin.com/in/davidebenvegnu/)
🔉 [Podcast](https://geni.us/cdpodcast)

{% youtube fE4gY-SydKo %}