Skip to content

Commit

Permalink
Fix issues with vaultwarden_organization_user resource attributes o…
Browse files Browse the repository at this point in the history
…n update
  • Loading branch information
ottramst committed Nov 25, 2024
1 parent 1dbbe58 commit 734f4de
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## [Unreleased]

## v0.4.4

* Fix issues with `vaultwarden_organization_user` resource attributes on update

## v0.4.3

* Add `access_all` attribute to `vaultwarden_organization_user` resource
Expand Down
1 change: 1 addition & 0 deletions docs/resources/organization_user.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ resource "vaultwarden_organization_user" "example" {

### Optional

- `access_all` (Boolean) Whether the user has access to all collections in the organization. Defaults to `false`
- `type` (String) The role type of the user (Owner, Admin, User, Manager). Defaults to `User`

### Read-Only
Expand Down
12 changes: 11 additions & 1 deletion internal/provider/resource_organization_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,23 @@ func (r *OrganizationUser) Schema(ctx context.Context, req resource.SchemaReques
Computed: true,
MarkdownDescription: "ID of the invited user",
PlanModifiers: []planmodifier.String{
stringplanmodifier.RequiresReplace(),
stringplanmodifier.UseStateForUnknown(),
},
},
"organization_id": schema.StringAttribute{
MarkdownDescription: "ID of the organization to invite the user to",
Required: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.UseStateForUnknown(),
stringplanmodifier.RequiresReplace(),
},
},
"email": schema.StringAttribute{
MarkdownDescription: "The email of the user to invite",
Required: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.UseStateForUnknown(),
},
},
"type": schema.StringAttribute{
MarkdownDescription: "The role type of the user (Owner, Admin, User, Manager). Defaults to `User`",
Expand All @@ -87,6 +94,9 @@ func (r *OrganizationUser) Schema(ctx context.Context, req resource.SchemaReques
Validators: []validator.String{
stringvalidator.OneOf("Revoked", "Invited", "Accepted", "Confirmed"),
},
PlanModifiers: []planmodifier.String{
stringplanmodifier.UseStateForUnknown(),
},
},
},
}
Expand Down

0 comments on commit 734f4de

Please sign in to comment.