jfrog/terraform-provider-artifactory

`"api_key": conflicts with access_token` even though no access token is defined

tjstansell opened this issue · 4 comments

Describe the bug
Latest version (6.5.0) no longer accepts just ARTIFACTORY_API_KEY environment variable. We now get the following issue even though we don't define any access_token environment variables:

│ Error: Conflicting configuration arguments
│ 
│   with provider["registry.terraform.io/jfrog/artifactory"],
│   on <empty> line 0:
│   (source code not available)
│ 
│ "api_key": conflicts with access_token

@tjstansell Can you provider an example of your provider HCL section? (with api key/secret removed, of course).

You should not have access_token attribute defined in the provider section, if you are using api_key.

We don't define anything really ... we have this:

terraform {
  required_version = ">= 1.1"

  required_providers {
    artifactory = {
      source  = "jfrog/artifactory"
      version = "~> 6.0"
    }
  }
}

and then just set the ARTIFACTORY_API_KEY and ARTIFACTORY_URL environment variables.

I think the recent change to support JFROG_ACCESS_TOKEN pulls the environment variables and sets a default value of "" now instead of nil, which I think causes it to think it's set (even though it's empty).

That's very possible. We'll investigate.