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

Permanent diff in webhook subscription resource for the events property #934

Open
VenelinMartinov opened this issue Oct 2, 2024 · 0 comments

Comments

@VenelinMartinov
Copy link

VenelinMartinov commented Oct 2, 2024

Terraform Version

Terraform v1.9.6

Affected Resource(s)

  • pagerduty_webhook_subscription

Terraform Configuration Files

terraform {
  required_providers {
    pagerduty = {
      source  = "pagerduty/pagerduty"
      version = ">= 2.2.1"
    }
  }
}

resource "pagerduty_user" "example" {
  name  = "Earline Greenholt"
  email = "[email protected]"
}

resource "pagerduty_escalation_policy" "foo" {
  name      = "Engineering Escalation Policy2"
  num_loops = 2

  rule {
    escalation_delay_in_minutes = 10

    target {
      type = "user_reference"
      id   = pagerduty_user.example.id
    }
  }
}

resource "pagerduty_service" "example" {
  name                    = "My Web App"
  auto_resolve_timeout    = 14400
  acknowledgement_timeout = 600
  escalation_policy       = pagerduty_escalation_policy.foo.id
  alert_creation          = "create_alerts_and_incidents"

  auto_pause_notifications_parameters {
    enabled = true
    timeout = 300
  }
}

resource "pagerduty_webhook_subscription" "foo" {
  delivery_method {
    type = "http_delivery_method"
    url  = "https://example.com/receive_a_pagerduty_webhook"
    custom_header {
      name  = "X-Foo"
      value = "foo"
    }
    custom_header {
      name  = "X-Bar"
      value = "bar"
    }
  }

  description = "Webhook for PagerDuty Service"

  events = [
    "incident.annotated",
    "incident.acknowledged",
    "incident.delegated",
    "incident.escalated",
    "incident.priority_updated",
    "incident.reassigned",
    "incident.reopened",
    "incident.resolved",
    "incident.responder.added",
    "incident.responder.replied",
    "incident.status_update_published",
    "incident.triggered",
    "incident.unacknowledged",
  ]

  active = true

  filter {
    id   = pagerduty_service.example.id
    type = "service_reference"
  }

  type = "webhook_subscription"
}

Expected Behavior

Running terraform plan with no changes should produce no diff

Actual Behavior

permanent diff on the events property

Steps to Reproduce

  1. terraform apply
  2. terraform plan
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