terraform-provider-sentry
terraform-provider-sentry copied to clipboard
How to add member to a team
Hey! Thanks a lot for your sentry terraform provider - great stuff. I managed to setup a team. But unfortunately I couldn't figure out how to add member to it. Reading code I couldn't find anything. So am I right this isn't currently supported? Could you give me some hints, I'm happy to implement it!
@rngtng it doesn’t look like sentry api supports user management (unless I missed it): https://docs.sentry.io/api/
Until that happens there isn’t really a way to do it with Tf.
Oh you got a point there :) I thought they would support it - Bummer :(
There's only a get endpoint https://github.com/getsentry/sentry/blob/c212a9a0e0dc5342e9aa580c953492091b69114c/src/sentry/api/endpoints/team_members.py, but indeed no post :(
Weird this endpoint isn't event documented..
hm but what is this: https://github.com/getsentry/sentry/pull/6445 see https://github.com/getsentry/sentry/blob/master/src/sentry/api/endpoints/organization_member_details.py#L133 -> it takes a teams
value? I need to dig deeper into code.. sigh
Looks like that allows you to add members to teams, but not create, as far as I can tell. There's also this: https://github.com/getsentry/sentry/blob/master/src/sentry/api/endpoints/user_details.py#L67-L91
However that also looks like just an update of an existing user rather than create? Might be worth opening a support ticket w/ Sentry or something to ask.
Asked on the #sentry forum: https://forum.sentry.io/t/api-how-to-create-add-member-to-a-team/2956
Just adding members to team would already help us, as in our current setup, member self-signup via the github integration.
Sorry for bumping a very old thread, but I'm new to the Sentry API. Does this code mean that this is now (or could now be) supported? https://github.com/getsentry/sentry/blob/master/src/sentry/api/endpoints/organization_member_index.py#L168
Sorry for bumping a very old thread, but I'm new to the Sentry API. Does this code mean that this is now (or could now be) supported? https://github.com/getsentry/sentry/blob/master/src/sentry/api/endpoints/organization_member_index.py#L168
This doesn't appear to really give you the semantics you'd want out of a construct for assigning and reassigning team membership. Basically this acts first and foremost as a means to invite someone to the organization and as a secondary concern assigning teams. Once you've called this action once, subsequent calls yield a 409
indicating that the member already exists (in the organization). What I think we're all after is something that allows you to easily manage team member assignments in an ad-hoc fashion.
Would also be very interested in this! Any viable workarounds?
@jareware did you find anything here? @jianyuan are you tracking this / looking to add this functionality in the future if / when Sentry does support it?
@Gowiem sadly no, ended up just doing this outside Terraform. 😕
It looks like there is now a Beta for SCIM support, which appears to include adding members to a team Sentry API SCIM (Beta)
Would https://github.com/jianyuan/terraform-provider-sentry/pull/138 solve this?
This is now possible since v0.10.0.
Hi @jianyuan :). Do you have any plans to allow to add the possibility to add already existing organization member to a team? the provided sentry_organization_member
requires to have a token with Owner
role since it is mean to add a member to the organization, but I am looking for the way to add already existing organization members into a team, this requires only Admin
role.
If not. could you give me some hints on how to start working on that? I'm happy to contribute! by inspecting the request fron sentry ui i see it POST to https://sentry.io/api/0/organizations/{my-organization}/members/{member-id-to-be-added}/teams/{my-team}/
@jianyuan We have LDAP integration, and a user is automatically added to the org. And there is no possibility to add the user to the team via terraform. Performing import for each user doesn't look good to me