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

[Bug] pagerduty_ruleset_rule returning position error #300

Closed
pdtowers opened this issue Feb 10, 2021 · 4 comments
Closed

[Bug] pagerduty_ruleset_rule returning position error #300

pdtowers opened this issue Feb 10, 2021 · 4 comments

Comments

@pdtowers
Copy link

pdtowers commented Feb 10, 2021

Terraform Version

Terraform v0.12.24

Affected Resource(s)

pagerduty_ruleset_rule

Terraform Configuration Files

  count = var.enable_pagerduty ? 1 : 0

  ruleset = var.pagerduty_ruleset_id

  conditions {
    operator = "and"

    subconditions {
      operator = "contains"
      parameter {
        value = "warning"
        path = "description"
      }
    }

    subconditions {
      operator = "equals"
      parameter {
        value = newrelic_alert_policy.newrelic_alert_policy.name
        path = "details.policy_name"
      }
    }
  }

  actions {

    route {
      value = pagerduty_service.pagerduty_service[0].id
    }
    severity  {
      value = "warning"
    }

  }
}

resource "pagerduty_ruleset_rule" "critical" {

  count = var.enable_pagerduty ? 1 : 0

  ruleset = var.pagerduty_ruleset_id

  conditions {
    operator = "and"

    subconditions {
      operator = "contains"
      parameter {
        value = "critical"
        path = "description"
      }
    }

    subconditions {
      operator = "equals"
      parameter {
        value = newrelic_alert_policy.newrelic_alert_policy.name
        path = "details.policy_name"
      }
    }
  }

  actions {

    route {
      value = pagerduty_service.pagerduty_service[0].id
    }
    severity  {
      value = "critical"
    }

  }
}

Expected Behavior

terraform plan acknowledges that the rule exists.

Actual Behavior

Error: Error updating ruleset rule 35c60ff4-a900-41bc-bd30-183ae01ba493 position 607 needs to be 0

  on pagerduty_event_rules.tf line 1, in resource "pagerduty_ruleset_rule" "warning":
   1: resource "pagerduty_ruleset_rule" "warning" {



Error: Error updating ruleset rule b84a0f75-78fa-4ab7-9687-36f09bb2d921 position 608 needs to be 0

  on pagerduty_event_rules.tf line 39, in resource "pagerduty_ruleset_rule" "critical":
  39: resource "pagerduty_ruleset_rule" "critical" {

Steps to Reproduce

terraform apply

Important Factoids

No error in version 1.8.0 of the provider.

@stmcallister
Copy link
Contributor

Yep. I'm working on fixing this now. If using pagerduty_ruleset_rule please please use version 1.8.0 of the provider until I get this fix published.

@stmcallister
Copy link
Contributor

Just released version 1.9.2 with this fix. Let me know if you continue having issues.

@pdtowers
Copy link
Author

Tested and all good now, thank you.

@stmcallister
Copy link
Contributor

Cool. Going to close this. Please repost if you have any further issues.

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

2 participants