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

Global Orchestration/Service Orchestration rule order is not maintained in the Terraform provider #968

Open
nmistry24 opened this issue Jan 14, 2025 · 0 comments

Comments

@nmistry24
Copy link

nmistry24 commented Jan 14, 2025

Terraform Version
Terraform v1.10.4

PagerDuty Provider Version
v3.18.3


Affected Resource(s)

  • pagerduty_event_orchestration_global

Terraform Configuration Files

# Example Global Orchestration
resource "pagerduty_event_orchestration_global" "global" {
  set {
    id = "ID1"
    rule {
      id = "RULEID1"
      label = "RULELABEL1"
      actions {}
      condition{
        expression = "CONDITION1"
      }
    }
    rule {
      id = "RULEID2"
      label = "RULELABEL2"
      actions {}
      condition{
        expression = "CONDITION2"
      }
    }
  }
  catch_all {
    actions { }
  }
}

Expected Behavior
When adding a new rule to the orchestration YAML file (e.g., a rule added after RULEID1), the Terraform plan should preserve the ordering of the rules as defined in the configuration. No unnecessary reordering of unchanged rules should occur.


Actual Behavior
Even though the new rule is added after RULEID1 in the TF, the Terraform plan renders the rules unordered. This causes existing rules to shift positions in the plan output, showing more changes than there actually are. For example, the new rule sometimes appears above RULEID1, pushing other rules down, which complicates the review process and can raise concerns unnecessarily.


Steps to Reproduce

  1. Define orchestration rules.
  2. Add a new rule to the orchestration file after an existing rule (e.g., RULEID2).
  3. Run terraform plan.
  4. Observe that the plan reorders the rules, even though only one new rule was added, and no changes were made to existing rules.

Likely Cause
The provider seems to handle lists or maps in an unordered fashion, which causes Terraform to perceive the resource as having changes when it reorders elements, even if their content remains unchanged.


What I Tried

  • Running terraform refresh to sync the state file with the actual resource state.
    • Result: This did not resolve the issue.

We would appreciate guidance or a resolution to ensure rules retain their defined order in the Terraform plan to prevent unnecessary changes from being displayed. Thank you!

@nmistry24 nmistry24 changed the title Global Orchestration or Service Orchestration order is not maintained in the Terraform provider Global Orchestration/Service Orchestration rule order is not maintained in the Terraform provider Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant