Skip to content
New issue

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

"nsxt_policy_tier1_gateway" preferred_edge_paths [] ignores order of provided edge TN pathes #827

Closed
benzander opened this issue Jan 13, 2023 · 1 comment · Fixed by #829
Assignees
Labels
bug Bug

Comments

@benzander
Copy link

Describe the bug

I've tried to use preferred_edge_paths in the ressource "nsxt_policy_tier1_gateway" to set a preferred and a secondary edge TN.
As that is an array I would expect the TF provider to use the first element as preferred Edge and the Second element as secondary edge. But it ignores the order of elements.

Reproduction steps

here my Ressource:

resource` "nsxt_policy_tier1_gateway" "t1" {
  display_name = var.displayName

  locale_service {
    edge_cluster_path = var.edgeCluster.path
    preferred_edge_paths = [
      "/infra/sites/default/enforcement-points/default/edge-clusters/6f5904a3-f63f-484c-bbe6-f48901e7918d/edge-nodes/1",
      "/infra/sites/default/enforcement-points/default/edge-clusters/6f5904a3-f63f-484c-bbe6-f48901e7918d/edge-nodes/0"
    ]
  }

  tier0_path                = var.t0.path
  route_advertisement_types = var.routeAdvertisement
  pool_allocation           = var.poolAllocation
  default_rule_logging      = "true"
  enable_firewall           = "true"
}

Here how the plan looks like:

~ resource "nsxt_policy_tier1_gateway" "t1" {
        id                        = "7be7c794-4d57-4baf-818c-10b3db944a46"
        # (15 unchanged attributes hidden)

      - locale_service {
          - display_name         = "34206d27-1765-4802-b84a-4f6e3a183764" -> null
          - edge_cluster_path    = "/infra/sites/default/enforcement-points/default/edge-clusters/6f5904a3-f63f-484c-bbe6-f48901e7918d" -> null
          - path                 = "/infra/tier-1s/7be7c794-4d57-4baf-818c-10b3db944a46/locale-services/34206d27-1765-4802-b84a-4f6e3a183764" -> null
          - preferred_edge_paths = [] -> null
          - revision             = 1 -> null
        }
      + locale_service {
          + display_name         = (known after apply)
          + edge_cluster_path    = "/infra/sites/default/enforcement-points/default/edge-clusters/6f5904a3-f63f-484c-bbe6-f48901e7918d"
          + path                 = (known after apply)
          + preferred_edge_paths = [
              + "/infra/sites/default/enforcement-points/default/edge-clusters/6f5904a3-f63f-484c-bbe6-f48901e7918d/edge-nodes/0",
              + "/infra/sites/default/enforcement-points/default/edge-clusters/6f5904a3-f63f-484c-bbe6-f48901e7918d/edge-nodes/1",
            ]
          + revision             = (known after apply)
        }

        # (1 unchanged block hidden)
    }

Expected behavior

I would expect the Terraform Provider to use the order of elements provided

Additional context

No response

@benzander benzander added the bug Bug label Jan 13, 2023
@annakhm annakhm self-assigned this Jan 17, 2023
@annakhm annakhm linked a pull request Jan 26, 2023 that will close this issue
@annakhm
Copy link
Collaborator

annakhm commented Jan 26, 2023

Thanks for reporting this @benzander, fix implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants