hashicorp / terraform-provider-tfe

Official HCP Terraform and Terraform Enterprise provider, maintained by HashiCorp. Provision HCP Terraform or Terraform Enterprise - with Terraform!
https://registry.terraform.io/providers/hashicorp/tfe
Mozilla Public License 2.0
165 stars 156 forks source link

v2.6.0 provider error #353

Closed nikolay closed 3 years ago

nikolay commented 3 years ago

Only upgrading the provider version constraint to ~> 0.26.0 now shows:

╷
│ Error: Invalid provider configuration
│
│ Provider "registry.terraform.io/hashicorp/tfe" requires explicit
│ configuration. Add a provider block to the root module and configure the
│ provider's required arguments as described in the provider documentation.
│
╵
╷
│ Error: Error retrieving provider meta values from provider request
│
│   with provider["registry.terraform.io/hashicorp/tfe"],
│   on <empty> line 0:
│   (source code not available)
│
│ Error retrieving provider meta values from provider request the hostname
│ and token must be present.

This is using Terraform Cloud and TFE_ENGINE environment variable is set within the workspace. The runs are remote.

nikolay commented 3 years ago

I did not have an explicit provider block before and it worked for ages, but now it seems that at least the minimal provider block is required for it to work with TFC:

provider "tfe" {
  hostname = "app.terraform.io"
}
freimer commented 3 years ago

You can also set a TFE_HOSTNAME env var.

nikolay commented 3 years ago

@freimer I never had to do this before (and docs clearly say it defaults to app.terraform.io). It needs to be documented as v2.6 is not backward-compatible.

chrisarcand commented 3 years ago

Hello! Thanks for reporting this regression, which it indeed is. We've found the issue and will release a bugfix for it shortly.