Terraform Enterprise
Terraform Enterprise Integration
Starting from v0.9.5, Weave GitOps tf-controller officially supports integration to Terraform Cloud (TFC) and Terraform Enterprise (TFE). Here are the steps to set up tf-controller for your TFE instance.
Terraform Login
First, you need to obtain an API token from your TFE. You can use terraform login
command to do so.
terraform login tfe.dev.example.com
Then you can find your API token inside $HOME/.terraform.d/credentials.tfrc.json
.
Content of the file will look like this:
{
"credentials": {
"tfe.dev.example.com": {
"token": "mXXXXXXXXX.atlasv1.ixXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}
}
}
Prepare an TFRC file
TF-controller accepts an TFRC file in the HCL format. So you have to prepare terraform.tfrc
file using contents from above.
credentials "tfe.dev.example.com" {
token = "mXXXXXXXXX.atlasv1.ixXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}