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
feat: Add scoped user role resource #154
feat: Add scoped user role resource #154
Conversation
octopusdeploy/schema_team.go
Outdated
Type: schema.TypeSet, | ||
}, | ||
"user_role_id": { | ||
Type: schema.TypeString, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In UI we can add multiple roles in team, here we are are giving access to single user role id.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "user_role" property of the team is a Set. Terraform for it would look like
resource "octopusdeploy_team" "this" {
name = "Example"
user_role {
user_role_id = "userrole-1"
space_id = "Spaces-1"
}
user_role {
user_role_id = "userrole-2"
space_id = "Spaces-1"
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When this will be available?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ajaychoudhary-bcg I'll try to have this PR ready for review by the end of the week. I've been doing these changes in my free time. Everything is merged on the api library side so I need to rebase with upstream and write tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@evan-cleary Please merge and create new version so that we can use it.
2acba2d
to
9f0b4cd
Compare
fee8743
to
4b2b7e8
Compare
4b2b7e8
to
6726f22
Compare
@jbristowe this PR is ready for review |
Any Update on this? |
Any update, we are waiting for this to be available from few weeks. |
@jbristowe @evan-cleary Any update on this? |
…rm-provider-octopusdeploy into feat-scoped-user-role-resource
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please merge and provide new version
@jbristowe Should be good to go now for the data object |
🎉 Thank you! |
Scoped User Role
User Roles can be defined on either the team resource, or managed as separate resource.
When used in combination any additional scoped user roles assigned to a team that are not defined within the team def would be removed upon apply. If roles are going to be modified from a non central location, the individual resource method should be utilized.
New resource: octopusdeploy_scoped_user_role
Modify Resource: octopusdeploy_team add block property "user_role"
Known Issues
Due to the necessity of including the "computed" attribute on the team
user_role
attribute, there is a standing bug when removing all user roles from a team. If all entries are removed at once, none will be deleted. If all but 1 are removed from the config, all those removed will be properly deleted. This can, of course, be manually cleaned up at a later point.This bug stems from the inability to detect if a value is coming from the config or if it's computed. If we had the ability to determine if contents were coming through as computed, these could be compared against previous state and properly cleared.
Progress
octopusdeploy_scoped_used_role
resource createdoctopusdeploy_team
resourceDepends On: OctopusDeploy/go-octopusdeploy#52
Closes #150