-
Notifications
You must be signed in to change notification settings - Fork 138
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] sepearete resource for team membership #65
Comments
@JordanSussman hey could you write what kind of changes make this
I think there is a bug in team resource. Thats shouldnt be a expected behaviour (deleting user) |
Steps to reproduce the deletion of team membership:
|
But that sounds right, when you create team via TF it manages that resource in authoritative way, this means that if anything was 'clicked' additionally it will be reset back to state defined in Terraform. |
I don't disagree that the behavior is expected, however I still want the provider to support this specific use case by providing the resource "opsgenie_user" "first" {
username = "[email protected]"
full_name = "name "
role = "User"
}
resource "opsgenie_user" "second" {
username = "[email protected]"
full_name = "name "
role = "User"
}
resource "opsgenie_team" "test" {
name = "example"
description = "This team deals with all the things"
lifecycle {
ignore_changes = [
member,
]
}
}
resource "opsgenie_team_membership" "first" {
id = "${opsgenie_user.first.id}"
role = "admin"
team = "${opsgenie_team.test.id}"
}
resource "opsgenie_team_membership" "second" {
id = "${opsgenie_user.second.id}"
role = "admin"
team = "${opsgenie_team.test.id}"
} Quite a few other providers provide similar workflows by separateing the high level creation of a resource from the smaller details. For example: aws_volume_attachment. I'm happy to contribute this functionality if the maintainers agree it would be accepted. |
I would very welcome a(ny) change that makes the provider able to ignore team membership. I want TF to create the team, and that's just it. |
I've build a very ugly hack to workaround this -issue- behaviour (simply disable the member attribute at all). @ffahri could you share your opinion to @JordanSussman 's comment please? thx :) |
Hey @arnisoph @JordanSussman
or we introduce new resource for this just for creating and managing teams without looking members
or flag inside team resource such as below example
|
I think having the optional flag "manage_members=false" (member{} is already optional anyway) and providing additional resources like team_membership{} would be the easiest for the users. AWS and GCP already have a similar approach for some time: https://www.terraform.io/docs/providers/google/r/google_project_iam.html#google_project_iam_member-1 |
@ffahri I could prepare PR for that, what do you think? |
I agree with this approach compared to the other options suggested. |
I started to prepare a PR that first adds sth like "manage_members=false" and later a separate PR that adds new resources to maintain team membership. all those changes should be non-breaking for our users. |
Signed-off-by: Arnold Bechtoldt <[email protected]>
@JordanSussman you can find the first PR in #79 . It makes it possible to disable Terraform to maintain team membership. This is useful, if you apply changes via OpsGenie web UI. Would you like to try this PR out? I can provide you the binary if needed. A second PR would add a new resource type for actual team membership. |
Signed-off-by: Arnold Bechtoldt <[email protected]>
@ffahri if this PR is fine and completed/merged I'd continue with the second PR for the new team_membership resource. |
* add optional setting to stop maintaing team members, refs #65 Signed-off-by: Arnold Bechtoldt <[email protected]>
ignore_members flag is in 0.2.9 release. we are waiting for this release. We can this resource to v0.3.0 release. thanks @arnisoph |
@arnisoph for the second pr what is on your mind? |
yes, let's keep backwards compatibility "for some time". I will prepare a second PR soon, too. |
we also have usecase to group multiple users to multiple teams, @arnisoph any update on team_membership resource |
@mrajeshh sorry, I decided not to implement a resource such as team_membership. There's currently no need for that in my current team. |
Expect a PR soon. |
Signed-off-by: Arnold Bechtoldt <[email protected]>
Added PR #156 . I propose deprecating the members attribute in opsgenie_team to avoid confusions about the ignore_members attribute. |
Signed-off-by: Arnold Bechtoldt <[email protected]>
Signed-off-by: Arnold Bechtoldt <[email protected]>
Signed-off-by: Arnold Bechtoldt <[email protected]>
We have another reason to ask for a separate
|
@dreamiurg it's almost done, but I have to touch it again... #167 |
Signed-off-by: Arnold Bechtoldt <[email protected]>
Bit late, but you actually can by using something like this:
|
This would still be a great feature to have in place. We are adopting a 'self-service' model where we want to assign team admins via automation and then allow them to assign team users themselves. But with the current way this works, it's basically impossible using the opsgenie provider. |
@JordanSussman a bit late, but looks like but this comment does not reproduce the bug for me. This is what I get once I follow the steps you have mentioned in the comment. Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are needed.` |
Closing the issue as I was not able to reproduce the issue. Please feel free to raise a new issue if it is still persistent with steps to reproduce the bug. |
Terraform Version
Affected Resource(s)
If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.
Terraform Configuration Files
I'd like to propose a separate resource of
opsgenie_team_membership
instead of relying on utilizingopsgenie_team
for membership. This change would allow us to manage initial team membership Terraform and some further changes done through the UI.Currently, if you make changes through the UI for a team that is managed via Terraform it will attempt to delete users from the team. If we instead utilize
opsgenie_team_membership
to add members to the team it wouldn't need to delete membership at the team level if users are added via the UI.Proposed Terraform Configuration Files
The text was updated successfully, but these errors were encountered: