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

Feature Request: Extend Data Source newrelic_entity to Return Multiple Entities with Different Filter Capabilities #2760

Open
kinseypdx opened this issue Oct 23, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@kinseypdx
Copy link

Extend data source newrelic_entity to return multiple entities with different filter capabilities

Currently, the data source newrelic_entity requires an entity name and optional different filter attributes as noted here: https://registry.terraform.io/providers/newrelic/newrelic/latest/docs/data-sources/entity#argument-reference

Additionally the newrelic_entity only returns the first matched entity instead of multiple.

The request here is for something more aligned with what is available in the Nerdgraph API for entity search.
Example here is searching for all key/value matching env:prod.

{
  actor {
    entitySearch(queryBuilder: {tags: {key: "env", value: "prod"}}) {
      results {
        entities {
          guid
        }
      }
    }
  }
}

Describe Alternatives

Current alternative to accomplish this would be to import the GraphQL TF provider and use the Nerdgraph API that way.
There doesn't appear to be any way to loop through any results with the current data source option in TF.

Additional context

The situation in a green/blue deployment to use tags to identify which color is a live workload and which is a staging workload.

This seems like a good use case for the TF provider to automatically update the tags during swap to let workloads know that blue resources are now live and the green resources no longer are. It would be ideal to do this at the same time as the CICD changes the dns so that they are in sync.

@pranav-new-relic pranav-new-relic added the enhancement New feature or request label Oct 23, 2024
@pranav-new-relic pranav-new-relic changed the title Extend data source newrelic_entity to return multiple entities with different filter capabilities Feature Request: Extend Data Source newrelic_entity to Return Multiple Entities with Different Filter Capabilities Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants