Skip to content
| Marketplace
Sign in
Azure DevOps>Azure Pipelines>Read Terraform vars into Azure DevOps vars
Read Terraform vars into Azure DevOps vars

Read Terraform vars into Azure DevOps vars

Ahmed IG

|
76 installs
| (1) | Free
An easy way to grab variables from your terraform tfvar files, into an Azure DevOps variable. Just give it the key, and it will save the value in a variable.
This extension is now unpublished from Marketplace. You can choose to uninstall it.

Terraform vars into VSTS vars

Build Status

To contribute to this extension, please visit this repository.

Introduction

A lot of people use Terraform for infrastructure as code, and they save their values in tfvar files, for every environment. In addition, when running builds and releases, sometimes you may need those values to pass them to other build tasks. This task is handy in such situation, where you would like to extract a tfvar value so easily into an Azure Devops variable $(something). It also supports the lookup option where there is a root key. The below examples should explain more.

How to use the task

These are the supported two scenarios on how to use the task.

Output Variable Name: the name of the vsts variable that you can use later on like $(MyVstsVariableName)

Scenario 1:

When you have a direct key and value declared in a tfvar file like the below example:

Akey = "a value"

In this case, your properties in your task should look like that: (notice that the root key is left blank)

Without Root key

Scenario 2:

When you have a root key, a key and value declared in a tfvar file like the below example. This is known as a lookup variable:

RootKey {
  key1 = "value1"
  key2 = "value2"
}

In this case, your properties in your task should look like that:

With Root key

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft