-
Notifications
You must be signed in to change notification settings - Fork 12
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
go provider/user_resource: owner account_access #135
go provider/user_resource: owner account_access #135
Conversation
I am experiencing an issue after Account Owners have been assigned to my account. I change the account_access for the users that are now AccountOwners from 'admin' --> 'owner' but terraform is complaining with: │ Error: Invalid Attribute Value Match | Attribute account_access value must be one of: ['admin' 'developer' 'read'], got: 'owner' If I don't do this, then our terraform consistently fails because Temporal reports these users as owners but our tf state has no drifted from what is actually in cloud. This commit adds 'owner' as a valid value for the user.account_access attribute to fix this.
@jroof88 TY for the contribution and PR. I'm going to fork this and test out locally. 2 items:
|
|
Hi, After testing this locally, it fails because the underlying API does not allow a user/service account to be updated/created with account owner. Instead of adding this as an option for account_access, are you able to import existing Account Owners? For example Our docs on import are admittedly not that helpful and we'll file an issue to improve those. The import process requires
This PR could be ported to add support for the financeadmin role. That is optional as it's not clear that is helpful for you. If you would be willing to do this, here are the recommended changes:
|
I am going to skip adding FinanceAdmin support cause it's not particularly useful to us right now. The import solution feels only halfway there but is that the only option? If we implement it that way, we will have to:
And by doing this, the actual terraform file will still have my user marked as I'm curious where the gap is in being able to assign Account Owner as a role programmatically? |
Hi, The gap is actually policy, it was a deliberate design choice by Temporal. IIUC, because the Account Owner role is designed to have the highest level of permissions, Temporal made the decision to create a human-in-the-loop step as way to mitigate potential malicious behavior associated with undesired credential access or provisioning of the role. For context, we are sharing this feedback with the team that manages RBAC for Temporal to share the experience and challenge created with TF use. TY for this use case - Is this accurate:
|
Hi Jack, TY for your patience. After testing the scenario again, I'm +1 to this approach given the hard rule on Account Owners. While we can add this owner to account_access it can only be used in import scenarios and will fail in others. I'll start a review for the PR now |
internal/provider/user_resource.go
Outdated
@@ -108,10 +108,10 @@ func (r *userResource) Schema(ctx context.Context, _ resource.SchemaRequest, res | |||
}, | |||
"account_access": schema.StringAttribute{ | |||
CustomType: internaltypes.CaseInsensitiveStringType{}, | |||
Description: "The role on the account. Must be one of [admin, developer, read] (case-insensitive)", | |||
Description: "The role on the account. Must be one of [owner, admin, developer, read] (case-insensitive)", |
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 add a comment that owner can only be used for import purposes. Users will receive an error if they try to create or update a user with owner as this role can only be assigned by Temporal.
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.
@jroof88 Did you see this item by chance?
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.
made the small doc changes and merging now. TY again for the contribution.
test suite passed locally, doesn't run for outside contributions yet due to #131 merging |
Hi @jlacefie! I was on vacation the past week and a half. Thank you so much for getting this through. Very much appreciated. I will close out the corresponding support ticket. |
This commit adds 'owner' as a valid value for the user.account_access attribute to fix this.
What was changed
Added
owner
field touser_resource.account_access
possible options.Why?
I am experiencing an issue after Account Owners have been assigned to my account. I change the account_access for the users that are now AccountOwners from 'admin' --> 'owner' but terraform is complaining with:
If I don't do this, then our terraform consistently fails because Temporal reports these users as owners but our tf state has no drifted from what is actually in cloud.
Checklist
Closes [Bug] Update user resource to accept the new finadmin and account owner roles #132
How was this tested:
✅ Unit Tests
⏲️ Would need someone else to run integration tests with the setup
Any docs updates needed?
I updated the tf documentation with: