Managing infrastructure can be tricky business. Development teams must maintain the settings for each individual deployment environment. Over time, environments can become difficult or impossible to reproduce. This would mean that hard-to-track manual processes would have to be used to create and maintain these environments. Instead of going through this headache, we can use an Infrastructure as Code (IaC) tool called Terraform.

What is Terraform?

Terraform is an open-source IaC tool for provisioning and managing cloud infrastructure. This tool allows users to define a desired end-state infrastructure configuration. It will then go ahead and provision the infrastructure exactly as described. It can also safely and efficiently re-provision infrastructure in response to configuration changes. This means that your infrastructure will be exactly the same every time.

Using Terraform with Azure DevOps

As with many technologies, there is an extension in the Visual Studio Marketplace to make your life easier. To get started, simply install the Terraform extension. This extension provides service connections for AWS and GCP for deployment to Amazon or Google clouds – you’ll need to create an Azure Service Principal if you’re deploying to Azure. It also includes a task for installing the required version of Terraform on your agent, as well as a task for executing the core commands. This extension requires some configuration, such as defining your provider and which command you want the tool to execute.

After your configuration is complete, you are able to include the Terraform task in your Build or Release Pipeline to manage your infrastructure automatically.

For more information about Terraform, or to get started, contact our team of experts at PRAKTIK.