Terraform is an Infrastructure as Code (IaC) tool which allows the building, changing and versioning of infrastructure in an efficient way. Terraform allows management of an infrastructure whether that’s cloud service or in-house. The purpose of Terraform is to answer three questions, “How do we get the infrastructure up and running on day 1?”, “How do we manage the Infrastructure from day 2 onwards?” and finally “How do we destroy the Infrastructure at the end of its lifecycle?”.
- How it works
Terraform template allows us to define how the infrastructure is going to be spun up. This involves the details of the resource you are going to spin up, any necessary and optional details required to complete the deployment of the resource etc. More details on the various steps within a Terraform deployment is explained below:
Terraform Refresh
The first step is Terraform Refresh, which looks at the “real world” setup, as is currently and comparing it against the templates that are in place. The refresh stage looks at what is different compared to the real world and what needs to be updated/deployed.
Terraform Plan
The second step after carrying out a reconciliation task is that it needs to create a plan of what requires updating and what should remain the same. So as an example, given by HashiCorp, creators of Terraform, the first day of deployment, the plan stage will not have anything to compare the templates to, so it deploys all that have been defined in the templates. From the second day onwards, there will be an environment to compare against and make the necessary changes.
Terraform Apply
The third step is to actually execute the changes that have been identified. As mentioned in the example above, on the first day, because there is nothing to compare to, Terraform will deploy all infrastructure that has been defined. This step also works out the dependencies to check what needs to be deployed before others. For example, the network needs to be deployed before it can deploy the security groups etc. Terraform also has the intelligence to figure out where components can be deployed in parallel for maximum efficiency.
Terraform destroy
To prepare for decommissioning the components within the infrastructure, Terraform also creates a plan which can be used to destroy the resources as required. It records the history and manages it for it to be recollected later.
This is an overview of how Terraform works and the steps that it takes to deploy the infrastructure to the desired view. This is an efficient process of managing and maintaining infrastructure with the whole lifecycle taken into consideration such as the day 1 view, as well as day 2 + and also what can be done at the end of its lifecycle.
If you enjoyed this blog, please follow us on LinkedIn to ensure you don’t miss any similar blogs.
A Brief Overview of Security in Microsoft Fabric
Where Fabric Sits in the Hierarchy As you are probably aware, Microsoft Fabric is Microsoft’s
Dec
Migration of existing Azure Data Factory Platforms to Fabric
Introduction Fabric is the latest product from Microsoft which was recently launched. It is a
Dec
Databricks Security Analysis Tool
In today’s data-driven world a cutting-edge platform is required that seamlessly integrates with the cloud,
Dec
Building Data Apps with Python’s Streamlit
Off-the-shelf solutions for interactive data app development such as Microsoft Power BI are great –
Nov
Power BI to Power AI – Part 3
This post is the third part of a blog series on the AI features of
Nov
Data Factory in Fabric
As data engineers, we use Azure Data Factory on a daily basis to collect datasets
Nov
Microsoft Fabric Is Generally Available
Microsoft Fabric is now Generally Available What has happened? On the 15th November Microsoft announced
Nov
An Introduction to Semantic Link in Microsoft Fabric
Having previously worked in the water & energy industries, I recently created a utilities PowerBI
Nov