UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

181 lines (180 loc) 5.91 kB
import * as pulumi from "@pulumi/pulumi"; /** * 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](https://cloud.google.com/monitoring/api/ref_v3/rest/v1/projects.dashboards) * * How-to Guides * * [Official Documentation](https://cloud.google.com/monitoring/dashboards) * * ## Example Usage * * ### Monitoring Dashboard Basic * * ```typescript * 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": {} * } * ] * } * } * * `}); * ``` * * ### Monitoring Dashboard GridLayout * * ```typescript * 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 * * 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: * * ```sh * $ pulumi import gcp:monitoring/dashboard:Dashboard default projects/{{project}}/dashboards/{{dashboard_id}} * ``` * * ```sh * $ pulumi import gcp:monitoring/dashboard:Dashboard default {{dashboard_id}} * ``` */ export declare class Dashboard extends pulumi.CustomResource { /** * Get an existing Dashboard resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: DashboardState, opts?: pulumi.CustomResourceOptions): Dashboard; /** * Returns true if the given object is an instance of Dashboard. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Dashboard; /** * The JSON representation of a dashboard, following the format at https://cloud.google.com/monitoring/api/ref_v3/rest/v1/projects.dashboards. */ readonly dashboardJson: pulumi.Output<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ readonly project: pulumi.Output<string>; /** * Create a Dashboard resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: DashboardArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Dashboard resources. */ export interface DashboardState { /** * The JSON representation of a dashboard, following the format at https://cloud.google.com/monitoring/api/ref_v3/rest/v1/projects.dashboards. */ dashboardJson?: pulumi.Input<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string>; } /** * The set of arguments for constructing a Dashboard resource. */ export interface DashboardArgs { /** * The JSON representation of a dashboard, following the format at https://cloud.google.com/monitoring/api/ref_v3/rest/v1/projects.dashboards. */ dashboardJson: pulumi.Input<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string>; }