Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] databricks_git_credential provide personal_access_token through env variable #1352

Closed
Freia3 opened this issue Jun 3, 2022 · 2 comments · Fixed by #1353
Closed
Labels
feature New feature or request

Comments

@Freia3
Copy link

Freia3 commented Jun 3, 2022

Right now, the databricks_git_credential resource has to be declared like this:

Configuration

resource "databricks_git_credential" "ado" {
  git_username          = "myuser" 
  git_provider          = "azureDevOpsServices"
  personal_access_token = "sometoken"
}

Would it be possible to make personal_access_token optional and if it's not provided, make it look in the environment variables? The personal access token for azure devops is saved in AZDO_PERSONAL_ACCESS_TOKEN and I would like to use this environment variable to declare the databricks_git_credential resource.

@nfx nfx added the feature New feature or request label Jun 3, 2022
@nfx
Copy link
Contributor

nfx commented Jun 3, 2022

@Freia3 it's a very good suggestion, we can definitely pick PAT from the list of environment variables via https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema#MultiEnvDefaultFunc. In order to speed up the implementation of this feature, could you do some research and post here links with findings about which environment variables are commonly used for GH, AzDO, and other typical repo integrations? thanks!

@Freia3
Copy link
Author

Freia3 commented Jun 3, 2022

nfx added a commit that referenced this issue Jun 3, 2022
…ent variables

If no value is given for `personal_access_token` attribute, it's sourced from the first environment variable of GITHUB_TOKEN, GITLAB_TOKEN, or AZDO_PERSONAL_ACCESS_TOKEN that has a non-empty value.

Fixes #1352
nfx added a commit that referenced this issue Jun 3, 2022
…ent variables

If no value is given for `personal_access_token` attribute, it's sourced from the first environment variable of GITHUB_TOKEN, GITLAB_TOKEN, or AZDO_PERSONAL_ACCESS_TOKEN that has a non-empty value.

Fixes #1352
nfx added a commit that referenced this issue Jun 3, 2022
…ent variables

If no value is given for `personal_access_token` attribute, it's sourced from the first environment variable of GITHUB_TOKEN, GITLAB_TOKEN, or AZDO_PERSONAL_ACCESS_TOKEN that has a non-empty value.

Fixes #1352
@nfx nfx closed this as completed in #1353 Jun 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
2 participants