-
Notifications
You must be signed in to change notification settings - Fork 949
[FEAT]: Support app auth and PAT via two provider instances #1537
Copy link
Copy link
Closed
Labels
Status: TriageThis is being looked at and prioritizedThis is being looked at and prioritizedType: FeatureNew feature or requestNew feature or request
Description
Describe the need
I'd like to be able to instantiate the GitHub provider twice. One instance uses app auth. The other instance uses personal access token (PAT) auth.
The code that I'd like to write looks like this:
provider "github" { # Uses GITHUB_APP_... env vars
app_auth {}
}
provider "github" { # Uses GITHUB_TOKEN env var
alias = "pat"
}The first provider block errors because, although I'm not explicitly setting the token argument, it is set implicitly due to the existence of the env var GITHUB_TOKEN.
Desired behavior:
app_auth {}block set => Provider uses theGITHUB_APP_...env vars (currently the case*), ignoresGITHUB_TOKENenv var (new)app_auth {}block not set => Provider uses theGITHUB_TOKENenv var (currently the case*), ignoresGITHUB_APP_...env vars (currently the case*)
* I manually confirmed these statements about current behavior. In particular, the GITHUB_APP_... env vars are really ignored unless the app_auth {} block is set.
SDK Version
No response
API Version
No response
Relevant log output
│ Error: "app_auth": conflicts with token
│
│ with provider["registry.terraform.io/hashicorp/github"],
│ on main.tf line 1, in provider "github":
│ 1: provider "github" {
│Code of Conduct
- I agree to follow this project's Code of Conduct
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Status: TriageThis is being looked at and prioritizedThis is being looked at and prioritizedType: FeatureNew feature or requestNew feature or request
Type
Projects
Status
✅ Done