terraform-provider-newrelic icon indicating copy to clipboard operation
terraform-provider-newrelic copied to clipboard

⚠️ EOL Notice for newrelic_alert_channel and newrelic_alert_policy_channel

Open kidk opened this issue 2 years ago • 14 comments

Hi everyone

I want to make you all aware of an upcoming EOL that will impact all version of the New Relic Terraform provider currently available.

The following components will stop working end of Dec 31, 2023:

Resources

Data sources

For more information check out https://forum.newrelic.com/s/hubtopic/aAX8W0000008dKOWAY/plan-to-upgrade-alert-notification-channels-to-workflows-and-destinations

As a replacement, which adds additional features and functionality, you can use the following components:

Resources

Data sources

If you have any questions or concerns, please don't hesitate to reach out by creating a ticket or replying to this one.

Thanks a lot The Observability as Code team

kidk avatar Mar 10 '23 08:03 kidk

Are there plans to make the provider warn when it run?

whyman10x avatar Mar 13 '23 16:03 whyman10x

@whyman10x https://github.com/newrelic/terraform-provider-newrelic/releases/tag/v3.16.1 contains the deprecation warnings on the relevant resources. Hope that was what you were looking for.

kidk avatar Mar 20 '23 08:03 kidk

This EOL has been delayed and will not happen end of June 2023. For more information check out our forum: https://forum.newrelic.com/s/hubtopic/aAX8W00000005XuWAI/updated-schedule-for-the-migration-to-alert-workflows-and-channels-eol

The new deadline is Dec 31, 2023.

kidk avatar Apr 20 '23 07:04 kidk

So how to link policy to notification channel now? newrelic_alert_policy_channel has channel_ids, newrelic_alert_channel doesn't. Your own getting started guide still uses newrelic_alert_channel and newrelic_alert_policy_channel.

burner1024 avatar May 24 '23 06:05 burner1024

Hi @burner1024 - in order to link ~a policy to a notification channel~ (an alert policy can only be linked to a workflow that is linked to a notification channel), here's what you might want to do -

  1. Create a destination using the newrelic_notification_destination resource (if you do not have one created already)
  2. Create a notification channel using the newrelic_notification_channel resource and reference the ID of the destination mentioned in (1)
  3. Create a workflow using the newrelic_workflow resource, referencing the ID of the notification channel created in (2), and specify the predicate argument in this resource as the following
    predicate {
      attribute = "labels.policyIds"
      operator = "EXACTLY_MATCHES"
      values = [
        <The ID of your alert policy goes here>
      ]
    }

Thanks for letting us know about the contents of the "Getting Started" page - we'll get this updated soon. cc @kidk

pranav-new-relic avatar May 24 '23 10:05 pranav-new-relic

@pranav-new-relic I recommend we update this, especially as the deadline approaches. It's not something we can 'consider' updating. We are misguiding users about how to effectively use the New Relic platform by giving them instructions with soon-to-be deprecated resources.

Fallenstedt avatar May 24 '23 20:05 Fallenstedt

Hi @Fallenstedt - sorry, that was a misphrased bit of the comment that I've just updated. The idea is to get this corrected soon, owing to the reasons you've mentioned, and I've opened a discussion with my team already, to see when we can get this done based on our current task priority. Thank you for your inputs 🙌

pranav-new-relic avatar May 25 '23 03:05 pranav-new-relic

@pranav-new-relic Is there any update to the docs being refreshed to include examples of the proper way to use newrelic_notification_destination? I ran across this and wonder if this is an edge case that needs consideration, or if I'm using workflow predicates incorrectly.

In your prior comment you mentioned adding the ID of the alert policy as a predicate value. Does newrelic_workflow:issues_filter support multiple predicates if I am looking to match on an accumulation of tags, or am I to merely include a second issue_filter{}, one with the tag accumulations and another with the notification_channel id?

davetron33 avatar Jun 14 '23 18:06 davetron33

@davetron33 the changes are currently in review, and will mostly be out with the next release of the Terraform Provider. To answer your question, multiple predicates can be added to the same issues_filter block in the newrelic_workflow resource, as stated by this phrase in the docs of the resource. An example -

  issues_filter {
    name = "sample_issues_filter"
    type = "FILTER"

    predicate {
      attribute = "labels.policyIds"
      operator  = "EXACTLY_MATCHES"
      values    = [sample_policy.id]
    }

    predicate {
      attribute = "accumulations.tag.team"
      operator = "EXACTLY_MATCHES"
      values = ["random"]
    }
  }

pranav-new-relic avatar Jun 14 '23 18:06 pranav-new-relic

Thanks for that @pranav-new-relic! I had indeed misread how to use multiple predicates there. Cheers!

davetron33 avatar Jun 14 '23 18:06 davetron33

There is still room for improvement with the documentation!

The warning message on newrelic_alert_policy_channel is wrong and should reference newrelic_workflow image

The full scenario examples on newrelic_notification_channel should absolutely include the newrelic_workflow

The documentation should be clear that:

  • newrelic_alert_chanel -> newrelic_notification_channel AND newrelic_notification_destination
  • newrelic_alert_policy_channel -> newrelic_workflow

On another note pulling the destination out of the channel definition for 'reasons' is a bad move. In my experience they have the same lifecycle

jeropaul avatar Aug 16 '23 02:08 jeropaul

I ended up here after battling with the documentation. There is no documented alternative to these deprecated resources and arguments. Would be nice to update the actual doc it instead to create an issue in Github to let people know about this change?

Maxwell2022 avatar Feb 05 '24 22:02 Maxwell2022

Thanks for the feedback, @Maxwell2022. We currently have a note about the deprecation (as specified in this issue) with a link to the alternative to the deprecated newrelic_alert_channel and newrelic_alert_policy_channel in the note at the top of the documentation of these resources

  • https://registry.terraform.io/providers/newrelic/newrelic/3.30.0/docs/resources/alert_policy_channel
  • https://registry.terraform.io/providers/newrelic/newrelic/3.30.0/docs/resources/alert_channel which would be to use newrelic_notification_channel, along with newrelic_notification_destination and newrelic_workflow.

An updated example which includes setting up alerts and notifications through a channel and destination via the above three resources may be found here.

From @jeropaul's feedback too, I agree that the alternatives, though listed in the docs of the deprecated resources, do not give a complete idea on how they may be used (as a replacement of the deprecated resources) - we might want to have the example I've linked above referenced to the docs of the two deprecated resources. We'll try making this change based on our priority queue - thank you for reporting this.

pranav-new-relic avatar Feb 06 '24 04:02 pranav-new-relic

should newrelic_alert_policy_channel mention newrelic_workflow. This has been reported back in August last year and the doc is still not updated.

This terraform documentation needs a good clean up, there is documented migration from v1.x to v2.x for resource that are now deprecated in v3. It's super confusing.

Maxwell2022 avatar Feb 06 '24 22:02 Maxwell2022