linode / terraform-provider-linode

Terraform Linode provider
https://www.terraform.io/docs/providers/linode/
Mozilla Public License 2.0
202 stars 98 forks source link

[Feature]: Resolve inconsistency with Linode CLI #1519

Open kordian2k opened 4 months ago

kordian2k commented 4 months ago

Description

Running linode-cli configure by default creates a file ~/.config/linode-cli which looks like

[DEFAULT]
default-user = username

[username]
token = ...
...

On the other hand, the terraform provider uses the ~/.config/linode as the default. Moreover, the provider ignores the default user setting in the config file which leads to a HTTP 401 error even if the token is present.

If a change to the terraform provider is infeasible the documentation should be enhanced to reflect the inconsistency. The following configuration could be mentioned as a workaround:

provider "linode" {
  config_path = pathexpand("~/.config/linode-cli")
  config_profile = fileexists(pathexpand("~/.config/linode-cli")) ? (
    regex("default-user = (.*)", file(pathexpand("~/.config/linode-cli")))[0]
    ) : (
    "default"
  )
}

New or Affected Terraform Resources

No response

Potential Terraform Configuration

No response

zliang-akamai commented 4 months ago

Hi @kordian2k, thanks for reporting the issue! We will be looking into this and let you know if there is any progress.

github-actions[bot] commented 3 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days