Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prompted for 'auth' on terraform plan execution #66

Closed
ocastle opened this issue Aug 12, 2019 · 1 comment
Closed

Prompted for 'auth' on terraform plan execution #66

ocastle opened this issue Aug 12, 2019 · 1 comment

Comments

@ocastle
Copy link

ocastle commented Aug 12, 2019

Terraform Version

Terraform v0.11.14 ( via Visual Studio Team Services extension)

Affected Resource(s)

Provider grafana

Terraform Configuration Files

provider "grafana" {
  version = "~> 1.5.0"
  alias    = "default"
  url       = "${var.grafana_url}"
  auth    = "${var.grafana_auth_token}"
}

Debug Output

Debug output from Plan: https://github.com/ocastle/gist/blob/master/grafana-provider.gist

Expected Behavior

Access to the Grafana API granted using the 'url' and 'auth' values provided.

Testing the auth token/url combination I was able to confirm that the api is accessible and working.

Working command:

curl -k -X GET 'https://my_url/api/folders' -H "Authorization: Bearer **************"

Actual Behavior

Referenced tf variables are set, but the provider.grafana prompts for .auth

provider.grafana.auth‌
  Credentials for accessing the Grafana API.

  Enter a Value:

[DEBUG] command: asking for input: "provider.grafana.auth"

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply

Important Factoids

Visual Studio Team Services task extension to call terraform commands.

References

Not explicitly encountering this behavior that I found.

@ocastle ocastle closed this as completed Aug 12, 2019
@ocastle
Copy link
Author

ocastle commented Aug 12, 2019

The issue was stemmed by use of a defined provider alias. The alias was missing from resource and did not pick up the auth values set against the provider.

Resolution: (Add to grafana resources in terraform matching alias of provider definition)

provider = "grafana.default"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant