Skip to content

Error Destination in use when trying to destroy notification destination via terraform #3021

@nathanmoore5

Description

@nathanmoore5

Error

Unable to delete notification destination managed by terraform due to destination in use error. The destination is turned off in New Relic.

Terraform Version

terraform_version: 1.9.4

Affected Resource(s)

Please list the resources as a list, for example:

  • newrelic_alert_policy
  • newrelic_alert_channel

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration

Please include your provider configuration (sensitive details redacted) as well as the configuration of the resources and/or data sources related to the bug report.

  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 6.0"
    }
    newrelic = {
      source  = "newrelic/newrelic"
      version = "~> 3.0"
    }

    opsgenie = {
      source  = "opsgenie/opsgenie"
      version = "~> 0.6"
    }
  }

Actual Behavior

An error occurred when trying to delete a newrelic_notification_destination that was created with terraform. The error was:

newrelic_notification_destination.opsgenie: Destroying... [id=[REDACTED]]
╷
│ Error: ENTITY_IN_USE: This operation could not be completed because the entity is in use
│ 
│ 
╵

Expected Behavior

The notification destination should have been deleted. The notification destination was disabled in New Relic console before attempting to delete via terraform.

Steps to Reproduce

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

  1. Create notification destination in terraform
  2. Disable notification destination in NR UI
  3. terraform apply
  4. Destination is not deleted and terraform error occurs

Important Factoids

References

Seems to be related to: #2277 which was closed because the original reporter never answered.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions