splunk / terraform-provider-splunk

Terraform Provider for Splunk
Mozilla Public License 2.0
102 stars 75 forks source link

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

Open or-shachar opened 6 months ago

or-shachar commented 6 months ago

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)