santonijoe
santonijoe

Reputation: 3

3.13.0 New Relic Provider Crashing on Terraform

I am running into an issue with a terraform provider, the new relic plugin keeps crashing for some reason and I don't know why. I'm trying to build a simple alerting script on terraform to create an alerting policy + conditions on the new relic UI. Here is the code below that I'm trying to run;

`terraform {
 required_version = "~> 1.3.7"
 required_providers{
  newrelic = {
   source  = "newrelic/newrelic"
   version = "~> 3.13"
    }
  } 
}

locals{
 splitList = [for url in var.urlList: split(".", url)[1]]
 finishedList = [for split in local.splitList: join("-", [split, "Cert Check"])]
}

resource "newrelic_alert_policy" "certChecks" {
 name = "SSL Cert Check Expirations"
 incident_preference = "PER_POLICY"
}

resource "newrelic_alert_channel" "SSL_Alert" {
 name = "SSL Expiration Alert"
 type = "email"

 config {
  recipients              = "foo.com"
  include_json_attachment = "true"
 }
}

resource "newrelic_synthetics_alert_condition" "foo" {
 policy_id   = newrelic_alert_policy.certChecks.id

 count       = length(var.urlList)
 name        = "SSL Expiration"
 monitor_id  = local.finishedList[count.index]
}

resource "newrelic_synthetics_cert_check_monitor" "monitor"{
 count                  = length(var.urlList)
 name                   = local.finishedList[count.index]
 domain                 = var.urlList[count.index]
 locations_public       = ["US_EAST_1"]
 certificate_expiration = "350"
 period                 = "EVERY_DAY"
 status                 = "ENABLED"
}`

It plans but won't apply, it errors out right before. Here is my error message: enter image description here

Any help would be useful, thank you!

Honestly much hasn't been tried, I tried looking for more information on the terraform community but that search pulled up no results. The only thing I found was changing the location the test would be running from, but I was already in the location needed.

Upvotes: 0

Views: 164

Answers (1)

newrelic
newrelic

Reputation: 1

Someone from our team tried to replicate the same config in thier own TF project, and it works totally fine, they have defined the exact same TF & NR.

Please check your provider versions, so your environment should be close to identical of of each other. We don't see anything clearly wrong with your configuration.

Upvotes: 0

Related Questions