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.
Introduction to Data Wrangler in Microsoft Fabric
What is Data Wrangler? A key selling point of Microsoft Fabric is the Data Science
Jul
Autogen Power BI Model in Tabular Editor
In the realm of business intelligence, Power BI has emerged as a powerful tool for
Jul
Microsoft Healthcare Accelerator for Fabric
Microsoft released the Healthcare Data Solutions in Microsoft Fabric in Q1 2024. It was introduced
Jul
Unlock the Power of Colour: Make Your Power BI Reports Pop
Colour is a powerful visual tool that can enhance the appeal and readability of your
Jul
Python vs. PySpark: Navigating Data Analytics in Databricks – Part 2
Part 2: Exploring Advanced Functionalities in Databricks Welcome back to our Databricks journey! In this
May
GPT-4 with Vision vs Custom Vision in Anomaly Detection
Businesses today are generating data at an unprecedented rate. Automated processing of data is essential
May
Exploring DALL·E Capabilities
What is DALL·E? DALL·E is text-to-image generation system developed by OpenAI using deep learning methodologies.
May
Using Copilot Studio to Develop a HR Policy Bot
The next addition to Microsoft’s generative AI and large language model tools is Microsoft Copilot
Apr