Terraform Version
Terraform Configuration Files
provider "aws" {
region = "us-east-1"
}
Expected Behavior
Running 0.12upgrade against a directory that has been initialized using an external plugin directory (terraform init -plugin-dir=/path/to/plugins) should upgrade the .tf files to version 0.12 syntax.
Actual Behavior
The upgrade fails because the external plugin directory (as captured in .terraform/plugin_path) is not searched, so the provider cannot be found:
- provider.aws: no suitable version installed
version requirements: '(any version)'
versions installed: none
Steps to Reproduce
- Download the a provider plugin to an external directory (
/tmp/plugins)
- Create a directory with a tf definition that uses that provider:
provider "aws" {
region = "us-east=1"
}
- Run
terraform init -plugin-dir=/tmp/plugins
- Run
terraform 0.12upgrade -yes
Debug logs
On the initial init, the trace log shows the plugin directory being used:
2019/06/04 19:41:21 [DEBUG] checking for provider in "/tmp/plugins"
2019/06/04 19:41:21 [DEBUG] found provider "terraform-provider-aws_v2.12.0_x4"
...
2019/06/04 19:41:22 [DEBUG] found valid plugin: "aws", "2.12.0", "/tmp/plugins/terraform-provider-aws_v2.12.0_x4"
And a .terraform/plugin_path file is generated:
$ cat .terraform/plugin_path
[
"/tmp/plugins"
]
But when the 0.12upgrade command is run, the plugin dir is not searched:
2019/06/04 19:41:22 [DEBUG] checking for provider in "."
2019/06/04 19:41:22 [DEBUG] checking for provider in "/usr/local/bin"
2019/06/04 19:41:22 [DEBUG] checking for provider in ".terraform/plugins/linux_amd64"
2019/06/04 19:41:22 [DEBUG] checking for provisioner in "."
2019/06/04 19:41:22 [DEBUG] checking for provisioner in "/usr/local/bin"
2019/06/04 19:41:22 [DEBUG] checking for provisioner in ".terraform/plugins/linux_amd64"
...
Error: error resolving providers:
- provider.aws: no suitable version installed
Terraform Version
Terraform Configuration Files
Expected Behavior
Running
0.12upgradeagainst a directory that has been initialized using an external plugin directory (terraform init -plugin-dir=/path/to/plugins) should upgrade the.tffiles to version 0.12 syntax.Actual Behavior
The upgrade fails because the external plugin directory (as captured in
.terraform/plugin_path) is not searched, so the provider cannot be found:Steps to Reproduce
/tmp/plugins)terraform init -plugin-dir=/tmp/pluginsterraform 0.12upgrade -yesDebug logs
On the initial
init, the trace log shows the plugin directory being used:And a
.terraform/plugin_pathfile is generated:But when the
0.12upgradecommand is run, the plugin dir is not searched: