Use custom Terraform provider builds in your pipeline

Install golang and other tools in your build agent

Content of the .go-version file in the AzureRM repository
GoTool@0 Task in Azure DevOps to install golang in a specific version

Clone source code and build provider binaries

# define custom terraform azurerm provider repo and branch
SOURCE_REPO=https://github.com/heoelri/terraform-provider-azurerm.git
SOURCE_BRANCH=feature/newafdsku
# making sure that GOPATH is set
export GOPATH=~/go
# create and enter the required directories
mkdir -p $GOPATH/src/github.com/hashicorp
cd $GOPATH/src/github.com/hashicorp
# git clone the source repository
git clone $SOURCE_REPO
Output of git clone
cd $GOPATH/src/github.com/hashicorp/terraform-provider-azurermgit checkout $SOURCE_BRANCH
Output of git checkout
make build
Output of make build in Azure DevOps Pipeline

Use custom, local binaries with terraform

Content of the ~/.terraformrc file containing a dev_override for hashicorp/azurerm
echo "provider_installation {
dev_overrides {
\"hashicorp/azurerm\" = \"$GOPATH/bin\"
}
direct {}
}" > ~/.terraformrc
dev_overrides warning when using terraform cli

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store