Skip to content

Commit 734f4de

Browse files
committed
Fix issues with vaultwarden_organization_user resource attributes on update
1 parent 1dbbe58 commit 734f4de

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
## [Unreleased]
22

3+
## v0.4.4
4+
5+
* Fix issues with `vaultwarden_organization_user` resource attributes on update
6+
37
## v0.4.3
48

59
* Add `access_all` attribute to `vaultwarden_organization_user` resource

docs/resources/organization_user.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ resource "vaultwarden_organization_user" "example" {
3434

3535
### Optional
3636

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

3940
### Read-Only

internal/provider/resource_organization_user.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,23 @@ func (r *OrganizationUser) Schema(ctx context.Context, req resource.SchemaReques
5555
Computed: true,
5656
MarkdownDescription: "ID of the invited user",
5757
PlanModifiers: []planmodifier.String{
58-
stringplanmodifier.RequiresReplace(),
58+
stringplanmodifier.UseStateForUnknown(),
5959
},
6060
},
6161
"organization_id": schema.StringAttribute{
6262
MarkdownDescription: "ID of the organization to invite the user to",
6363
Required: true,
64+
PlanModifiers: []planmodifier.String{
65+
stringplanmodifier.UseStateForUnknown(),
66+
stringplanmodifier.RequiresReplace(),
67+
},
6468
},
6569
"email": schema.StringAttribute{
6670
MarkdownDescription: "The email of the user to invite",
6771
Required: true,
72+
PlanModifiers: []planmodifier.String{
73+
stringplanmodifier.UseStateForUnknown(),
74+
},
6875
},
6976
"type": schema.StringAttribute{
7077
MarkdownDescription: "The role type of the user (Owner, Admin, User, Manager). Defaults to `User`",
@@ -87,6 +94,9 @@ func (r *OrganizationUser) Schema(ctx context.Context, req resource.SchemaReques
8794
Validators: []validator.String{
8895
stringvalidator.OneOf("Revoked", "Invited", "Accepted", "Confirmed"),
8996
},
97+
PlanModifiers: []planmodifier.String{
98+
stringplanmodifier.UseStateForUnknown(),
99+
},
90100
},
91101
},
92102
}

0 commit comments

Comments
 (0)