Skip to content

PagerDuty notification recipients don't handle default computed value #309

@jharley

Description

@jharley

Versions

0.15.0 or newer

Steps to reproduce

Effects honeycombio_trigger resources.

If a configured recipient (by ID or Type) is a PagerDuty recipient and doesn't provide a severity in the optional notification_details block,

data "honeycombio_query_specification" "test" {
  calculation {
    op     = "AVG"
    column = "duration_ms"
  }
  time_range = 1200
}

resource "honeycombio_query" "test" {
  dataset    = var.dataset
  query_json = data.honeycombio_query_specification.test.json
}

resource "honeycombio_pagerduty_recipient" "test" {
  integration_key  = var.pagerduty_integration_key
  integration_name = "severity-repro"
}

resource "honeycombio_trigger" "test" {
  name    = "Test trigger from terraform-provider-honeycombio"
  dataset = var.dataset

  description = "My nice description"

  query_id = honeycombio_query.test.id

  threshold {
    op    = ">"
    value = 100
  }

  frequency = data.honeycombio_query_specification.test.time_range / 2

  recipient {
    id = honeycombio_pagerduty_recipient.test.id
  }
}

Running the code above produces the following error on apply:

Error: Provider produced inconsistent result after apply
        
When applying changes to honeycombio_trigger.test, provider
"provider[\"registry.terraform.io/hashicorp/honeycombio\"]" produced an
unexpected new value: .recipient: planned set element
cty.ObjectVal(map[string]cty.Value{"id":cty.StringVal("FTh7K9xqTgS"),
"notification_details":cty.ListValEmpty(cty.Object(map[string]cty.Type{"pagerduty_severity":cty.String})),
"target":cty.UnknownVal(cty.String), "type":cty.UnknownVal(cty.String)}) does
not correlate with any element in actual.

Workaround

Until this is resolved, all PagerDuty recipient blocks should have notification_details provided -- even if you're relying on the default severity level of critical.

  recipient {
    id = honeycombio_pagerduty_recipient.test.id

    notification_details {
      pagerduty_severity = "critical"
    }
  }

Additional context

Introduced by #306

Updating the custom plan modifier for the recipient block should solve resolve this "computed default sometimes" case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions