Coder Social home page Coder Social logo

Comments (4)

eredi93 avatar eredi93 commented on August 16, 2024 1

@nyanshak i updated the docs https://github.com/terraform-providers/terraform-provider-datadog/pull/24 😄

from terraform-provider-datadog.

nyanshak avatar nyanshak commented on August 16, 2024

The plugin already supports it (I was testing this recently as well):

resource "datadog_monitor" "monitor1" {
   ... cut (any valid monitor definition) ...
}

resource "datadog_monitor" "monitor2" {
   ... cut (any valid monitor definition) ...
}

resource "datadog_monitor" "test_composite" {
  name    = "test_composite"
  type    = "composite"
  message = "test composite"

  query = "${datadog_monitor.monitor1.id} || ${datadog_monitor.monitor2.id}"
}

Is that what you mean?

from terraform-provider-datadog.

eredi93 avatar eredi93 commented on August 16, 2024

Yes, thank you.
Maybe we should update the docs

from terraform-provider-datadog.

Veske avatar Veske commented on August 16, 2024

How can one reach the id in case the monitor has been defined in a module?

module "monitor_simple_sample" {
   source = "./monitor"
...
}

module "monitor_complex_sample" {
   source = "./monitor"
...
}

module "monitor_composite_sample" {
  source = "./monitor"
  type = "composite"
  query = "${module.monitor_simple_sample.id} && ${module.monitor_complex_sample.id}"
}

In case of something like this I will get a:

Error: Reference to undeclared output value

  on ../datadog/main.tf line 35, in module "monitor_composite_sample":
  35:   query = "${module.monitor_simple_sample.id} && ${module.monitor_complex_sample.id}"

An output value with the name "id" has not been declared in
module.datadog.module.monitor_complex_sample.

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.