feat: Add data source github_users - #900
Merged
jcudit merged 1 commit intoOct 17, 2021
Merged
Conversation
pascal-hofmann
force-pushed
the
feat/data_source_github_users_graphql
branch
3 times, most recently
from
September 7, 2021 16:18
c25a24d to
14a1ba3
Compare
jcudit
reviewed
Sep 28, 2021
jcudit
left a comment
Contributor
There was a problem hiding this comment.
Looking good so far. Can we get the linter warning fixed up?
pascal-hofmann
force-pushed
the
feat/data_source_github_users_graphql
branch
from
September 29, 2021 06:28
14a1ba3 to
26403fb
Compare
Contributor
Author
This should be fixed now. I chose to just ignore the error, because Write never returns one according to the Hash interface. |
jcudit
approved these changes
Oct 17, 2021
jcudit
left a comment
Contributor
There was a problem hiding this comment.
🙇🏾 thanks for this contribution!
kfcampbell
pushed a commit
to kfcampbell/terraform-provider-github
that referenced
this pull request
Jul 26, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds a
github_usersdatasource that allows to check the existence of multiple users at once.loginandnode_idof users that could be found can be accessed vialogins/node_ids.All unknown logins can be accessed via
unknown_logins.Background: Login to our companies internal GitHub Enterprise instance is done via Microsoft Azure AD and users get automatically created once they login for the first time. Unfortunately there is currently no way to check whether a user already exists via terraform. The existing
github_userdata source aborts planning when unknown users are encountered.In order to manage the users team membership via terraform we thus currently have to maintain a separate list of users that exist/do not exist in our GitHub Enterprise instance. This data source would solve this problem, as it offers a way to check for the existence of a given user without bailing out.
Technical details:
The new datasource uses the GraphQL API in order to avoid doing multiple requests.