New Relic Terraform Provider Destroy Issue

###Alerts Question Template

  • Please describe what are you seeing:

I’m running terraform destroy to remove an alert policy that I created using the following command:

terraform destroy -target module.Module_Name.newrelic_alert_policy.alert_policies[1]

Basically, I have two alert policies defined, both tied to the same notification channel id. I have two policy-notifications bindings created one for each policy. When I run the above command, it tries to correctly destroy the second policy. But, it also tries to destroy both the policy-channel bindings. Shouldn’t it destroy only the channel binding associated to the policy being destroyed?
Why is that the case?

  • How does this differ from what were you expecting to see?

Ideally, when I try to destroy a particular policy_id, it should destroy only the resources associated to that policy_id.

  • If you aren’t seeing expected alert or data, please provide a link to the incident or violation (policy, condition, data app etc.)

Helpful Resources
Relic Solution: The key to consistent alert notifications

Troubleshooting downtime document

Any inputs? We have a need for such a scenario.

@siddhant.agarwal - New Relic don’t provide any official terraform integrations/services - so I’m not entirely sure what the code behind your terraform destroy is doing. Without knowing what the code is doing, and without knowledge of the terraform plugin you may be using, there’s limited support we can provide here.

Do you have access to see what API calls your terraform destroy may be doing?