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] Terraform: generate raw dashboard resource #1198

Open
danielcorreia96 opened this issue Dec 13, 2021 · 3 comments
Open

[Feature] Terraform: generate raw dashboard resource #1198

danielcorreia96 opened this issue Dec 13, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@danielcorreia96
Copy link

Feature Description

Currently, the newrelic utils terraform dashboard command allows users to export NewRelic dashboards to the Terraform resource, newrelic_one_dashboard (https://registry.terraform.io/providers/newrelic/newrelic/latest/docs/resources/one_dashboard)

However, this command doesn't work for dashboards that use more complex features such as:

  • Billboard widgets with thresholds
  • Any widget with data formatting (identified by the dataFormatters field)

The reason this doesn't work is because the unmarshalling schema for the dashboard's "raw configuration" data is either

  1. Missing fields (e.g. no thresholds field)
  2. Or the fields types are incorrect (e.g. dataFormatters is not a list of strings)

(for reference:

type DashboardWidgetRawConfiguration struct {
DataFormatters []string `json:"dataFormatters"`
NRQLQueries []DashboardWidgetNRQLQuery `json:"nrqlQueries"`
LinkedEntityGUIDs []string `json:"linkedEntityGuids"`
Text string `json:"text"`
Facet DashboardWidgetFacet `json:"facet"`
Legend DashboardWidgetLegend `json:"legend"`
YAxisLeft DashboardWidgetYAxisLeft `json:"yAxisLeft"`
}
)

Since covering all of these complex features scenarios both in the newrelic-cli project and the NewRelic Terraform provider is a lot of work, it would be nice if instead there was an alternative command (or flag) that allowed users to export dashboards to the raw dashboard resource in Terraform - newrelic_one_dashboard_raw.

Describe Alternatives

Other than implementing our own Terraform resource generator (similar to the one provided by newrelic-cli), there's no alternative.

Note that, for now, we've managed to workaround this internally by patching the utils terraform dashobard command to support a --raw flag but the current implementation isn't very polished 😅

Additional context

Add any other context here.

@stale
Copy link

stale bot commented Dec 27, 2021

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale Issue or PR has been inactive for a period of time. This label is configured in stale-bot. label Dec 27, 2021
@stale
Copy link

stale bot commented Jan 4, 2022

This issue has been automatically closed due to a lack of activity for an extended period of time.

@stale stale bot closed this as completed Jan 4, 2022
@kidk kidk added enhancement New feature or request and removed stale Issue or PR has been inactive for a period of time. This label is configured in stale-bot. labels Apr 1, 2022
@kidk
Copy link
Contributor

kidk commented Apr 1, 2022

Thanks for suggestion @danielcorreia96 Let me discuss with the team to see how hard this would be to implement.

@kidk kidk reopened this Apr 1, 2022
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