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 request: Add datasources to get the list of organization members #527

Open
christophe-scalepad opened this issue May 14, 2024 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@christophe-scalepad
Copy link

Hey,

Hope you are doing well.

Description

As a company, we would like to manage RBAC in buildkite (and everywhere else) as IaC using terraform. We are currently missing the possibility to fetch the members of an organization. This would allow us to map our's idp's groups to teams we create in buildkite. Currently with what is available to us, our only option would be to hardcode the user ids in our IaC which we would like to avoid.

This feature is already present in another buildkite provider. This would allow us to fetch the user ids dynamically from buildkite using the data source and create a dynamic map with the users that we got from our idp's group.

I haven't looked in the other providers implementation, but I'm guessing it relies on your API's as well.

wishing you well

@mcncl
Copy link
Contributor

mcncl commented May 15, 2024

Hey there @christophe-scalepad!

Thanks for raising this issue. Sounds like a useful thing we cold add in and shouldn't be too difficult to do; the queries are all available in the API as far as I can tell. We'll plan the work for this, but I can't see it being more that a few days to add in once it's picked up.

Cheers!

@mcncl mcncl added enhancement New feature or request good first issue Good for newcomers labels May 15, 2024
@ianchesal
Copy link

ianchesal commented Jul 23, 2024

Here to +1 this -- this is the missing link between teams and organizing them in Terraform at present. Fetching the UUID for users to add them to teams currently O(hard) to do in any way that isn't incredible fragile.

My ideal interface would be something like:

data buildkite_organization_member "me" {
   slug = "my-org-slug"
   email = "[email protected]"
}

resource "buildkite_team" "some_team" {
   name = "Some Team"
   description = "Some team goes here"
   privacy = "VISIBLE"
   default_team = false
   default_member_role = "MEMBER"
}

resource "buildkite_team_member" "some_team_me" {
   team_id = buildkite_team.some_team.id
   user_id = data.buildkite_organization_member.me.id
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants