Coder Social home page Coder Social logo

resource_datadog_monitor - Null attributes not being skiped even when no needed - variables.0.event_query.0.search.0.query" is required, but no │ definition was found. about terraform-provider-datadog HOT 4 CLOSED

DanielGarzaFraireDF avatar DanielGarzaFraireDF commented on July 18, 2024
resource_datadog_monitor - Null attributes not being skiped even when no needed - variables.0.event_query.0.search.0.query" is required, but no │ definition was found.

from terraform-provider-datadog.

Comments (4)

nkzou avatar nkzou commented on July 18, 2024 1

Try using something like the following:

dynamic "variables" {
    for_each = each.value.variables_name != null ? [1] : []
    content {
      event_query {
        name        = each.value.variables_name
        data_source = each.value.data_source
        search {
          query = each.value.search_query
        }
        compute {
          aggregation = each.value.aggregation
        }
      }
    }
  }

instead of explicitly defining the variables block. This dynamic block will omit the variables block if each.value.variables_name is null.

from terraform-provider-datadog.

nkzou avatar nkzou commented on July 18, 2024

Sorry, but this is working as expected. We don't plan on silently skipping invalid configurations. I suggest you change your for_each to avoid including invalid event_query blocks, either by making the variables block dynamic, or having a conditional that sets variables to null if the monitor doesn't have an applicable event_query definition

from terraform-provider-datadog.

DanielGarzaFraireDF avatar DanielGarzaFraireDF commented on July 18, 2024

We already tried making this variables NULL when not needed by some monitors but DD its still looking for it
This is the message we are receiving.

"variables.0.event_query.0.data_source" is required, but no │ definition was found"

This is in fact the real issue, not accepting the NULL for this variables

from terraform-provider-datadog.

DanielGarzaFraireDF avatar DanielGarzaFraireDF commented on July 18, 2024

Thanks a lot @nkzou !

That solved our problem and now our integration is working as expected with this dynamic block

Greetings!

from terraform-provider-datadog.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.