New Relic Terraform provider - newrelic_synthetics_monitor data don't found monitors

Hi guys, I am trying to setup New Relic alerts via terraform using the following documentation

I tried to call a synthetic monitor with the following code:

data "newrelic_synthetics_monitor" "project_name" {
    name = "This-monitor-name-exists"
}

But terraform retrurns:

Error: the name 'This-monitor-name-exists' does not match any New Relic monitors

I’m sure that the synthetic monitor exist in my account, and I can update this monitor script using the resource newrelic_synthetics_monitor

My provider.tf config is:

terraform {
  required_providers {
    newrelic = {
      source = "newrelic/newrelic"
      version = "2.21.0"
    }
  }
}

And my Terraform version is v0.14.9.

Any idea of what I do wrong?

Thanks!

Per the Getting Started guide, have you configured your New Relic provider with account ID, API key and region as well?

Yes, the account ID, and API key (User) are fine, i’t works well with the newrelic_synthetics_monitor resource, or when i try tu update tags. Only fails reading the data "newrelic_synthetics_monitor"

Weird, and there’s no chance that this monitor:

  • Has different letter-casing or special characters in its name?
  • Is in a different account from the other monitor?
1 Like

Is in the same account. I can update the monitors, but not retrieve his data.

The name of synthetics have this structure:

XX - YY.firstWord.secondword

Y try to downgrade Terraform to v0.13, but not work. Also I try to pass another arguments (just in case the documentation is out of date), but also not work.

Perhaps worth raising the query directly with newrelic/terraform-provider-newrelic on GitHub?