Skip to main content

dashboards

Creates, updates, deletes, gets or lists a dashboards resource.

Overview

Namedashboards
TypeResource
Idaws.cloudwatch.dashboards

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
dashboard_arnstringThe Amazon Resource Name (ARN) of the dashboard.
dashboard_bodystringThe detailed information about the dashboard, including what widgets are included and their location on the dashboard. For more information about the DashboardBody syntax, see Dashboard Body Structure and Syntax.
dashboard_namestringThe name of the dashboard.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_dashboardselectregionDisplays the details of the dashboard that you specify. To copy an existing dashboard, use GetDashboard, and then use the data returned within DashboardBody as the template for the new dashboard when you call PutDashboard to create the copy.
list_dashboardsselectregionReturns a list of the dashboards for your account. If you include DashboardNamePrefix, only those dashboards with names starting with the prefix are listed. Otherwise, all dashboards in your account are listed. ListDashboards returns up to 1000 results on one page. If there are more than 1000 dashboards, you can call ListDashboards again and include the value you received for NextToken in the first call, to receive the next 1000 results.
put_dashboardreplaceregion, DashboardName, DashboardBodyCreates a dashboard if it does not already exist, or updates an existing dashboard. If you update a dashboard, the entire contents are replaced with what you specify here. All dashboards in your account are global, not region-specific. A simple way to create a dashboard using PutDashboard is to copy an existing dashboard. To copy an existing dashboard using the console, you can load the dashboard and then use the View/edit source command in the Actions menu to display the JSON block for that dashboard. Another way to copy a dashboard is to use GetDashboard, and then use the data returned within DashboardBody as the template for the new dashboard when you call PutDashboard. When you create a dashboard with PutDashboard, a good practice is to add a text widget at the top of the dashboard with a message that the dashboard was created by script and should not be changed in the console. This message could also point console users to the location of the DashboardBody script or the CloudFormation template used to create the dashboard.
delete_dashboardsdeleteregionDeletes all dashboards that you specify. You can specify up to 100 dashboards to delete. If there is an error during this call, the operation attempts to delete as many dashboards as possible.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Displays the details of the dashboard that you specify. To copy an existing dashboard, use GetDashboard, and then use the data returned within DashboardBody as the template for the new dashboard when you call PutDashboard to create the copy.

SELECT
dashboard_arn,
dashboard_body,
dashboard_name
FROM aws.cloudwatch.dashboards
WHERE region = '{{ region }}' -- required
;

REPLACE examples

Creates a dashboard if it does not already exist, or updates an existing dashboard. If you update a dashboard, the entire contents are replaced with what you specify here. All dashboards in your account are global, not region-specific. A simple way to create a dashboard using PutDashboard is to copy an existing dashboard. To copy an existing dashboard using the console, you can load the dashboard and then use the View/edit source command in the Actions menu to display the JSON block for that dashboard. Another way to copy a dashboard is to use GetDashboard, and then use the data returned within DashboardBody as the template for the new dashboard when you call PutDashboard. When you create a dashboard with PutDashboard, a good practice is to add a text widget at the top of the dashboard with a message that the dashboard was created by script and should not be changed in the console. This message could also point console users to the location of the DashboardBody script or the CloudFormation template used to create the dashboard.

REPLACE aws.cloudwatch.dashboards
SET
DashboardName = '{{ DashboardName }}',
DashboardBody = '{{ DashboardBody }}',
Tags = '{{ Tags }}'
WHERE
region = '{{ region }}' --required
AND DashboardName = '{{ DashboardName }}' --required
AND DashboardBody = '{{ DashboardBody }}' --required
RETURNING
dashboard_validation_messages;

DELETE examples

Deletes all dashboards that you specify. You can specify up to 100 dashboards to delete. If there is an error during this call, the operation attempts to delete as many dashboards as possible.

DELETE FROM aws.cloudwatch.dashboards
WHERE region = '{{ region }}' --required
;