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_webhook_subscription] No "update in place" when changing the custom_header value #923

Open
lucasnery-hotmart opened this issue Aug 8, 2024 · 1 comment

Comments

@lucasnery-hotmart
Copy link

Hi there,

Terraform Version

v1.9.3

Provider

v3.15.1

Terraform Configuration Files

resource "pagerduty_webhook_subscription" "chat_integration" {
  delivery_method {
    type = "http_delivery_method"
    url  = "https://mywebhook.com/"
    custom_header {
      name  = "chat"
      value = "test1" 
    }
  }
  description = "xxxxx"
  events = [
    "incident.acknowledged",
    "incident.annotated",
    "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.service[count.index].id
    type = "service_reference"
  }
  type       = "webhook_subscription"
}

Expected Behavior

When changing the "value" of the custom_header, update in-place was expected, but no change occurs.

Actual Behavior

No changes. Your infrastructure matches the configuration.

Problem

    custom_header {
      name  = "chat"
      value = "test1"
    }

State

      "type": "pagerduty_webhook_subscription",
      "name": "chat_integration",
      "provider": "provider[\"registry.terraform.io/pagerduty/pagerduty\"]",
      "instances": [
        {
          "index_key": 0,
          "schema_version": 0,
          "attributes": {
            "active": true,
            "delivery_method": [
              {
                "custom_header": [
                  {
                    "name": "room",
                    "value": "-- redacted --"
                  }
                ],
                "temporarily_disabled": false,
                "type": "http_delivery_method",
                "url": "https://mywebhook.com/"
              }
@lucasnery-hotmart lucasnery-hotmart changed the title [pagerduty_webhook_subscription] No change when changing the custom_header value [pagerduty_webhook_subscription] No "update in place" when changing the custom_header value Aug 8, 2024
@lucasnery-hotmart
Copy link
Author

lucasnery-hotmart commented Aug 19, 2024

I managed to work around the problem in the following way:

variable "revision" {
  default = 1
}

resource "terraform_data" "replacement" {
  input = var.revision
}

resource "pagerduty_webhook_subscription" "chat_integration" {
  delivery_method {
    type = "http_delivery_method"
    url  = "https://mywebhook.com/"
    custom_header {
      name  = "chat"
      value = var.revision
    }
  }
  description = "xxxxx"
  events = [
    "incident.acknowledged",
    "incident.annotated",
    "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.service[count.index].id
    type = "service_reference"
  }
  type       = "webhook_subscription"
  lifecycle {
    replace_triggered_by = [terraform_data.replacement]
  }
}

if the value of the variable is changed, replace will occur

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