hashicorp / hashicorp/terraform-plugin-sdk

Make provider configuration available prior to GetSchema call

Open
#281 4 comments 4 reactions 0 assignees View on GitHub
enhancement upstream-protocol
Dominant language
Go
Stars
485
Forks
244
Avg merge
19h 57m
Merged PRs (30d)
4

Description

### SDK version
```
v1.4.0
```

### Use-cases
When working with large or more complicated providers, it would be very helpful to have the provider configuration attributes available during the schema gathering phase. Being able to make some slight adjustments to the schema based on the config opens up some possibilities that I am currently implementing through other means. For example, enabling premium vs. regular API's, or turning off resources that aren't desired to improve loading time. (The loading time in particular is a struggle because a plugin is invoked repeatedly during a normal run.)

### Attempted Solutions
An available workaround is to use environment variables to provide configuration options to the provider, which involves duplicating the options in the terraform configuration and also means validation of the options has to be done separately.

### Proposal
While it would be nice to have the provider configured in full prior to the initial calls, this would have to be optional since many providers expect to do slower initialization work during that process. Instead it would be great to just have the configuration attributes as specified in the terraform configuration made available ahead of time, so that they can be actionable in both the GetSchema and provider configuration phases.

### References
I wasn't able to find an existing request of this nature.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.