env0 / terraform-provider-env0

Terraform Provider for env0
https://env0.com
Mozilla Public License 2.0
39 stars 14 forks source link

Drift Notification for Variable Sets (due to ordering) in `env0_environment` #908

Closed away168 closed 3 months ago

away168 commented 3 months ago

Describe the bug There's a drift caused by variable set id

OpenTofu will perform the following actions:

  # env0_environment.repositories will be updated in-place
  ~ resource "env0_environment" "repositories" {
        id                               = "12345-6789-0123-12345-12345"
        name                             = "foo"
      ~ variable_sets                    = [
          - "61d19159-b54a-472c-b236-2e095b603ce5",
            "6662488b-a11c-4cc8-a236-46d592c0ad74",
          + "61d19159-b54a-472c-b236-2e095b603ce5",
        ]
        # (14 unchanged attributes hidden)

        # (4 unchanged blocks hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

1.19.5

OpenTofu will perform the following actions:

  # env0_environment.repositories["ccs-tiers"] will be updated in-place
  ~ resource "env0_environment" "repositories" {
        id                               = "8e3042b6-4fcd-4e83-98ff-c2f516cfe118"
        name                             = "ccs-tiers"
      ~ variable_sets                    = [
          + "6662488b-a11c-4cc8-a236-46d592c0ad74",
          + "61d19159-b54a-472c-b236-2e095b603ce5",
        ]
        # (14 unchanged attributes hidden)

        # (4 unchanged blocks hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

To Reproduce Create an env0_environment with variable_sets with two ids. Run env0_environment again - see drift.

Expected behavior No Drift.

Provider Version 1.19.1 , 1.19.5

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.