New Feature: Terraform Script Generator

Hi folks!

I would like to draw your attention to a new feature that I am very excited about!

Do you use Terraform to manage your alert conditions? Have you ever had to configure an alert condition using Terraform? We know the New Relic UI has not been helpful in the past with this sort of task, but we aim to fix that with this new feature.

Today we released to production, in both the US and EU datacenters, the Terraform script generator. You should see a new button in your NRQL condition edit screen (you’ll see this when you edit a condition or create a new condition):

When you click that button, you will see the alert condition, as currently configured in the UI, as it would appear in a Terraform script.

You can use the Copy to clipboard button if you want to copy and paste this into your Terraform script.

One of the reasons this is so cool is that this will show you the condition as it is currently configured in the UI – this means you don’t need to save the condition to see the changes in Terraform. Good automation hygiene guidelines state that you should only make changes to alert conditions in the Terraform script, not in the UI, so this allows you to experiment with changes in the UI and then see how it would change the Terraform script, never needing to save the condition!

You can now use the UI to see the changes, copy and paste the new scriptlet including your changes into your main Terraform script, but not actually apply the changes until the next time you run the script!

We are already working on an enhancement to this feature that will show the Nerdgraph mutation as well, in case you are making direct API calls with your automation system.

I hope this helps you to more easily integrate alerts & AIOps with your entire stack!

21 Likes

:raised_hands:

Thank you!

2 Likes

Really great feature… Will help a lot when there’s a code drift between vcs and newrelic, :slightly_smiling_face:

1 Like

This is a great feature! In terms of impact this functionality would be really useful for dashboards.

2 Likes

Very nice feature! I agree, it would be useful for dashboards as well :slight_smile:

1 Like