We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug
I've just started using this provider, thanks for your work.
When I import a role or group, the resource is forced to be replaced, because the role_id or group_id is imported with a value of null.
role_id
group_id
null
To Reproduce Steps to reproduce the behavior:
resource "proxmox_virtual_environment_role" "pve-admin" { role_id = "PVEAdmin" privileges = [ ] }
terraform import proxmox_virtual_environment_role.pve-admin PVEAdmin
terraform plan
# proxmox_virtual_environment_role.pve-admin must be replaced -/+ resource "proxmox_virtual_environment_role" "pve-admin" { ~ id = "PVEAdmin" -> (known after apply) ~ privileges = [ - "Datastore.Allocate", - "Datastore.AllocateSpace", - "Datastore.AllocateTemplate", - "Datastore.Audit", - "Group.Allocate", - "Mapping.Audit", - "Mapping.Use", - "Pool.Allocate", - "Pool.Audit", - "Realm.AllocateUser", - "SDN.Allocate", - "SDN.Audit", - "SDN.Use", - "Sys.Audit", - "Sys.Console", - "Sys.Syslog", - "User.Modify", - "VM.Allocate", - "VM.Audit", - "VM.Backup", - "VM.Clone", - "VM.Config.CDROM", - "VM.Config.CPU", - "VM.Config.Cloudinit", - "VM.Config.Disk", - "VM.Config.HWType", - "VM.Config.Memory", - "VM.Config.Network", - "VM.Config.Options", - "VM.Console", - "VM.Migrate", - "VM.PowerMgmt", - "VM.Snapshot", - "VM.Snapshot.Rollback", # (1 unchanged element hidden) ] + role_id = "PVEAdmin" # forces replacement } Plan: 1 to add, 0 to change, 1 to destroy.
import
{ "mode": "managed", "type": "proxmox_virtual_environment_role", "name": "pve-admin", "provider": "provider[\"registry.terraform.io/bpg/proxmox\"]", "instances": [ { "schema_version": 0, "attributes": { "id": "PVEAdmin", "privileges": [ "Datastore.Allocate", "Datastore.AllocateSpace", "Datastore.AllocateTemplate", "Datastore.Audit", "Group.Allocate", "Mapping.Audit", "Mapping.Use", "Pool.Allocate", "Pool.Audit", "Realm.AllocateUser", "SDN.Allocate", "SDN.Audit", "SDN.Use", "Sys.Audit", "Sys.Console", "Sys.Syslog", "User.Modify", "VM.Allocate", "VM.Audit", "VM.Backup", "VM.Clone", "VM.Config.CDROM", "VM.Config.CPU", "VM.Config.Cloudinit", "VM.Config.Disk", "VM.Config.HWType", "VM.Config.Memory", "VM.Config.Network", "VM.Config.Options", "VM.Console", "VM.Migrate", "VM.Monitor", "VM.PowerMgmt", "VM.Snapshot", "VM.Snapshot.Rollback" ], "role_id": null }, "sensitive_attributes": [], } ] }
note the: "role_id": null bit.
"role_id": null
Please also provide a minimal Terraform configuration that reproduces the issue.
See above
Expected behavior
I expected the role or group would not need to be replaced.
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Add any other context about the problem here.
TF_LOG=DEBUG terraform apply
$ TF_LOG=DEBUG terraform import proxmox_virtual_environment_role.ad8-user AD8User 2024-04-11T15:34:52.503+1000 [INFO] Terraform version: 1.7.5 2024-04-11T15:34:52.503+1000 [DEBUG] using github.com/hashicorp/go-tfe v1.41.0 2024-04-11T15:34:52.503+1000 [DEBUG] using github.com/hashicorp/hcl/v2 v2.19.1 2024-04-11T15:34:52.503+1000 [DEBUG] using github.com/hashicorp/terraform-svchost v0.1.1 2024-04-11T15:34:52.503+1000 [DEBUG] using github.com/zclconf/go-cty v1.14.1 2024-04-11T15:34:52.503+1000 [INFO] Go runtime version: go1.21.8 2024-04-11T15:34:52.503+1000 [INFO] CLI args: []string{"terraform", "import", "proxmox_virtual_environment_role.ad8-user", "AD8User"} 2024-04-11T15:34:52.503+1000 [DEBUG] Attempting to open CLI config file: /home/user/.terraformrc 2024-04-11T15:34:52.503+1000 [DEBUG] File doesn't exist, but doesn't need to. Ignoring. 2024-04-11T15:34:52.503+1000 [INFO] Loading CLI configuration from /home/user/.terraform.d/credentials.tfrc.json 2024-04-11T15:34:52.503+1000 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins 2024-04-11T15:34:52.503+1000 [DEBUG] ignoring non-existing provider search directory /home/user/.terraform.d/plugins 2024-04-11T15:34:52.503+1000 [DEBUG] ignoring non-existing provider search directory /home/user/.local/share/terraform/plugins 2024-04-11T15:34:52.503+1000 [DEBUG] ignoring non-existing provider search directory /usr/share/gnome/terraform/plugins 2024-04-11T15:34:52.503+1000 [DEBUG] ignoring non-existing provider search directory /usr/local/share/terraform/plugins 2024-04-11T15:34:52.503+1000 [DEBUG] ignoring non-existing provider search directory /usr/share/terraform/plugins 2024-04-11T15:34:52.503+1000 [DEBUG] ignoring non-existing provider search directory /var/lib/snapd/desktop/terraform/plugins 2024-04-11T15:34:52.503+1000 [DEBUG] ignoring non-existing provider search directory /home/user/.local/share/terraform/plugins 2024-04-11T15:34:52.504+1000 [INFO] CLI command args: []string{"import", "proxmox_virtual_environment_role.ad8-user", "AD8User"} 2024-04-11T15:34:52.508+1000 [DEBUG] Service discovery for app.terraform.io at https://app.terraform.io/.well-known/terraform.json 2024-04-11T15:34:54.403+1000 [DEBUG] Service discovery for app.terraform.io aliased as localterraform.com 2024-04-11T15:34:54.431+1000 [DEBUG] checking for provisioner in "." 2024-04-11T15:34:54.438+1000 [DEBUG] checking for provisioner in "/usr/bin" 2024-04-11T15:34:57.160+1000 [DEBUG] Building and walking import graph 2024-04-11T15:34:57.161+1000 [DEBUG] ProviderTransformer: "proxmox_virtual_environment_group.app-vmhost-admin (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/bpg/proxmox"] 2024-04-11T15:34:57.161+1000 [DEBUG] ProviderTransformer: "proxmox_virtual_environment_pool.vdi-workspaces (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/bpg/proxmox"] 2024-04-11T15:34:57.161+1000 [DEBUG] ProviderTransformer: "proxmox_virtual_environment_role.pve-admin (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/bpg/proxmox"] 2024-04-11T15:34:57.161+1000 [DEBUG] ProviderTransformer: "proxmox_virtual_environment_role.ad8-user (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/bpg/proxmox"] 2024-04-11T15:34:57.161+1000 [DEBUG] created provider logger: level=debug 2024-04-11T15:34:57.161+1000 [INFO] provider: configuring client automatic mTLS 2024-04-11T15:34:57.183+1000 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/bpg/proxmox/0.53.0/linux_amd64/terraform-provider-proxmox_v0.53.0 args=[".terraform/providers/registry.terraform.io/bpg/proxmox/0.53.0/linux_amd64/terraform-provider-proxmox_v0.53.0"] 2024-04-11T15:34:57.183+1000 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/bpg/proxmox/0.53.0/linux_amd64/terraform-provider-proxmox_v0.53.0 pid=2400508 2024-04-11T15:34:57.183+1000 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/bpg/proxmox/0.53.0/linux_amd64/terraform-provider-proxmox_v0.53.0 2024-04-11T15:34:57.191+1000 [INFO] provider.terraform-provider-proxmox_v0.53.0: configuring server automatic mTLS: timestamp="2024-04-11T15:34:57.190+1000" 2024-04-11T15:34:57.211+1000 [DEBUG] provider.terraform-provider-proxmox_v0.53.0: plugin address: address=/tmp/user/1000/plugin2530040468 network=unix timestamp="2024-04-11T15:34:57.210+1000" 2024-04-11T15:34:57.211+1000 [DEBUG] provider: using plugin: version=6 2024-04-11T15:34:57.252+1000 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF" 2024-04-11T15:34:57.253+1000 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/bpg/proxmox/0.53.0/linux_amd64/terraform-provider-proxmox_v0.53.0 pid=2400508 2024-04-11T15:34:57.253+1000 [DEBUG] provider: plugin exited 2024-04-11T15:34:57.253+1000 [DEBUG] ReferenceTransformer: "proxmox_virtual_environment_group.app-vmhost-admin (expand)" references: [] 2024-04-11T15:34:57.253+1000 [DEBUG] ReferenceTransformer: "proxmox_virtual_environment_pool.vdi-workspaces (expand)" references: [] 2024-04-11T15:34:57.253+1000 [DEBUG] ReferenceTransformer: "proxmox_virtual_environment_role.pve-admin (expand)" references: [] 2024-04-11T15:34:57.253+1000 [DEBUG] ReferenceTransformer: "proxmox_virtual_environment_role.ad8-user (expand)" references: [] 2024-04-11T15:34:57.254+1000 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/bpg/proxmox\"]" references: [] 2024-04-11T15:34:57.255+1000 [DEBUG] Starting graph walk: walkImport 2024-04-11T15:34:57.256+1000 [DEBUG] created provider logger: level=debug 2024-04-11T15:34:57.256+1000 [INFO] provider: configuring client automatic mTLS 2024-04-11T15:34:57.264+1000 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/bpg/proxmox/0.53.0/linux_amd64/terraform-provider-proxmox_v0.53.0 args=[".terraform/providers/registry.terraform.io/bpg/proxmox/0.53.0/linux_amd64/terraform-provider-proxmox_v0.53.0"] 2024-04-11T15:34:57.264+1000 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/bpg/proxmox/0.53.0/linux_amd64/terraform-provider-proxmox_v0.53.0 pid=2400536 2024-04-11T15:34:57.264+1000 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/bpg/proxmox/0.53.0/linux_amd64/terraform-provider-proxmox_v0.53.0 2024-04-11T15:34:57.271+1000 [INFO] provider.terraform-provider-proxmox_v0.53.0: configuring server automatic mTLS: timestamp="2024-04-11T15:34:57.270+1000" 2024-04-11T15:34:57.289+1000 [DEBUG] provider.terraform-provider-proxmox_v0.53.0: plugin address: address=/tmp/user/1000/plugin1849542804 network=unix timestamp="2024-04-11T15:34:57.288+1000" 2024-04-11T15:34:57.289+1000 [DEBUG] provider: using plugin: version=6 2024-04-11T15:34:57.313+1000 [INFO] provider.terraform-provider-proxmox_v0.53.0: Configuring the Proxmox provider...: tf_mux_provider="*proto6server.Server" tf_provider_addr=registry.terraform.io/bpg/proxmox @module=proxmox tf_req_id=7b3507eb-1293-9441-f79a-54445b09e69e tf_rpc=ConfigureProvider @caller=github.com/bpg/terraform-provider-proxmox/fwprovider/provider.go:229 timestamp="2024-04-11T15:34:57.313+1000" 2024-04-11T15:34:57.314+1000 [DEBUG] ReferenceTransformer: "proxmox_virtual_environment_group.app-vmhost-admin" references: [] 2024-04-11T15:34:57.315+1000 [DEBUG] ReferenceTransformer: "proxmox_virtual_environment_role.pve-admin" references: [] 2024-04-11T15:34:57.315+1000 [DEBUG] ReferenceTransformer: "proxmox_virtual_environment_pool.vdi-workspaces" references: [] 2024-04-11T15:34:57.315+1000 [DEBUG] ReferenceTransformer: "proxmox_virtual_environment_role.ad8-user (import id \"AD8User\")" references: [] 2024-04-11T15:34:57.323+1000 [DEBUG] provider.terraform-provider-proxmox_v0.53.0: Sending authentication request: tf_resource_type=proxmox_virtual_environment_role @module=proxmox path=/api2/json/access/ticket tf_mux_provider=tf5to6server.v5tov6Server tf_provider_addr=registry.terraform.io/bpg/proxmox tf_req_id=3b46e61a-9be2-50f8-4bc4-489da87f43b8 tf_rpc=ReadResource @caller=github.com/bpg/terraform-provider-proxmox/proxmox/api/ticket_auth.go:71 timestamp="2024-04-11T15:34:57.322+1000" 2024-04-11T15:34:57.323+1000 [DEBUG] provider.terraform-provider-proxmox_v0.53.0: Sending HTTP Request: User-Agent=Go-http-client/1.1 tf_provider_addr=registry.terraform.io/bpg/proxmox Content-Type=application/x-www-form-urlencoded Host=example.pvehost.com:8006 tf_http_req_method=POST tf_mux_provider=tf5to6server.v5tov6Server @module=proxmox tf_http_req_body="username=root%40pam&password=redacted" Content-Length=43 tf_http_op_type=request tf_http_req_uri=/api2/json/access/ticket tf_http_req_version=HTTP/1.1 tf_http_trans_id=be1773ca-0e2c-3cbf-1d27-fb0fc41ced5a tf_rpc=ReadResource Accept-Encoding=gzip tf_req_id=3b46e61a-9be2-50f8-4bc4-489da87f43b8 tf_resource_type=proxmox_virtual_environment_role @caller=github.com/hashicorp/terraform-plugin-sdk/v2@v2.33.0/helper/logging/logging_http_transport.go:162 timestamp="2024-04-11T15:34:57.323+1000" 2024-04-11T15:34:57.409+1000 [DEBUG] provider.terraform-provider-proxmox_v0.53.0: Received HTTP Response: Content-Type=application/json;charset=UTF-8 Pragma=no-cache tf_http_res_status_code=200 tf_provider_addr=registry.terraform.io/bpg/proxmox tf_resource_type=proxmox_virtual_environment_role Date="Thu, 11 Apr 2024 05:34:57 GMT" tf_http_res_body="{\"data\":{\"cap\":{\"storage\":{\"Datastore.Audit\":1,\"Datastore.AllocateTemplate\":1,\"Permissions.Modify\":1,\"Datastore.Allocate\":1,\"Datastore.AllocateSpace\":1},\"dc\":{\"SDN.Audit\":1,\"SDN.Allocate\":1,\"Sys.Audit\":1,\"Sys.Modify\":1,\"SDN.Use\":1},\"nodes\":{\"Sys.Syslog\":1,\"Permissions.Modify\":1,\"Sys.AccessNetwork\":1,\"Sys.PowerMgmt\":1,\"Sys.Modify\":1,\"Sys.Incoming\":1,\"Sys.Console\":1,\"Sys.Audit\":1},\"mapping\":{\"Permissions.Modify\":1,\"Mapping.Use\":1,\"Mapping.Modify\":1,\"Mapping.Audit\":1},\"access\":{\"User.Modify\":1,\"Group.Allocate\":1,\"Permissions.Modify\":1},\"sdn\":{\"SDN.Use\":1,\"Permissions.Modify\":1,\"SDN.Audit\":1,\"SDN.Allocate\":1},\"vms\":{\"Permissions.Modify\":1,\"VM.Allocate\":1,\"VM.Config.Memory\":1,\"VM.PowerMgmt\":1,\"VM.Snapshot\":1,\"VM.Monitor\":1,\"VM.Clone\":1,\"VM.Console\":1,\"VM.Config.CDROM\":1,\"VM.Config.Options\":1,\"VM.Snapshot.Rollback\":1,\"VM.Migrate\":1,\"VM.Config.Cloudinit\":1,\"VM.Config.CPU\":1,\"VM.Audit\":1,\"VM.Config.Network\":1,\"VM.Config.Disk\":1,\"VM.Backup\":1,\"VM.Config.HWType\":1}},\"ticket\":\"PVE:root@pam:66177681::G58gV6pPrnkfVnq1SiAQY4lf5nj0awH2wJOWQ02anKzlw2lHdD9Mrz2c7MhCggCzwndvHHLDud4pS8522dbIndW7pwUWFEBA3llQduWth0h0zpTIBYe83w+POD3nHiJLU5RbjXVpaculwKNn7u1C8NegFkCFsHhHiFyD62tQpy2D2MBqF1K2L58fLCl28wNyj91jQZt91Sn/KRVRMbpPS08YnvArjL7JzGNDgus2BFcqTRwFAgfO4z3/npoDmdxTa3aF7gRo+Cc6IUreMN3h4hO+X05GNThM0F1F1dNtkWHEAetWNaMHruhPVsNXoRRowRjoBB6KCDSU+UGJSlvvLg==\",\"username\":\"root@pam\",\"CSRFPreventionToken\":\"66177681:3qnJgHxhnmGi6Uohr0l2TqCxT0FfjgomQoU0A9QDNcA\"}}" tf_http_res_status_reason="200 OK" @caller=github.com/hashicorp/terraform-plugin-sdk/v2@v2.33.0/helper/logging/logging_http_transport.go:162 Expires="Thu, 11 Apr 2024 05:34:57 GMT" Server=pve-api-daemon/3.0 tf_rpc=ReadResource @module=proxmox Cache-Control=max-age=0 tf_http_op_type=response tf_http_res_version=HTTP/1.1 tf_http_trans_id=be1773ca-0e2c-3cbf-1d27-fb0fc41ced5a tf_mux_provider=tf5to6server.v5tov6Server tf_req_id=3b46e61a-9be2-50f8-4bc4-489da87f43b8 timestamp="2024-04-11T15:34:57.409+1000" 2024-04-11T15:34:57.410+1000 [DEBUG] provider.terraform-provider-proxmox_v0.53.0: Sending HTTP Request: Host=example.pvehost.com:8006 tf_http_req_body="" tf_req_id=3b46e61a-9be2-50f8-4bc4-489da87f43b8 tf_resource_type=proxmox_virtual_environment_role tf_rpc=ReadResource @caller=github.com/hashicorp/terraform-plugin-sdk/v2@v2.33.0/helper/logging/logging_http_transport.go:162 @module=proxmox User-Agent=Go-http-client/1.1 tf_mux_provider=tf5to6server.v5tov6Server tf_provider_addr=registry.terraform.io/bpg/proxmox Accept-Encoding=gzip Cookie="PVEAuthCookie=PVE:root@pam:66177681::G58gV6pPrnkfVnq1SiAQY4lf5nj0awH2wJOWQ02anKzlw2lHdD9Mrz2c7MhCggCzwndvHHLDud4pS8522dbIndW7pwUWFEBA3llQduWth0h0zpTIBYe83w+POD3nHiJLU5RbjXVpaculwKNn7u1C8NegFkCFsHhHiFyD62tQpy2D2MBqF1K2L58fLCl28wNyj91jQZt91Sn/KRVRMbpPS08YnvArjL7JzGNDgus2BFcqTRwFAgfO4z3/npoDmdxTa3aF7gRo+Cc6IUreMN3h4hO+X05GNThM0F1F1dNtkWHEAetWNaMHruhPVsNXoRRowRjoBB6KCDSU+UGJSlvvLg==" tf_http_op_type=request tf_http_req_method=GET tf_http_req_uri=/api2/json/access/roles/AD8User Accept=application/json tf_http_req_version=HTTP/1.1 tf_http_trans_id=6788d423-332b-6a90-6d28-028c78d03683 timestamp="2024-04-11T15:34:57.409+1000" 2024-04-11T15:34:57.449+1000 [DEBUG] provider.terraform-provider-proxmox_v0.53.0: Received HTTP Response: tf_http_res_body="{\"data\":{\"VM.Monitor\":1,\"VM.Audit\":1,\"VM.Console\":1,\"VM.PowerMgmt\":1}}" tf_req_id=3b46e61a-9be2-50f8-4bc4-489da87f43b8 tf_resource_type=proxmox_virtual_environment_role Date="Thu, 11 Apr 2024 05:34:57 GMT" Pragma=no-cache Server=pve-api-daemon/3.0 Connection=Keep-Alive Expires="Thu, 11 Apr 2024 05:34:57 GMT" tf_http_trans_id=6788d423-332b-6a90-6d28-028c78d03683 tf_rpc=ReadResource tf_http_res_status_code=200 tf_http_res_version=HTTP/1.1 tf_provider_addr=registry.terraform.io/bpg/proxmox @caller=github.com/hashicorp/terraform-plugin-sdk/v2@v2.33.0/helper/logging/logging_http_transport.go:162 Cache-Control=max-age=0 Content-Length=70 tf_http_op_type=response @module=proxmox Content-Type=application/json;charset=UTF-8 tf_http_res_status_reason="200 OK" tf_mux_provider=tf5to6server.v5tov6Server timestamp="2024-04-11T15:34:57.448+1000" 2024-04-11T15:34:57.450+1000 [WARN] Provider "registry.terraform.io/bpg/proxmox" produced an unexpected new value for proxmox_virtual_environment_role.ad8-user during refresh. - .privileges: was null, but now cty.SetVal([]cty.Value{cty.StringVal("VM.Audit"), cty.StringVal("VM.Console"), cty.StringVal("VM.Monitor"), cty.StringVal("VM.PowerMgmt")}) 2024-04-11T15:34:57.451+1000 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF" 2024-04-11T15:34:57.454+1000 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/bpg/proxmox/0.53.0/linux_amd64/terraform-provider-proxmox_v0.53.0 pid=2400536 2024-04-11T15:34:57.454+1000 [DEBUG] provider: plugin exited 2024-04-11T15:34:57.472+1000 [DEBUG] checking for provisioner in "." 2024-04-11T15:34:57.478+1000 [DEBUG] checking for provisioner in "/usr/bin" 2024-04-11T15:34:57.478+1000 [INFO] Writing state output to: 2024-04-11T15:34:57.478+1000 [DEBUG] cloud/state: state read serial is: 4; serial is: 4 2024-04-11T15:34:57.478+1000 [DEBUG] cloud/state: state read lineage is: 364b2cf9-0454-b1e8-65d9-40c872aa5dd8; lineage is: 364b2cf9-0454-b1e8-65d9-40c872aa5dd8 Import successful! The resources that were imported are shown above. These resources are now in your Terraform state and will henceforth be managed by Terraform.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
I've just started using this provider, thanks for your work.
When I import a role or group, the resource is forced to be replaced, because the
role_id
orgroup_id
is imported with a value ofnull
.To Reproduce
Steps to reproduce the behavior:
terraform import proxmox_virtual_environment_role.pve-admin PVEAdmin
terraform plan
:import
step, I see:note the:
"role_id": null
bit.Please also provide a minimal Terraform configuration that reproduces the issue.
Expected behavior
I expected the role or group would not need to be replaced.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
TF_LOG=DEBUG terraform apply
):I ran an import of another role with debug turned on
The text was updated successfully, but these errors were encountered: