terraform-provider-pagerduty icon indicating copy to clipboard operation
terraform-provider-pagerduty copied to clipboard

token as an optional field

Open franklad opened this issue 1 year ago • 0 comments

Terraform Version

$ terraform -v
Terraform v1.3.9
on linux_amd64
+ provider registry.terraform.io/pagerduty/pagerduty v2.11.2

Affected Resource(s)

Provider

Terraform Configuration Files

terraform {
  required_providers {
    pagerduty = {
      source  = "pagerduty/pagerduty"
      version = "2.11.2"
    }
  }
}

provider "pagerduty" {
  api_url_override = "http://my-proxy-server.com"
  skip_credentials_validation = true
}

data "pagerduty_user" "me" {
  email = "[email protected]"
}

Expected Behavior

I understand that token is a required field.

However, given that we have skip_credentials_validation, I would expect the provider to have token as an optional field and only return invalidCreds error when the token value is missing and skip_credentials_validation is set to false (default behaviour)

Reason for that is that I have a proxy endpoint (http://my-proxy-server.com) that adds Auth header to the request and sends it to api.pagerduty.com

Current hack is to add token field with a random string.

Other terraform providers (DataDog's provider for example) support this behaviour.

Actual Behavior

Forces to enter a value for token.

Steps to Reproduce

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

  1. terraform plan using the provided snippet

franklad avatar Apr 05 '23 20:04 franklad