dashboards
Creates, updates, deletes, gets or lists a dashboards resource.
Overview
| Name | dashboards |
| Type | Resource |
| Id | aws.cloudwatch.dashboards |
Fields
The following fields are returned by SELECT queries:
- get_dashboard
- list_dashboards
| Name | Datatype | Description |
|---|---|---|
dashboard_arn | string | The Amazon Resource Name (ARN) of the dashboard. |
dashboard_body | string | The 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_name | string | The name of the dashboard. |
| Name | Datatype | Description |
|---|---|---|
dashboard_arn | string | The Amazon Resource Name (ARN) of the dashboard. |
dashboard_name | string | The name of the dashboard. |
last_modified | string (date-time) | The time stamp of when the dashboard was last modified, either by an API call or through the console. This number is expressed as the number of milliseconds since Jan 1, 1970 00:00:00 UTC. |
size | integer (int64) | The size of the dashboard, in bytes. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_dashboard | select | region | 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. | |
list_dashboards | select | region | Returns 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_dashboard | replace | region, DashboardName, DashboardBody | 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. | |
delete_dashboards | delete | region | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_dashboard
- list_dashboards
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
;
Returns 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.
SELECT
dashboard_arn,
dashboard_name,
last_modified,
size
FROM aws.cloudwatch.dashboards
WHERE region = '{{ region }}' -- required
;
REPLACE examples
- put_dashboard
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
- delete_dashboards
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
;