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

pagerduty_ruleset_rule - cannot set disabled=true once disabled=false was set #250

Closed
jwlusby opened this issue Jul 9, 2020 · 1 comment · Fixed by #282
Closed

pagerduty_ruleset_rule - cannot set disabled=true once disabled=false was set #250

jwlusby opened this issue Jul 9, 2020 · 1 comment · Fixed by #282

Comments

@jwlusby
Copy link

jwlusby commented Jul 9, 2020

Terraform Version

terraform: v0.12.8
terraform-provider-pagerduty: v1.7.3

Affected Resource(s)

pagerduty_ruleset_rule

Terraform Configuration Files

///////////////////////////////////////////////////////
// Example Rule
// This rule demonstrates a bug  when changing the value of 'disabled' from true to false
resource "pagerduty_ruleset_rule" "rule0" {
  position = 0
  ruleset  = "${pagerduty-ruleset.ruleset.id}"

  disabled = false /* Updating this from false to true does not work. Rule will remain disabled permanently.*/
  
  conditions {
    operator = "and"
    subconditions {
      operator = "matches"
      parameter {
        value = "(?i).*test.*"
        path  = "AlarmName"
      }
    }
  }

  actions {
    route {
      value = "${pagerduty-service.service.id}"
    }
  }
}

Debug Output

N/A

Panic Output

N/A

Expected Behavior

A rule that was deployed with disabled=true initially, should be able to be re-enabled by running Apply again after changing it to disabled=false

Actual Behavior

Rule remained Disabled.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. Set disabled=true on a rule
  2. Run terraform apply
  3. Verify that the rule was created and is Disabled
  4. Update Terraform script so that disabled=false on the same rule
  5. Run terraform apply
  6. Observe that the rule is still disabled.

Important Factoids

N/A

References

N/A

@divbhasin
Copy link
Contributor

This is an issue with how we define the disabled field in Go code. It is defined with the annotation disabled, omitempty so disabled=false does not show up in the JSON we try to send in our PUT request because the Go JSON marshaller considers false to be an empty value. I will work on a fix.

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

Successfully merging a pull request may close this issue.

2 participants