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

PAGERDUTY_TOKEN env variable doesn't really work #682

Open
graudeejs opened this issue May 3, 2023 · 4 comments
Open

PAGERDUTY_TOKEN env variable doesn't really work #682

graudeejs opened this issue May 3, 2023 · 4 comments

Comments

@graudeejs
Copy link

Terraform Version

Terraform v1.4.6
on darwin_arm64

  • provider registry.terraform.io/pagerduty/pagerduty v2.14.3

Affected Resource(s)

Provider

Terraform Configuration Files

terraform {
  backend "remote" {
    hostname = "app.terraform.io"
    organization = "example-org"

    workspaces {
      name = "pagerduty"
    }
  }

  required_providers {
    pagerduty = {
      source  = "pagerduty/pagerduty"
      version = "2.14.3"
    }
  }

  required_version = ">= 1.3.9"
}

provider "pagerduty" {
  service_region = "eu"
}

data "pagerduty_user" "example" {
  email = "example@example.com"
}

Debug Output

https://gist.github.com/graudeejs/9c5a265088aef7e3937504d8f7021be6

Expected Behavior

token set in PAGERDUTY_TOKEN environment variable should be used

Actual Behavior

Terraform complains about missing required argument token

Steps to Reproduce

Setup minimal terraform project using PagerDuty. Provide PAGERDUTY_TOKEN as environment variable as mentioned in documentation.

References

@benlangfeld
Copy link

Is there any workaround available for this? It looks like this provider is unusable in GH Actions without this working.

@benlangfeld
Copy link

It looks like this is a usable workaround:

variable "pagerduty_token" {}

provider "pagerduty" {
  token = var.pagerduty_token
}

TF_VAR_pagerduty_token=foobar terraform plan ...

@carusooo
Copy link

The documentation seems to indicate that the token doesn't need to be passed in as plaintext, with no examples, support and it's broken right out of the box.

It can also be sourced from the PAGERDUTY_USER_TOKEN environment variable. See [API Documentation](https://developer.pagerduty.com/docs/ZG9jOjExMDI5NTUx-authentication) for more information.

@benlangfeld
Copy link

Looks like this was fixed in #708. Setting PAGERDUTY_TOKEN works for me now.

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

3 participants