Say Hi to Terraform

With the evolution of Cloud technologies, infrastructure as a code is one of the biggest priorities for most Tech companies.
IaC is all about provisioning infrastructure through software to achieve consistent and predictable environments.

Key advantages of IaC are as:
- Automated deployments to achieve consistent environments
- Repeatable process
- Reusable components
What is Terraform?
Terraform is an open source IaC (Infrastructure as Code) based tool developed by HashiCorp. Its written in a statically typed compiled programming language known as “GO”.
Terraform uses IaC concepts to automate provisioning of Cloud Infrastructure.
Terraform Components
- Terraform Executable
Terraform executable is a standalone library which is enough to execute all commands. Installation is straightforward with no need of extra DLLs. It can be installed on all major OS.
2. Terraform Configuration files
Its the most important component of a Terraform project. Configuration files contains the code which is primarily responsible to provision resources on Cloud. The config files have an extension of “.tf”.
3. Terraform Providers
A provider is responsible for exposing and provisioning resources of a Cloud platform. For example ‘Microsoft Azure’ is a provider for Terraform to get access to Azure platform. A provider calls platform specific APIs (ARM : Azure Resource Manager APIs) to create, read, update and delete cloud resources.
4. Terraform Plugins
Plugins are used to interact with service providers. For example, if Terraform wants to talk to ‘Microsoft Azure’ provider to provision and access Azure resources, its the responsibility of the plugin to establish the communication.
5. State Files
State files are used to store the current state of configuration file. When a configuration file is used to provision resources, the state of the configuration file is saved in the state files. In case an update is requested with an updated configuration file, its compared to the state saved in the state files.
Different parts of Terraform Config file
- Variables: To store values to be used in the configuration file
- Provider
- Data: Information about existing resources in Azure
- Resource: Azure resource to be created
- Output: Information out of the deployment
Terraform Installation
Click here to download the executable for your OS.
Update the PATH environment variable to point to the Terraform executable

Open command prompt and execute command : Terraform

In the next article, I will go through a simple DEMO to create a new resource group in Azure.
Regards Tarun
P.S — Medium is an excellent platform to read, write and learn from fellow authors. If you want to join me in this journey, Join medium today.
References: