Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resource newrelic_nrql_alert_condition: Terraform list in NRQL queries #2786

Open
RogerWilco80 opened this issue Dec 23, 2024 · 0 comments
Open
Assignees
Labels

Comments

@RogerWilco80
Copy link

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.

@pranav-new-relic pranav-new-relic changed the title Terraform list in NRQL queries Resource newrelic_nrql_alert_condition: Terraform list in NRQL queries Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants