newrelic / terraform-provider-newrelic

Terraform provider for New Relic
https://registry.terraform.io/providers/newrelic/newrelic/latest/docs
Mozilla Public License 2.0
200 stars 244 forks source link

⚠️ EOL Notice for newrelic_alert_channel and newrelic_alert_policy_channel #2286

Open kidk opened 1 year ago

kidk commented 1 year ago

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

whyman10x commented 1 year ago

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

kidk commented 1 year ago

@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 commented 1 year ago

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.

burner1024 commented 1 year ago

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.

pranav-new-relic commented 1 year ago

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

Fallenstedt commented 1 year ago

@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.

pranav-new-relic commented 1 year ago

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 🙌

davetron33 commented 1 year ago

@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?

pranav-new-relic commented 1 year ago

@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"]
    }
  }
davetron33 commented 1 year ago

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

jeropaul commented 10 months ago

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:


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

Maxwell2022 commented 5 months ago

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?

pranav-new-relic commented 5 months ago

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

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.

Maxwell2022 commented 5 months ago

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.