Skip to content

Commit

Permalink
go provider/user_resource: owner account_access (#135)
Browse files Browse the repository at this point in the history
* go provider/user_resource: owner account_access

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.

* added a minor comment to the account_access chema element

* added a minor comment to the user resource doc.

* removed a minor comment to the user resource doc.

* removed a minor comment to the user resource doc.

* removed a minor comment to the user resource doc.

---------

Co-authored-by: Jonathan Lacefield <[email protected]>
  • Loading branch information
jroof88 and jlacefie authored Oct 12, 2024
1 parent 2cc1206 commit 6807ef4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/resources/user.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ resource "temporalcloud_user" "namespace_admin" {

### Required

- `account_access` (String) The role on the account. Must be one of [admin, developer, read] (case-insensitive)
- `account_access` (String) The role on the account. Must be one of [owner, admin, developer, read] (case-insensitive). owner is only valid for import.
- `email` (String) The email address for the user.

### Optional
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/user_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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). owner is only valid for import.",
Required: true,
Validators: []validator.String{
stringvalidator.OneOfCaseInsensitive("admin", "developer", "read"),
stringvalidator.OneOfCaseInsensitive("owner", "admin", "developer", "read"),
},
},
"namespace_accesses": schema.ListNestedAttribute{
Expand Down

0 comments on commit 6807ef4

Please sign in to comment.