vultr / terraform-provider-vultr

Terraform Vultr provider
https://www.terraform.io/docs/providers/vultr/
Mozilla Public License 2.0
189 stars 65 forks source link

[BUG] - `acl` in `vultr_user` causes endless updates due to ordering of acls #494

Closed F21 closed 1 month ago

F21 commented 1 month ago

Describe the bug The server returns the ACLs for vultr_user in a certain order, which may differ from the order of the ACLs set to the acl property in the vultr_user resources. This causes endless updates to the vultr_user resource, even though the semantics did not change.

To Reproduce Steps to reproduce the behavior:

  1. Create resource:
    resource "vultr_user" "user" {
    name        = "test test"
    email       = "test@example.com"
    password    = "123456"
    acl         = ["abuse", "alerts", "billing", "dns", "firewall", "loadbalancer", "manage_users", "objstore", "provisioning", "subscriptions", "subscriptions_view", "support", "upgrade", "vke"]
    }
  2. Run terraform plan and apply.
  3. Run terraform plan again and it shows a plan that updates the vultr_user resource, but with the ACLs in a different order.

Expected behavior Terraform plan should not triger an update for vultr_user when the ACLs are the same, but just in a different order.

Screenshots N/a

Desktop (please complete the following information where applicable: Terraform v1.8.4 on linux_amd64

Additional context This could be fixed with a custom StateFunc on the acl property.