Category: Data, Cloud, Terraform, Infrastructure, Hashicorp, github, automation

At New Relic, we are heavy users of HashiCorp Terraform, which we use to provision all kinds of infrastructure and services, including New Relic dashboards and alerts.

Now, using the Terraform Provider from New Relic, we take advantage of APIs to automatically add monitoring to our applications and infrastructure."

Start by cloning your new GitHub repository into a directory named terraform-project, initialize the working directory, and create a Terraform configuration file: Next, instruct Terraform to install and use the New Relic provider, by setting the terraform and required_providers blocks in main.tf: In this code block, you're setting the required version of Terraform to 0.13.x and setting the New Relic provider to the latest 2.x version.

After you’ve created your workspace and linked it to your repository, you can start to build out the rest of your New Relic Terraform configuration.

Once you’ve applied your Terraform plan, log in to New Relic and navigate to Alert Policies to confirm that Terraform created your new policy.

Related Articles