CloudTrail Lake will no longer be open to new customers starting May 31, 2026. If you would like to use CloudTrail Lake, sign up prior to that date. Existing customers can continue to use the service as normal. For more information, see CloudTrail Lake availability change.
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.
Parameters:
-
name
(DashboardName)
–
The name of the dashboard. The name must be unique to your account.
To create the Highlights dashboard, the name must be AWSCloudTrail-Highlights.
-
refresh_schedule
(Optional[RefreshSchedule], default:
None
)
–
The refresh schedule configuration for the dashboard.
To create the Highlights dashboard, you must set a refresh schedule and set the Status to ENABLED. The Unit for the refresh schedule must be HOURS and the Value must be 6.
-
termination_protection_enabled
(Optional[TerminationProtectionEnabled], default:
None
)
–
Specifies whether termination protection is enabled for the dashboard. If termination protection is enabled, you cannot delete the dashboard until termination protection is disabled.
-
widgets
(Optional[RequestWidgetList], default:
None
)
–
An array of widgets for a custom dashboard. A custom dashboard can have a maximum of ten widgets.
You do not need to specify widgets for the Highlights dashboard.
Raises:
-
ConflictException
–
This exception is thrown when the specified resource is not ready for an operation. This can occur when you try to run an operation on a resource before CloudTrail has time to fully load the resource, or because another operation is modifying the resource. If this exception occurs, wait a few minutes, and then try the operation again.
-
EventDataStoreNotFoundException
–
The specified event data store was not found.
-
InactiveEventDataStoreException
–
The event data store is inactive.
-
InsufficientEncryptionPolicyException
–
For the CreateTrail PutInsightSelectors, UpdateTrail, StartQuery, and StartImport operations, this exception is thrown when the policy on the S3 bucket or KMS key does not have sufficient permissions for the operation.
For all other operations, this exception is thrown when the policy for the KMS key does not have sufficient permissions for the operation.
-
InvalidQueryStatementException
–
The query that was submitted has validation errors, or uses incorrect syntax or unsupported keywords. For more information about writing a query, see Create or edit a query in the CloudTrail User Guide.
-
InvalidTagParameterException
–
This exception is thrown when the specified tag key or values are not valid. It can also occur if there are duplicate tags or too many tags on the resource.
-
ServiceQuotaExceededException
–
This exception is thrown when the quota is exceeded. For information about CloudTrail quotas, see Service quotas in the Amazon Web Services General Reference.
-
UnsupportedOperationException
–
This exception is thrown when the requested operation is not supported.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_cloudtrail/_services/async_cloud_trail.py
| async def create_dashboard(
self,
name: "capo_cloudtrail.types.dashboard_name.DashboardName",
*,
config_overrides: Optional[AsyncCloudTrailClientConfig] = None,
refresh_schedule: Optional[
"capo_cloudtrail.types.refresh_schedule.RefreshSchedule"
] = None,
tags_list: Optional["capo_cloudtrail.types.tags_list.TagsList"] = None,
termination_protection_enabled: Optional[
"capo_cloudtrail.types.termination_protection_enabled.TerminationProtectionEnabled"
] = None,
widgets: Optional[
"capo_cloudtrail.types.request_widget_list.RequestWidgetList"
] = None,
) -> "capo_cloudtrail.types.create_dashboard_response.CreateDashboardResponse":
"""<important> <p>CloudTrail Lake will no longer be open to new customers starting May 31, 2026. If you would like to use CloudTrail Lake, sign up prior to that date. Existing customers can continue to use the service as normal. For more information, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-service-availability-change.html">CloudTrail Lake availability change</a>.</p> </important> <p> Creates a custom dashboard or the Highlights dashboard. </p> <ul> <li> <p> <b>Custom dashboards</b> - 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.</p> </li> <li> <p> <b>Highlights dashboard</b> - 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.</p> </li> </ul> <p> CloudTrail runs queries to populate the dashboard's widgets during a manual or scheduled refresh. CloudTrail must be granted permissions to run the <code>StartQuery</code> operation on your behalf. To provide permissions, run the <code>PutResourcePolicy</code> operation to attach a resource-based policy to each event data store. For more information, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/security_iam_resource-based-policy-examples.html#security_iam_resource-based-policy-examples-eds-dashboard">Example: Allow CloudTrail to run queries to populate a dashboard</a> in the <i>CloudTrail User Guide</i>. </p> <p> To set a refresh schedule, CloudTrail must be granted permissions to run the <code>StartDashboardRefresh</code> operation to refresh the dashboard on your behalf. To provide permissions, run the <code>PutResourcePolicy</code> operation to attach a resource-based policy to the dashboard. For more information, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/security_iam_resource-based-policy-examples.html#security_iam_resource-based-policy-examples-dashboards"> Resource-based policy example for a dashboard</a> in the <i>CloudTrail User Guide</i>. </p> <p>For more information about dashboards, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/lake-dashboard.html">CloudTrail Lake dashboards</a> in the <i>CloudTrail User Guide</i>.</p>
Args:
name: <p> The name of the dashboard. The name must be unique to your account. </p> <p>To create the Highlights dashboard, the name must be <code>AWSCloudTrail-Highlights</code>.</p>
refresh_schedule: <p> The refresh schedule configuration for the dashboard. </p> <p>To create the Highlights dashboard, you must set a refresh schedule and set the <code>Status</code> to <code>ENABLED</code>. The <code>Unit</code> for the refresh schedule must be <code>HOURS</code> and the <code>Value</code> must be <code>6</code>.</p>
termination_protection_enabled: <p> Specifies whether termination protection is enabled for the dashboard. If termination protection is enabled, you cannot delete the dashboard until termination protection is disabled. </p>
widgets: <p> An array of widgets for a custom dashboard. A custom dashboard can have a maximum of ten widgets. </p> <p>You do not need to specify widgets for the Highlights dashboard.</p>
Raises:
capo_cloudtrail.errors.conflict_exception.ConflictException: <p>This exception is thrown when the specified resource is not ready for an operation. This can occur when you try to run an operation on a resource before CloudTrail has time to fully load the resource, or because another operation is modifying the resource. If this exception occurs, wait a few minutes, and then try the operation again.</p>
capo_cloudtrail.errors.event_data_store_not_found_exception.EventDataStoreNotFoundException: <p>The specified event data store was not found.</p>
capo_cloudtrail.errors.inactive_event_data_store_exception.InactiveEventDataStoreException: <p>The event data store is inactive.</p>
capo_cloudtrail.errors.insufficient_encryption_policy_exception.InsufficientEncryptionPolicyException: <p>For the <code>CreateTrail</code> <code>PutInsightSelectors</code>, <code>UpdateTrail</code>, <code>StartQuery</code>, and <code>StartImport</code> operations, this exception is thrown when the policy on the S3 bucket or KMS key does not have sufficient permissions for the operation.</p> <p>For all other operations, this exception is thrown when the policy for the KMS key does not have sufficient permissions for the operation.</p>
capo_cloudtrail.errors.invalid_query_statement_exception.InvalidQueryStatementException: <p>The query that was submitted has validation errors, or uses incorrect syntax or unsupported keywords. For more information about writing a query, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-create-edit-query.html">Create or edit a query</a> in the <i>CloudTrail User Guide</i>.</p>
capo_cloudtrail.errors.invalid_tag_parameter_exception.InvalidTagParameterException: <p>This exception is thrown when the specified tag key or values are not valid. It can also occur if there are duplicate tags or too many tags on the resource.</p>
capo_cloudtrail.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p> This exception is thrown when the quota is exceeded. For information about CloudTrail quotas, see <a href="https://docs.aws.amazon.com/general/latest/gr/ct.html#limits_cloudtrail">Service quotas</a> in the <i>Amazon Web Services General Reference</i>. </p>
capo_cloudtrail.errors.unsupported_operation_exception.UnsupportedOperationException: <p>This exception is thrown when the requested operation is not supported.</p>
capo_cloudtrail.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_cloudtrail.types.create_dashboard_request.CreateDashboardRequest]",
) -> AsyncOperationResponse[
"capo_cloudtrail.types.create_dashboard_response.CreateDashboardResponse"
]:
import capo_cloudtrail._operations.cloud_trail_20131101.create_dashboard
(
output,
http_response,
) = await capo_cloudtrail._operations.cloud_trail_20131101.create_dashboard.async_create_dashboard(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CreateDashboard")
)
input_: capo_cloudtrail.types.create_dashboard_request.CreateDashboardRequest = {
"name": name
}
if refresh_schedule is not None:
input_["refresh_schedule"] = refresh_schedule
if tags_list is not None:
input_["tags_list"] = tags_list
if termination_protection_enabled is not None:
input_["termination_protection_enabled"] = termination_protection_enabled
if widgets is not None:
input_["widgets"] = widgets
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|