Skip to content

newrelic_one_dashboard.variable.options.ignore_time_range validation is bit too eager #3020

@anthavio

Description

@anthavio

Hi there!
With terraform 1.11.4 and terraform-provider-newrelic 3.78.0

resource "newrelic_one_dashboard" "whatever" {
  name = "whetever"
  variable {
    name                 = "whatever"
    title                = "whatever"
    type                 = "enum"
    replacement_strategy = "default"
    item {
      title = "foo"
      value = "bar"
    }
    options { excluded = false }
  }
  page { name = "whetever" }
}

fails on ignore_time_range validation which is not present in TF resource

  │ Error: the following validation errors have been identified: 
  │ (1): `ignore_time_range` in `options` can only be used with the variable type `nrql`
  │ 
  │ 
  │   with newrelic_one_dashboard.whatever,
  │   on test.tf line 1, in resource "newrelic_one_dashboard" "whatever":
  │    1: resource "newrelic_one_dashboard" "whatever" {

It seems that ignore_time_range defaults to some value (false?) which trips validation check at

return errors.New("`ignore_time_range` in `options` can only be used with the variable type `nrql`")

which is reasonable check but it seem to be backfiring here at us a bit

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions