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

data datadog_monitors: allow queries that do not return value(s) #2782

Open
amolari opened this issue Jan 16, 2025 · 0 comments
Open

data datadog_monitors: allow queries that do not return value(s) #2782

amolari opened this issue Jan 16, 2025 · 0 comments

Comments

@amolari
Copy link

amolari commented Jan 16, 2025

What resources or data sources are affected?

data datadog_monitors

Feature Request

Please support a queries that do not return any monitor. The returned attribute "monitors" should then be simply an empty list.
Example (as it would be seen in the TF state):

    {
      "module": "module.mymodule_datadog_events",
      "mode": "data",
      "type": "datadog_monitors",
      "name": "mydataresourcename",
      "provider": "provider[\"registry.terraform.io/datadog/datadog\"]",
      "instances": [
        {
          "schema_version": 0,
          "attributes": {
            "id": "||team:teamA,service:serviceA,deploymentname:somevalue",
            "monitor_tags_filter": [
              "team:teamA",
              "service:serviceA",
              "deploymentname:somevalue"
            ],
            "monitors": [],
            "name_filter": null,
            "tags_filter": null
          },
          "sensitive_attributes": []
        }
      ]
    }

Using the provider v4.5.0, if the query doesn't return any list of monitor, it fails with such error:

Error: your query returned no result, please try a less specific search criteria
with module.mymodule_datadog_events.data.datadog_monitors.mydataresourcename
on .terraform/modules/mymodule_datadog_events/main.tf line 42, in data "datadog_monitors" "mydataresourcename":
data "datadog_monitors" "mydataresourcename" {

References

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant