Skip to content

Resource newrelic_nrql_alert_condition: Terraform list in NRQL queries #2786

Closed
@RogerWilco80

Description

Can we have the ability to supply a terraform list in NRQL queries? That way we can use a splat expression to specify several IDs in queries.

Depending on the resource (e.g. alert conditions), the alternative could be to create several queries.

For example:

resource "newrelic_synthetics_monitor" "monitor-cust-website" {
  count = length(var.monitor_websites)
  status           = "ENABLED"
  name            = var.monitor_websites[count.index].name
  period           = "EVERY_MINUTE"
  uri                 = var.monitor_websites[count.index].uri
  type              = "SIMPLE"
  locations_public = var.monitor_websites[count.index].location
}

resource "newrelic_nrql_alert_condition" "ping-alert-condition" {
....
  nrql {
      query = "SELECT filter(count(*), WHERE result = 'FAILED') AS 'Failures' FROM SyntheticCheck WHERE entityGuid IN (${newrelic_synthetics_monitor.monitor-customer-website[*].id}) AND NOT isMuted FACET monitorName"
    }
....
}

This gives an error saying I'm providing a tuple where a string is required.

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions