Skip to content

Mutliple tier0s associated with projects ordering generate change in every apply #1535

Open
@frederic-urban

Description

@frederic-urban

Describe the bug

Hi,

We discovered that when we add multiple tier0s to a project, they are reorderred a each apply:

Here is the ressource
resource "nsxt_policy_project" "project" {
display_name = "${var.project_name}"

tier0_gateway_paths = local.tier0_path_list

tier0_gateway_paths = ["/infra/tier-0s/93a84740-3f69-4a95-a83c-9f2371897815", "/infra/tier-0s/33a2e2b2-a03d-4bc7-a6f8-e06f6dd29a24","/infra/tier-0s/966b4b5e-1051-4f67-aea0-5b7c8543b83e"]
site_info {
edge_cluster_paths = local.edge_path_list
}
}

Here is the output of the second apply:

module.mod-nsx-project.nsxt_policy_project.project will be updated in-place

~ resource "nsxt_policy_project" "project" {
id = "3c09a8cc-27e5-46dc-bf48-152c4efb9c29"
~ tier0_gateway_paths = [
+ "/infra/tier-0s/93a84740-3f69-4a95-a83c-9f2371897815",
"/infra/tier-0s/33a2e2b2-a03d-4bc7-a6f8-e06f6dd29a24",
"/infra/tier-0s/966b4b5e-1051-4f67-aea0-5b7c8543b83e",
- "/infra/tier-0s/93a84740-3f69-4a95-a83c-9f2371897815",
]
# (7 unchanged attributes hidden)

    # (1 unchanged block hidden)
}

Sorting result of the tier0s list from API and comparasion with sorted tier0s from tfstate could fix the issue.

Thanks,

Reproduction steps

  1. Create project with multiple tier0s
  2. Terraform Apply once
  3. Terraform Reapply
    ...

Expected behavior

No change detected as id orderred are the same

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions