A tool to make Terraform Provider development easier on TF 0.14+
A tool to make Terraform Provider development easier on Terraform 0.14+ - by templating the providers.tf
to allow easier toggling between Development and Production binaries.
$ tfdev [PROVIDER] [MODE]
azurerm
, aws
)dev
(to use the dev override) or prod
(to use the prod value)Run:
go install github.com/tombuildsstuff/tfdev
Assuming the following ~/.terraformrc
:
provider_installation {
dev_overrides {
"tombuildsstuff/azurerm" = "/Users/tharvey/code/bin"
}
# For all other providers, install them directly from their origin provider
# registries as normal. If you omit this, Terraform will _only_ use
# the dev_overrides block, and so no other providers will be available.
direct {}
}
Add a .tfdev.hcl
file to your home directory:
$ cat ~/.tfdev.hcl
provider "azurerm" {
dev = "tombuildsstuff/azurerm"
prod = "hashicorp/azurerm"
}
At which point running tfdev azurerm dev
or tfdev azurerm prod
will output a providers.tf
containing the required Provider configuration:
terraform {
required_providers {
azurerm = {
source = "tombuildsstuff/azurerm"
}
}
}
1.x
Apache 2