dashboards
Creates, updates, deletes or gets a dashboard resource or lists dashboards in a region
Overview
| Name | dashboards |
| Type | Resource |
| Description | Resource Type definition for AWS::CloudWatch::Dashboard |
| Id | awscc.cloudwatch.dashboards |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
dashboard_name | string | The name of the dashboard. The name must be between 1 and 255 characters. If you do not specify a name, one will be generated automatically. |
dashboard_body | string | The detailed information about the dashboard in JSON format, including the widgets to include and their location on the dashboard |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
dashboard_name | string | The name of the dashboard. The name must be between 1 and 255 characters. If you do not specify a name, one will be generated automatically. |
region | string | AWS region. |
For more information, see AWS::CloudWatch::Dashboard.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | dashboards | INSERT | DashboardBody, region |
delete_resource | dashboards | DELETE | Identifier, region |
update_resource | dashboards | UPDATE | Identifier, PatchDocument, region |
list_resources | dashboards_list_only | SELECT | region |
get_resource | dashboards | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual dashboard.
SELECT
region,
dashboard_name,
dashboard_body
FROM awscc.cloudwatch.dashboards
WHERE
region = 'us-east-1' AND
Identifier = '{{ dashboard_name }}';
Lists all dashboards in a region.
SELECT
region,
dashboard_name
FROM awscc.cloudwatch.dashboards_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new dashboard resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.cloudwatch.dashboards (
DashboardBody,
region
)
SELECT
'{{ dashboard_body }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.cloudwatch.dashboards (
DashboardName,
DashboardBody,
region
)
SELECT
'{{ dashboard_name }}',
'{{ dashboard_body }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: dashboard
props:
- name: dashboard_name
value: '{{ dashboard_name }}'
- name: dashboard_body
value: '{{ dashboard_body }}'
UPDATE example
Use the following StackQL query and manifest file to update a dashboard resource, using stack-deploy.
/*+ update */
UPDATE awscc.cloudwatch.dashboards
SET PatchDocument = string('{{ {
"DashboardBody": dashboard_body
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ dashboard_name }}';
DELETE example
/*+ delete */
DELETE FROM awscc.cloudwatch.dashboards
WHERE
Identifier = '{{ dashboard_name }}' AND
region = 'us-east-1';
Permissions
To operate on the dashboards resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
cloudwatch:PutDashboard,
cloudwatch:GetDashboard
cloudwatch:GetDashboard
cloudwatch:PutDashboard
cloudwatch:DeleteDashboards,
cloudwatch:GetDashboard
cloudwatch:ListDashboards