Skip to main content

dashboards

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

Overview

Namedashboards
TypeResource
Idaws.cloudtrail.dashboards

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
created_timestampstring (date-time)The timestamp that shows when the dashboard was created.
dashboard_arnstringThe ARN for the dashboard. (pattern: <code>^[a-zA-Z0-9._/-:]+$</code>)
last_refresh_failure_reasonstringProvides information about failures for the last scheduled refresh. (pattern: <code>.*</code>)
last_refresh_idstringThe ID of the last dashboard refresh. (pattern: <code>\d+</code>)
refresh_scheduleobjectThe refresh schedule for the dashboard, if configured.
statusstringThe status of the dashboard. (CREATING, CREATED, UPDATING, UPDATED, DELETING)
termination_protection_enabledbooleanIndicates whether termination protection is enabled for the dashboard.
typestringThe type of dashboard. (MANAGED, CUSTOM)
updated_timestampstring (date-time)The timestamp that shows when the dashboard was last updated.
widgetsarrayAn array of widgets for the dashboard.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_dashboardselectregionReturns the specified dashboard.
list_dashboardsselectregionReturns information about all dashboards in the account, in the current Region.
create_dashboardinsertregionCreates a custom dashboard or the Highlights dashboard. Custom dashboards - Custom dashboards allow you to query events in any event data store type. You can add up to 10 widgets to a custom dashboard. You can manually refresh a custom dashboard, or you can set a refresh schedule. Highlights dashboard - You can create the Highlights dashboard to see a summary of key user activities and API usage across all your event data stores. CloudTrail Lake manages the Highlights dashboard and refreshes the dashboard every 6 hours. To create the Highlights dashboard, you must set and enable a refresh schedule. CloudTrail runs queries to populate the dashboard's widgets during a manual or scheduled refresh. CloudTrail must be granted permissions to run the StartQuery operation on your behalf. To provide permissions, run the PutResourcePolicy operation to attach a resource-based policy to each event data store. For more information, see Example: Allow CloudTrail to run queries to populate a dashboard in the CloudTrail User Guide. To set a refresh schedule, CloudTrail must be granted permissions to run the StartDashboardRefresh operation to refresh the dashboard on your behalf. To provide permissions, run the PutResourcePolicy operation to attach a resource-based policy to the dashboard. For more information, see Resource-based policy example for a dashboard in the CloudTrail User Guide. For more information about dashboards, see CloudTrail Lake dashboards in the CloudTrail User Guide.
update_dashboardupdateregion, DashboardIdUpdates the specified dashboard. To set a refresh schedule, CloudTrail must be granted permissions to run the StartDashboardRefresh operation to refresh the dashboard on your behalf. To provide permissions, run the PutResourcePolicy operation to attach a resource-based policy to the dashboard. For more information, see Resource-based policy example for a dashboard in the CloudTrail User Guide. CloudTrail runs queries to populate the dashboard's widgets during a manual or scheduled refresh. CloudTrail must be granted permissions to run the StartQuery operation on your behalf. To provide permissions, run the PutResourcePolicy operation to attach a resource-based policy to each event data store. For more information, see Example: Allow CloudTrail to run queries to populate a dashboard in the CloudTrail User Guide.
delete_dashboarddeleteregionDeletes the specified dashboard. You cannot delete a dashboard that has termination protection enabled.
start_dashboard_refreshexecregion, DashboardIdStarts a refresh of the specified dashboard. Each time a dashboard is refreshed, CloudTrail runs queries to populate the dashboard's widgets. CloudTrail must be granted permissions to run the StartQuery operation on your behalf. To provide permissions, run the PutResourcePolicy operation to attach a resource-based policy to each event data store. For more information, see Example: Allow CloudTrail to run queries to populate a dashboard in the CloudTrail User Guide.

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

Returns the specified dashboard.

SELECT
created_timestamp,
dashboard_arn,
last_refresh_failure_reason,
last_refresh_id,
refresh_schedule,
status,
termination_protection_enabled,
type,
updated_timestamp,
widgets
FROM aws.cloudtrail.dashboards
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a custom dashboard or the Highlights dashboard. Custom dashboards - Custom dashboards allow you to query events in any event data store type. You can add up to 10 widgets to a custom dashboard. You can manually refresh a custom dashboard, or you can set a refresh schedule. Highlights dashboard - You can create the Highlights dashboard to see a summary of key user activities and API usage across all your event data stores. CloudTrail Lake manages the Highlights dashboard and refreshes the dashboard every 6 hours. To create the Highlights dashboard, you must set and enable a refresh schedule. CloudTrail runs queries to populate the dashboard's widgets during a manual or scheduled refresh. CloudTrail must be granted permissions to run the StartQuery operation on your behalf. To provide permissions, run the PutResourcePolicy operation to attach a resource-based policy to each event data store. For more information, see Example: Allow CloudTrail to run queries to populate a dashboard in the CloudTrail User Guide. To set a refresh schedule, CloudTrail must be granted permissions to run the StartDashboardRefresh operation to refresh the dashboard on your behalf. To provide permissions, run the PutResourcePolicy operation to attach a resource-based policy to the dashboard. For more information, see Resource-based policy example for a dashboard in the CloudTrail User Guide. For more information about dashboards, see CloudTrail Lake dashboards in the CloudTrail User Guide.

INSERT INTO aws.cloudtrail.dashboards (
Name,
RefreshSchedule,
TagsList,
TerminationProtectionEnabled,
Widgets,
region
)
SELECT
'{{ Name }}',
'{{ RefreshSchedule }}',
'{{ TagsList }}',
{{ TerminationProtectionEnabled }},
'{{ Widgets }}',
'{{ region }}'
RETURNING
dashboard_arn,
name,
refresh_schedule,
tags_list,
termination_protection_enabled,
type,
widgets
;

UPDATE examples

Updates the specified dashboard. To set a refresh schedule, CloudTrail must be granted permissions to run the StartDashboardRefresh operation to refresh the dashboard on your behalf. To provide permissions, run the PutResourcePolicy operation to attach a resource-based policy to the dashboard. For more information, see Resource-based policy example for a dashboard in the CloudTrail User Guide. CloudTrail runs queries to populate the dashboard's widgets during a manual or scheduled refresh. CloudTrail must be granted permissions to run the StartQuery operation on your behalf. To provide permissions, run the PutResourcePolicy operation to attach a resource-based policy to each event data store. For more information, see Example: Allow CloudTrail to run queries to populate a dashboard in the CloudTrail User Guide.

UPDATE aws.cloudtrail.dashboards
SET
DashboardId = '{{ DashboardId }}',
Widgets = '{{ Widgets }}',
RefreshSchedule = '{{ RefreshSchedule }}',
TerminationProtectionEnabled = {{ TerminationProtectionEnabled }}
WHERE
region = '{{ region }}' --required
AND DashboardId = '{{ DashboardId }}' --required
RETURNING
created_timestamp,
dashboard_arn,
name,
refresh_schedule,
termination_protection_enabled,
type,
updated_timestamp,
widgets;

DELETE examples

Deletes the specified dashboard. You cannot delete a dashboard that has termination protection enabled.

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

Lifecycle Methods

Starts a refresh of the specified dashboard. Each time a dashboard is refreshed, CloudTrail runs queries to populate the dashboard's widgets. CloudTrail must be granted permissions to run the StartQuery operation on your behalf. To provide permissions, run the PutResourcePolicy operation to attach a resource-based policy to each event data store. For more information, see Example: Allow CloudTrail to run queries to populate a dashboard in the CloudTrail User Guide.

EXEC aws.cloudtrail.dashboards.start_dashboard_refresh
@region='{{ region }}' --required
@@json=
'{
"DashboardId": "{{ DashboardId }}",
"QueryParameterValues": "{{ QueryParameterValues }}"
}'
;