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

OneDashboard resource widgetPies property throws an error #175

Open
MitchellGerdisch opened this issue Feb 12, 2021 · 2 comments
Open

OneDashboard resource widgetPies property throws an error #175

MitchellGerdisch opened this issue Feb 12, 2021 · 2 comments
Labels
kind/bug Some behavior is incorrect or out of spec

Comments

@MitchellGerdisch
Copy link

The newrelic OneDashboard resource allows one to create pages and widgets on those pages.
There are various such widgets (e.g. Line widgets and Pie widgets).
The Pie widgets is throwing this error:
error: newrelic:index/oneDashboard:OneDashboard resource 'my-onedashboard' has a problem: page.0: invalid or unknown key: widget_pies
It appears that the terraform bridge is not singularizing the parameter correctly.
However other parameters (e.g. widgetLines) work fine.

The following code can be used to reproduce the issue.
The code includes the problematic widgetPies example as well as a commented out widgetLines example.

Code to reproduce:

import * as newrelic from "@pulumi/newrelic";
import { accountId } from "@pulumi/newrelic/config";

const dashboard = new newrelic.OneDashboard("my-onedashboard", {
  name: "my-stats", 
  permissions: "public_read_only",
  pages: [{
            name: "my-stats", 
            widgetMarkdowns: [{title: "Dashboard Notes", row: 1, column: 9, text: "### Helpful Links\n\n* [New Relic One](https://one.newrelic.com)\n* [Developer Portal](https://developer.newrelic.com)"}],
            widgetPies: [{
              title: "Some Average Response Time",
              row: 1,
              column: 1,
              nrqlQueries: [{
                accountId: Number(accountId),
                query: "SELECT average(duration * 1000) AS 'Response time' FROM Transaction TIMESERIES SINCE 1800 seconds ago EXTRAPOLATE"
              }]
            }]
            
            // widgetLines: [{
            //   title: "${nameBase} Average Response Time",
            //   row: 1,
            //   column: 1,
            //   nrqlQueries: [{
            //     accountId: Number(accountId),
            //     query: "SELECT average(duration * 1000) AS 'Response time' FROM Transaction TIMESERIES SINCE 1800 seconds ago EXTRAPOLATE"
            //   }]
            // }],
          }],
})
@BrunoScheufler
Copy link

BrunoScheufler commented Mar 14, 2021

Experienced this as well, as you stated it seems like the Terraform provider does support pie widgets, so maybe it's something about the generation in Pulumi?

Upon checking the code it looks like the generated and used singular version is OneDashboardPageWidgetPy instead of what I assume should be OneDashboardPageWidgetPie per

widgetPies?: pulumi.Input<pulumi.Input<inputs.OneDashboardPageWidgetPy>[]>;

export interface OneDashboardPageWidgetPy {

I'm not sure how this naming affects the bridge between Pulumi and the Terraform provider, though.

The same apparently goes for the Go SDK

type OneDashboardPageWidgetPy struct {

which makes it seem even more as if tfgen might have returned something incorrect

@elena-dev-thought
Copy link

any news on the resolution?

@lukehoban lukehoban added the kind/bug Some behavior is incorrect or out of spec label Jul 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

4 participants