Dashboard

Provides a CloudWatch Dashboard resource.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var main = new Aws.CloudWatch.Dashboard("main", new Aws.CloudWatch.DashboardArgs
        {
            DashboardBody = @" {
   ""widgets"": [
       {
          ""type"":""metric"",
          ""x"":0,
          ""y"":0,
          ""width"":12,
          ""height"":6,
          ""properties"":{
             ""metrics"":[
                [
                   ""AWS/EC2"",
                   ""CPUUtilization"",
                   ""InstanceId"",
                   ""i-012345""
                ]
             ],
             ""period"":300,
             ""stat"":""Average"",
             ""region"":""us-east-1"",
             ""title"":""EC2 Instance CPU""
          }
       },
       {
          ""type"":""text"",
          ""x"":0,
          ""y"":7,
          ""width"":3,
          ""height"":3,
          ""properties"":{
             ""markdown"":""Hello world""
          }
       }
   ]
 }
 
",
            DashboardName = "my-dashboard",
        });
    }

}
package main

import (
    "fmt"

    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/cloudwatch"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := cloudwatch.NewDashboard(ctx, "main", &cloudwatch.DashboardArgs{
            DashboardBody: pulumi.String(fmt.Sprintf("%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v", " {\n", "   \"widgets\": [\n", "       {\n", "          \"type\":\"metric\",\n", "          \"x\":0,\n", "          \"y\":0,\n", "          \"width\":12,\n", "          \"height\":6,\n", "          \"properties\":{\n", "             \"metrics\":[\n", "                [\n", "                   \"AWS/EC2\",\n", "                   \"CPUUtilization\",\n", "                   \"InstanceId\",\n", "                   \"i-012345\"\n", "                ]\n", "             ],\n", "             \"period\":300,\n", "             \"stat\":\"Average\",\n", "             \"region\":\"us-east-1\",\n", "             \"title\":\"EC2 Instance CPU\"\n", "          }\n", "       },\n", "       {\n", "          \"type\":\"text\",\n", "          \"x\":0,\n", "          \"y\":7,\n", "          \"width\":3,\n", "          \"height\":3,\n", "          \"properties\":{\n", "             \"markdown\":\"Hello world\"\n", "          }\n", "       }\n", "   ]\n", " }\n", " \n")),
            DashboardName: pulumi.String("my-dashboard"),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

main = aws.cloudwatch.Dashboard("main",
    dashboard_body=""" {
   "widgets": [
       {
          "type":"metric",
          "x":0,
          "y":0,
          "width":12,
          "height":6,
          "properties":{
             "metrics":[
                [
                   "AWS/EC2",
                   "CPUUtilization",
                   "InstanceId",
                   "i-012345"
                ]
             ],
             "period":300,
             "stat":"Average",
             "region":"us-east-1",
             "title":"EC2 Instance CPU"
          }
       },
       {
          "type":"text",
          "x":0,
          "y":7,
          "width":3,
          "height":3,
          "properties":{
             "markdown":"Hello world"
          }
       }
   ]
 }
 
""",
    dashboard_name="my-dashboard")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const main = new aws.cloudwatch.Dashboard("main", {
    dashboardBody: ` {
   "widgets": [
       {
          "type":"metric",
          "x":0,
          "y":0,
          "width":12,
          "height":6,
          "properties":{
             "metrics":[
                [
                   "AWS/EC2",
                   "CPUUtilization",
                   "InstanceId",
                   "i-012345"
                ]
             ],
             "period":300,
             "stat":"Average",
             "region":"us-east-1",
             "title":"EC2 Instance CPU"
          }
       },
       {
          "type":"text",
          "x":0,
          "y":7,
          "width":3,
          "height":3,
          "properties":{
             "markdown":"Hello world"
          }
       }
   ]
 }
 `,
    dashboardName: "my-dashboard",
});

Create a Dashboard Resource

def Dashboard(resource_name, opts=None, dashboard_body=None, dashboard_name=None, __props__=None);
func NewDashboard(ctx *Context, name string, args DashboardArgs, opts ...ResourceOption) (*Dashboard, error)
public Dashboard(string name, DashboardArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args DashboardArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args DashboardArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args DashboardArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Dashboard Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Dashboard resource accepts the following input properties:

DashboardBody string

The detailed information about the dashboard, including what widgets are included and their location on the dashboard. You can read more about the body structure in the documentation.

DashboardName string

The name of the dashboard.

DashboardBody string

The detailed information about the dashboard, including what widgets are included and their location on the dashboard. You can read more about the body structure in the documentation.

DashboardName string

The name of the dashboard.

dashboardBody string

The detailed information about the dashboard, including what widgets are included and their location on the dashboard. You can read more about the body structure in the documentation.

dashboardName string

The name of the dashboard.

dashboard_body str

The detailed information about the dashboard, including what widgets are included and their location on the dashboard. You can read more about the body structure in the documentation.

dashboard_name str

The name of the dashboard.

Outputs

All input properties are implicitly available as output properties. Additionally, the Dashboard resource produces the following output properties:

DashboardArn string

The Amazon Resource Name (ARN) of the dashboard.

Id string
The provider-assigned unique ID for this managed resource.
DashboardArn string

The Amazon Resource Name (ARN) of the dashboard.

Id string
The provider-assigned unique ID for this managed resource.
dashboardArn string

The Amazon Resource Name (ARN) of the dashboard.

id string
The provider-assigned unique ID for this managed resource.
dashboard_arn str

The Amazon Resource Name (ARN) of the dashboard.

id str
The provider-assigned unique ID for this managed resource.

Look up an Existing Dashboard Resource

Get an existing Dashboard resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: DashboardState, opts?: CustomResourceOptions): Dashboard
static get(resource_name, id, opts=None, dashboard_arn=None, dashboard_body=None, dashboard_name=None, __props__=None);
func GetDashboard(ctx *Context, name string, id IDInput, state *DashboardState, opts ...ResourceOption) (*Dashboard, error)
public static Dashboard Get(string name, Input<string> id, DashboardState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

DashboardArn string

The Amazon Resource Name (ARN) of the dashboard.

DashboardBody string

The detailed information about the dashboard, including what widgets are included and their location on the dashboard. You can read more about the body structure in the documentation.

DashboardName string

The name of the dashboard.

DashboardArn string

The Amazon Resource Name (ARN) of the dashboard.

DashboardBody string

The detailed information about the dashboard, including what widgets are included and their location on the dashboard. You can read more about the body structure in the documentation.

DashboardName string

The name of the dashboard.

dashboardArn string

The Amazon Resource Name (ARN) of the dashboard.

dashboardBody string

The detailed information about the dashboard, including what widgets are included and their location on the dashboard. You can read more about the body structure in the documentation.

dashboardName string

The name of the dashboard.

dashboard_arn str

The Amazon Resource Name (ARN) of the dashboard.

dashboard_body str

The detailed information about the dashboard, including what widgets are included and their location on the dashboard. You can read more about the body structure in the documentation.

dashboard_name str

The name of the dashboard.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.