From 5a3b1ccaf703db260ba25e564c04506ea0de6247 Mon Sep 17 00:00:00 2001 From: Pavel Boldyrev <627562+bpg@users.noreply.github.com> Date: Sat, 5 Aug 2023 18:57:08 -0400 Subject: [PATCH] fix(user): make `password` attribute optional (#463) --- docs/resources/virtual_environment_user.md | 2 +- proxmoxtf/resource/user.go | 2 +- proxmoxtf/resource/user_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/resources/virtual_environment_user.md b/docs/resources/virtual_environment_user.md index e3e69428..3f3ba774 100644 --- a/docs/resources/virtual_environment_user.md +++ b/docs/resources/virtual_environment_user.md @@ -49,7 +49,7 @@ resource "proxmox_virtual_environment_role" "operations_monitoring" { - `groups` - (Optional) The user's groups. - `keys` - (Optional) The user's keys. - `last_name` - (Optional) The user's last name. -- `password` - (Required) The user's password. +- `password` - (Optional) The user's password. Required for PVE or PAM realms. - `user_id` - (Required) The user identifier. ## Attribute Reference diff --git a/proxmoxtf/resource/user.go b/proxmoxtf/resource/user.go index 50e45d70..a8f00f62 100644 --- a/proxmoxtf/resource/user.go +++ b/proxmoxtf/resource/user.go @@ -131,7 +131,7 @@ func User() *schema.Resource { mkResourceVirtualEnvironmentUserPassword: { Type: schema.TypeString, Description: "The user's password", - Required: true, + Optional: true, }, mkResourceVirtualEnvironmentUserUserID: { Type: schema.TypeString, diff --git a/proxmoxtf/resource/user_test.go b/proxmoxtf/resource/user_test.go index f570d889..d5122fd9 100644 --- a/proxmoxtf/resource/user_test.go +++ b/proxmoxtf/resource/user_test.go @@ -31,7 +31,6 @@ func TestUserSchema(t *testing.T) { s := User() test.AssertRequiredArguments(t, s, []string{ - mkResourceVirtualEnvironmentUserPassword, mkResourceVirtualEnvironmentUserUserID, }) @@ -45,6 +44,7 @@ func TestUserSchema(t *testing.T) { mkResourceVirtualEnvironmentUserGroups, mkResourceVirtualEnvironmentUserKeys, mkResourceVirtualEnvironmentUserLastName, + mkResourceVirtualEnvironmentUserPassword, }) test.AssertValueTypes(t, s, map[string]schema.ValueType{