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

FR: Support disabled mode for provider / lazy login only when used

Open or-shachar opened this issue 1 year ago • 0 comments

Hi,

we have the need to use this provider only on certain environment

provider "splunk" {
  url        = try(local.env_url,"")
  auth_token = try(local.auth_token,"")
}

The resources that use that provider use count to make sure that they don't run on the non-supported env.

The problem is that today there's no way to configure the provider with dummy values as it performs the login during the configureProvider method.

Suggestions:

  1. [better] Perform the login only on first usage (lazy login)
  2. [alt] Skip login in case url is empty or introduce a new property called enabled (IMO less preferable)

or-shachar avatar Jan 18 '24 16:01 or-shachar