Dashboard class
A Google Stackdriver dashboard. Dashboards define the content and layout of pages in the Stackdriver web application.
To get more information about Dashboards, see:
- API documentation
- How-to Guides
- Official Documentation
Example Usage
Monitoring Dashboard Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const dashboard = new gcp.monitoring.Dashboard("dashboard", {dashboardJson: `{
\\"displayName\\": \\"Demo Dashboard\\",
\\"gridLayout\\": {
\\"widgets\\": [
{
\\"blank\\": {}
}
]
}
}
`});
import pulumi
import pulumi_gcp as gcp
dashboard = gcp.monitoring.Dashboard("dashboard", dashboard_json="""{
\"displayName\": \"Demo Dashboard\",
\"gridLayout\": {
\"widgets\": [
{
\"blank\": {}
}
]
}
}
""")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var dashboard = new Gcp.Monitoring.Dashboard("dashboard", new()
{
DashboardJson = @"{
\""displayName\"": \""Demo Dashboard\"",
\""gridLayout\"": {
\""widgets\"": [
{
\""blank\"": {}
}
]
}
}
",
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/monitoring"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := monitoring.NewDashboard(ctx, "dashboard", &monitoring.DashboardArgs{
DashboardJson: pulumi.String(`{
\"displayName\": \"Demo Dashboard\",
\"gridLayout\": {
\"widgets\": [
{
\"blank\": {}
}
]
}
}
`),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
gcp = {
source = "pulumi/gcp"
}
}
}
resource "gcp_monitoring_dashboard" "dashboard" {
dashboard_json = "{\n \\\"displayName\\\": \\\"Demo Dashboard\\\",\n \\\"gridLayout\\\": {\n \\\"widgets\\\": [\n {\n \\\"blank\\\": {}\n }\n ]\n }\n}\n\n"
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.monitoring.Dashboard;
import com.pulumi.gcp.monitoring.DashboardArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var dashboard = new Dashboard("dashboard", DashboardArgs.builder()
.dashboardJson("""
{
\"displayName\": \"Demo Dashboard\",
\"gridLayout\": {
\"widgets\": [
{
\"blank\": {}
}
]
}
}
""")
.build());
}
}
resources:
dashboard:
type: gcp:monitoring:Dashboard
properties:
dashboardJson: |+
{
\"displayName\": \"Demo Dashboard\",
\"gridLayout\": {
\"widgets\": [
{
\"blank\": {}
}
]
}
}
Monitoring Dashboard GridLayout
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const dashboard = new gcp.monitoring.Dashboard("dashboard", {dashboardJson: `{
\\"displayName\\": \\"Grid Layout Example\\",
\\"gridLayout\\": {
\\"columns\\": \\"2\\",
\\"widgets\\": [
{
\\"title\\": \\"Widget 1\\",
\\"xyChart\\": {
\\"dataSets\\": [{
\\"timeSeriesQuery\\": {
\\"timeSeriesFilter\\": {
\\"filter\\": \\"metric.type=\\\\\\"agent.googleapis.com/nginx/connections/accepted_count\\\\\\"\\",
\\"aggregation\\": {
\\"perSeriesAligner\\": \\"ALIGN_RATE\\"
}
},
\\"unitOverride\\": \\"1\\"
},
\\"plotType\\": \\"LINE\\"
}],
\\"timeshiftDuration\\": \\"0s\\",
\\"yAxis\\": {
\\"label\\": \\"y1Axis\\",
\\"scale\\": \\"LINEAR\\"
}
}
},
{
\\"text\\": {
\\"content\\": \\"Widget 2\\",
\\"format\\": \\"MARKDOWN\\"
}
},
{
\\"title\\": \\"Widget 3\\",
\\"xyChart\\": {
\\"dataSets\\": [{
\\"timeSeriesQuery\\": {
\\"timeSeriesFilter\\": {
\\"filter\\": \\"metric.type=\\\\\\"agent.googleapis.com/nginx/connections/accepted_count\\\\\\"\\",
\\"aggregation\\": {
\\"perSeriesAligner\\": \\"ALIGN_RATE\\"
}
},
\\"unitOverride\\": \\"1\\"
},
\\"plotType\\": \\"STACKED_BAR\\"
}],
\\"timeshiftDuration\\": \\"0s\\",
\\"yAxis\\": {
\\"label\\": \\"y1Axis\\",
\\"scale\\": \\"LINEAR\\"
}
}
}
]
}
}
`});
import pulumi
import pulumi_gcp as gcp
dashboard = gcp.monitoring.Dashboard("dashboard", dashboard_json="""{
\"displayName\": \"Grid Layout Example\",
\"gridLayout\": {
\"columns\": \"2\",
\"widgets\": [
{
\"title\": \"Widget 1\",
\"xyChart\": {
\"dataSets\": [{
\"timeSeriesQuery\": {
\"timeSeriesFilter\": {
\"filter\": \"metric.type=\\\"agent.googleapis.com/nginx/connections/accepted_count\\\"\",
\"aggregation\": {
\"perSeriesAligner\": \"ALIGN_RATE\"
}
},
\"unitOverride\": \"1\"
},
\"plotType\": \"LINE\"
}],
\"timeshiftDuration\": \"0s\",
\"yAxis\": {
\"label\": \"y1Axis\",
\"scale\": \"LINEAR\"
}
}
},
{
\"text\": {
\"content\": \"Widget 2\",
\"format\": \"MARKDOWN\"
}
},
{
\"title\": \"Widget 3\",
\"xyChart\": {
\"dataSets\": [{
\"timeSeriesQuery\": {
\"timeSeriesFilter\": {
\"filter\": \"metric.type=\\\"agent.googleapis.com/nginx/connections/accepted_count\\\"\",
\"aggregation\": {
\"perSeriesAligner\": \"ALIGN_RATE\"
}
},
\"unitOverride\": \"1\"
},
\"plotType\": \"STACKED_BAR\"
}],
\"timeshiftDuration\": \"0s\",
\"yAxis\": {
\"label\": \"y1Axis\",
\"scale\": \"LINEAR\"
}
}
}
]
}
}
""")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var dashboard = new Gcp.Monitoring.Dashboard("dashboard", new()
{
DashboardJson = @"{
\""displayName\"": \""Grid Layout Example\"",
\""gridLayout\"": {
\""columns\"": \""2\"",
\""widgets\"": [
{
\""title\"": \""Widget 1\"",
\""xyChart\"": {
\""dataSets\"": [{
\""timeSeriesQuery\"": {
\""timeSeriesFilter\"": {
\""filter\"": \""metric.type=\\\""agent.googleapis.com/nginx/connections/accepted_count\\\""\"",
\""aggregation\"": {
\""perSeriesAligner\"": \""ALIGN_RATE\""
}
},
\""unitOverride\"": \""1\""
},
\""plotType\"": \""LINE\""
}],
\""timeshiftDuration\"": \""0s\"",
\""yAxis\"": {
\""label\"": \""y1Axis\"",
\""scale\"": \""LINEAR\""
}
}
},
{
\""text\"": {
\""content\"": \""Widget 2\"",
\""format\"": \""MARKDOWN\""
}
},
{
\""title\"": \""Widget 3\"",
\""xyChart\"": {
\""dataSets\"": [{
\""timeSeriesQuery\"": {
\""timeSeriesFilter\"": {
\""filter\"": \""metric.type=\\\""agent.googleapis.com/nginx/connections/accepted_count\\\""\"",
\""aggregation\"": {
\""perSeriesAligner\"": \""ALIGN_RATE\""
}
},
\""unitOverride\"": \""1\""
},
\""plotType\"": \""STACKED_BAR\""
}],
\""timeshiftDuration\"": \""0s\"",
\""yAxis\"": {
\""label\"": \""y1Axis\"",
\""scale\"": \""LINEAR\""
}
}
}
]
}
}
",
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/monitoring"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := monitoring.NewDashboard(ctx, "dashboard", &monitoring.DashboardArgs{
DashboardJson: pulumi.String(`{
\"displayName\": \"Grid Layout Example\",
\"gridLayout\": {
\"columns\": \"2\",
\"widgets\": [
{
\"title\": \"Widget 1\",
\"xyChart\": {
\"dataSets\": [{
\"timeSeriesQuery\": {
\"timeSeriesFilter\": {
\"filter\": \"metric.type=\\\"agent.googleapis.com/nginx/connections/accepted_count\\\"\",
\"aggregation\": {
\"perSeriesAligner\": \"ALIGN_RATE\"
}
},
\"unitOverride\": \"1\"
},
\"plotType\": \"LINE\"
}],
\"timeshiftDuration\": \"0s\",
\"yAxis\": {
\"label\": \"y1Axis\",
\"scale\": \"LINEAR\"
}
}
},
{
\"text\": {
\"content\": \"Widget 2\",
\"format\": \"MARKDOWN\"
}
},
{
\"title\": \"Widget 3\",
\"xyChart\": {
\"dataSets\": [{
\"timeSeriesQuery\": {
\"timeSeriesFilter\": {
\"filter\": \"metric.type=\\\"agent.googleapis.com/nginx/connections/accepted_count\\\"\",
\"aggregation\": {
\"perSeriesAligner\": \"ALIGN_RATE\"
}
},
\"unitOverride\": \"1\"
},
\"plotType\": \"STACKED_BAR\"
}],
\"timeshiftDuration\": \"0s\",
\"yAxis\": {
\"label\": \"y1Axis\",
\"scale\": \"LINEAR\"
}
}
}
]
}
}
`),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
gcp = {
source = "pulumi/gcp"
}
}
}
resource "gcp_monitoring_dashboard" "dashboard" {
dashboard_json = "{\n \\\"displayName\\\": \\\"Grid Layout Example\\\",\n \\\"gridLayout\\\": {\n \\\"columns\\\": \\\"2\\\",\n \\\"widgets\\\": [\n {\n \\\"title\\\": \\\"Widget 1\\\",\n \\\"xyChart\\\": {\n \\\"dataSets\\\": [{\n \\\"timeSeriesQuery\\\": {\n \\\"timeSeriesFilter\\\": {\n \\\"filter\\\": \\\"metric.type=\\\\\\\"agent.googleapis.com/nginx/connections/accepted_count\\\\\\\"\\\",\n \\\"aggregation\\\": {\n \\\"perSeriesAligner\\\": \\\"ALIGN_RATE\\\"\n }\n },\n \\\"unitOverride\\\": \\\"1\\\"\n },\n \\\"plotType\\\": \\\"LINE\\\"\n }],\n \\\"timeshiftDuration\\\": \\\"0s\\\",\n \\\"yAxis\\\": {\n \\\"label\\\": \\\"y1Axis\\\",\n \\\"scale\\\": \\\"LINEAR\\\"\n }\n }\n },\n {\n \\\"text\\\": {\n \\\"content\\\": \\\"Widget 2\\\",\n \\\"format\\\": \\\"MARKDOWN\\\"\n }\n },\n {\n \\\"title\\\": \\\"Widget 3\\\",\n \\\"xyChart\\\": {\n \\\"dataSets\\\": [{\n \\\"timeSeriesQuery\\\": {\n \\\"timeSeriesFilter\\\": {\n \\\"filter\\\": \\\"metric.type=\\\\\\\"agent.googleapis.com/nginx/connections/accepted_count\\\\\\\"\\\",\n \\\"aggregation\\\": {\n \\\"perSeriesAligner\\\": \\\"ALIGN_RATE\\\"\n }\n },\n \\\"unitOverride\\\": \\\"1\\\"\n },\n \\\"plotType\\\": \\\"STACKED_BAR\\\"\n }],\n \\\"timeshiftDuration\\\": \\\"0s\\\",\n \\\"yAxis\\\": {\n \\\"label\\\": \\\"y1Axis\\\",\n \\\"scale\\\": \\\"LINEAR\\\"\n }\n }\n }\n ]\n }\n}\n\n"
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.monitoring.Dashboard;
import com.pulumi.gcp.monitoring.DashboardArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var dashboard = new Dashboard("dashboard", DashboardArgs.builder()
.dashboardJson("""
{
\"displayName\": \"Grid Layout Example\",
\"gridLayout\": {
\"columns\": \"2\",
\"widgets\": [
{
\"title\": \"Widget 1\",
\"xyChart\": {
\"dataSets\": [{
\"timeSeriesQuery\": {
\"timeSeriesFilter\": {
\"filter\": \"metric.type=\\\"agent.googleapis.com/nginx/connections/accepted_count\\\"\",
\"aggregation\": {
\"perSeriesAligner\": \"ALIGN_RATE\"
}
},
\"unitOverride\": \"1\"
},
\"plotType\": \"LINE\"
}],
\"timeshiftDuration\": \"0s\",
\"yAxis\": {
\"label\": \"y1Axis\",
\"scale\": \"LINEAR\"
}
}
},
{
\"text\": {
\"content\": \"Widget 2\",
\"format\": \"MARKDOWN\"
}
},
{
\"title\": \"Widget 3\",
\"xyChart\": {
\"dataSets\": [{
\"timeSeriesQuery\": {
\"timeSeriesFilter\": {
\"filter\": \"metric.type=\\\"agent.googleapis.com/nginx/connections/accepted_count\\\"\",
\"aggregation\": {
\"perSeriesAligner\": \"ALIGN_RATE\"
}
},
\"unitOverride\": \"1\"
},
\"plotType\": \"STACKED_BAR\"
}],
\"timeshiftDuration\": \"0s\",
\"yAxis\": {
\"label\": \"y1Axis\",
\"scale\": \"LINEAR\"
}
}
}
]
}
}
""")
.build());
}
}
resources:
dashboard:
type: gcp:monitoring:Dashboard
properties:
dashboardJson: |+
{
\"displayName\": \"Grid Layout Example\",
\"gridLayout\": {
\"columns\": \"2\",
\"widgets\": [
{
\"title\": \"Widget 1\",
\"xyChart\": {
\"dataSets\": [{
\"timeSeriesQuery\": {
\"timeSeriesFilter\": {
\"filter\": \"metric.type=\\\"agent.googleapis.com/nginx/connections/accepted_count\\\"\",
\"aggregation\": {
\"perSeriesAligner\": \"ALIGN_RATE\"
}
},
\"unitOverride\": \"1\"
},
\"plotType\": \"LINE\"
}],
\"timeshiftDuration\": \"0s\",
\"yAxis\": {
\"label\": \"y1Axis\",
\"scale\": \"LINEAR\"
}
}
},
{
\"text\": {
\"content\": \"Widget 2\",
\"format\": \"MARKDOWN\"
}
},
{
\"title\": \"Widget 3\",
\"xyChart\": {
\"dataSets\": [{
\"timeSeriesQuery\": {
\"timeSeriesFilter\": {
\"filter\": \"metric.type=\\\"agent.googleapis.com/nginx/connections/accepted_count\\\"\",
\"aggregation\": {
\"perSeriesAligner\": \"ALIGN_RATE\"
}
},
\"unitOverride\": \"1\"
},
\"plotType\": \"STACKED_BAR\"
}],
\"timeshiftDuration\": \"0s\",
\"yAxis\": {
\"label\": \"y1Axis\",
\"scale\": \"LINEAR\"
}
}
}
]
}
}
Import
Dashboard can be imported using any of these accepted formats:
projects/{{project}}/dashboards/{{dashboard_id}}{{dashboard_id}}
When using the pulumi import command, Dashboard can be imported using one of the formats above. For example:
$ pulumi import gcp:monitoring/dashboard:Dashboard default projects/{{project}}/dashboards/{{dashboard_id}}
$ pulumi import gcp:monitoring/dashboard:Dashboard default {{dashboard_id}}
Constructors
- Dashboard(String name, {DashboardArgs? args, CustomResourceOptions? options})
-
Creates a new Dashboard.
nameThe Pulumi resource name.argsArguments used to configure this Dashboard. The set of arguments for Dashboard.optionsResource options controlling this resource's behavior. - Dashboard.reference(String urn)
- Creates a typed reference to an existing Dashboard resource.
Properties
-
childResources
→ Set<
Resource> -
finalinherited
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
-
dashboardJson
↔ Output<
String> -
The JSON representation of a dashboard, following the format at https://cloud.google.com/monitoring/api/ref_v3/rest/v1/projects.dashboards.
The representation of an existing dashboard can be found by using the API Explorer
latefinal
-
deletionPolicy
↔ Output<
String> -
Whether Terraform will be prevented from destroying the resource. Defaults to "DELETE".
When a 'terraform destroy' or 'pulumi up' would delete the resource,
the command will fail if this field is set to "PREVENT" in Terraform state.
When set to "ABANDON", the command will remove the resource from Terraform
management without updating or deleting the resource in the API.
When set to "DELETE", deleting the resource is allowed.
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
-
id
↔ Output<
String> -
getter/setter pairinherited
- isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
project
↔ Output<
String> -
The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.
latefinal
-
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
urn
↔ Output<
String> -
latefinalinherited
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited