https://pulumi.com logo
#typescript
Title
# typescript
e

echoing-animal-62858

07/24/2023, 4:36 PM
I'm running the pulumi CLI and I'm getting a validation error that I can't unpack and understand more.
Copy code
Diagnostics:
  datadog:index:Monitor (pul_Release Draft Deploy Error):
    error: diffing urn:pulumi:staging::core-api::datadog:index/monitor:Monitor::pul_Release Draft Deploy Error: error validating monitor from <https://api.datadoghq.com/api/v1/monitor/124561428/validate>: 400 Bad Request: {"errors":["The value provided for parameter 'query' is invalid"]}
The output of
pulumi diff
puts Diagnostics including a 400 Bad Request. However I can't really understand how to unpack this better, I'd really like to see the full HTTP request and HTTP response for this 400 to understand what JSON payload did I send, and what part of
query
could be invalid, in fact there should be two
query
fields in the JSON payload so unclear which one it is. There's a lot of steps to reverse engineer how I can generate the correct raw JSON for
datadog.Monitor
from the
@pulumi/datadog
class.
s

stocky-restaurant-98004

07/24/2023, 6:55 PM
I would try Pulumi AI for an issue like this (ask it to generate a valid example): https://www.pulumi.com/ai/
e

echoing-animal-62858

07/24/2023, 6:58 PM
image.png
The Pulumi AI is telling me exactly what I am doing
You need to create a composite query, using Datadog's formula and function queries. This topic is currently under-documented and would require trial and error to get right. It might involve creating a variable with your
rum
query as a
formula
, then using that variable in the query for your monitor, which would incorporate the
default_zero()
call.
It's just that when i attempt to pass in a
variable
and run
pulumi preview
I get back a 400 and am now stuck without being able to introspect the raw HTTP request JSON that lead to the 400
I apologize for any confusion, but as of my last update and knowledge, the functionality of creating a
formula
or a
variable
using the
default_zero
function in Pulumi's TypeScript SDK is not supported directly. The Pulumi's Datadog package which might be used for this kind of operation doesn't appear to support complex or composite functions like
default_zero()
directly.
Pulumi AI says that this is not supported directly and good luck have fun