-
Notifications
You must be signed in to change notification settings - Fork 89
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
DXCDT-431: auth0_role_permission
resource
#582
Conversation
# relationship between the user and its roles. | ||
resource auth0_user_roles user_roles { | ||
user_id = auth0_user.user.id | ||
roles = [auth0_role.admin.id] | ||
} | ||
|
||
# Or the auth0_user_roles to manage a 1: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.
Quick fix
…om/auth0/terraform-provider-auth0 into DXCDT-431-role-permission-resource
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #582 +/- ##
==========================================
- Coverage 87.44% 87.26% -0.19%
==========================================
Files 68 69 +1
Lines 10412 10547 +135
==========================================
+ Hits 9105 9204 +99
- Misses 988 1021 +33
- Partials 319 322 +3
|
Config: acctest.ParseTestName(testAccRolePermissionsOneAssigned, strings.ToLower(t.Name())), | ||
}, | ||
{ | ||
RefreshState: true, |
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.
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.
This needs to be here for tests to pass. The data source gets executed after (or at best, during) the deletions of the auth0_role_permission
resources. AFAICT, there is no way to depend on a deleted 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.
Ah, I see that now 👍🏻 , indeed the execution flow on a terraform apply is:
read and refresh state
creations
updates
deletions
so we need another refresh state after the deletion.
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.
💪🏻
🔧 Changes
Introducing the
auth0_role_permission
resource which enables management of role permissions through a 1-1 relationship.This PR shares similarities with the
auth0_user_permission
resource (#574) but with extra considerations for the already-existingpermissions
field on the role resource like the migration guide and deprecation.📚 References
Similar PR: #574
🔬 Testing
Added full suite of integration tests for this resource.
📝 Checklist