newrelic / terraform-provider-newrelic

Terraform provider for New Relic
https://registry.terraform.io/providers/newrelic/newrelic/latest/docs
Mozilla Public License 2.0
200 stars 247 forks source link

Resource `newrelic_synthetics_script_monitor`: Unable to Detect Differences in `locations_public` #2768

Open htnosm opened 1 week ago

htnosm commented 1 week ago

Hi there,

In the newrelic_synthetics_script_monitor resource, it seems that the value for locations_public is not being retrieved.

While creating and updating resources via Terraform works without any issues, any manual updates to the locations_public value from the Web UI do not reflect in Terraform, and therefore, no differences are outputted.

Additionally, when using the generate-config-out option with the import command, the locations_public is outputted as null. This leads me to believe that there is a bug preventing the actual value of locations_public from being retrieved.

Terraform Version

Affected Resource(s)

Terraform Configuration

I checked with SCRIPT_API.

resource "newrelic_synthetics_script_monitor" "monitor" {
  status               = "ENABLED"
  name                 = "script_monitor"
  type                 = "SCRIPT_API"
  locations_public     = ["AP_SOUTH_1", "AP_EAST_1"]
  period               = "EVERY_6_HOURS"

  script               = "console.log('it works!')"

  script_language      = "JAVASCRIPT"
  runtime_type         = "NODE_API"
  runtime_type_version = "16.10"

  tag {
    key    = "some_key"
    values = ["some_value"]
  }
}

Actual Behavior

Differences in locations_public are not detected.

Expected Behavior

The locations_public value should be retrieved and any differences should be outputted.

Steps to Reproduce

  1. Create or update a newrelic_synthetics_script_monitor resource via Terraform.
  2. Manually update locations_public in the Web UI.
  3. Run terraform plan and observe that no differences in locations_public are detected.
pranav-new-relic commented 1 week ago

Hi @htnosm, thank you for reporting this issue - we shall take a look soon, based on our current priority queue. cc @vinay-newrelic