https://pulumi.com logo
#getting-started
Title
# getting-started
b

better-bear-68344

09/25/2023, 8:27 AM
Hey Team, I am trying to create a simple datadog dashboard in go with pulumi, is this really the way to go:
Copy code
package main

import (
	"<http://github.com/pulumi/pulumi-datadog/sdk/v4/go/datadog|github.com/pulumi/pulumi-datadog/sdk/v4/go/datadog>"
	"<http://github.com/pulumi/pulumi/sdk/v3/go/pulumi|github.com/pulumi/pulumi/sdk/v3/go/pulumi>"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := datadog.NewDashboard(ctx, "Artifactory Monitoring Pulumi", &datadog.DashboardArgs{
			Title:       pulumi.String("Artifactory Monitoring Pulumi"),
			Description: pulumi.String("All metrics regarding Artifactory from the Docker containers on the EC2 instance (NGINX, Artifactory, Datadog) and AWS Cloudwatch aggregated and deployed with Pulumi"),
			LayoutType:  pulumi.String("ordered"),
			ReflowType:  pulumi.StringPtr("fixed"),
			Widgets: datadog.DashboardWidgetArray{
				&datadog.DashboardWidgetArgs{
					TimeseriesDefinition: datadog.DashboardWidgetTimeseriesDefinitionPtr(
						&datadog.DashboardWidgetTimeseriesDefinitionArgs{
							Requests: datadog.DashboardWidgetTimeseriesDefinitionRequestArray{
								datadog.DashboardWidgetTimeseriesDefinitionRequestArgs{
									Queries: datadog.DashboardWidgetTimeseriesDefinitionRequestQueryArray{
										datadog.DashboardWidgetTimeseriesDefinitionRequestQueryArgs{
											MetricQuery: datadog.DashboardWidgetTimeseriesDefinitionRequestQueryMetricQueryPtrOutput{
												OutputState: &pulumi.OutputState{},
											},
										},
									},
								},
							},
						}),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
did I take a wrong turn somewhere? How do I define the metric query string?
2 Views