Skip to content

update_dashboard async

update_dashboard(
    dashboard_id: DashboardArn,
    *,
    config_overrides: Optional[AsyncCloudTrailClientConfig] = None,
    widgets: Optional[RequestWidgetList] = None,
    refresh_schedule: Optional[RefreshSchedule] = None,
    termination_protection_enabled: Optional[TerminationProtectionEnabled] = None,
) -> UpdateDashboardResponse

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.

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.

Parameters:

  • dashboard_id (DashboardArn) –

    The name or ARN of the dashboard.

  • widgets (Optional[RequestWidgetList], default: None ) –

    An array of widgets for the dashboard. A custom dashboard can have a maximum of 10 widgets.

    To add new widgets, pass in an array that includes the existing widgets along with any new widgets. Run the GetDashboard operation to get the list of widgets for the dashboard.

    To remove widgets, pass in an array that includes the existing widgets minus the widgets you want removed.

  • refresh_schedule (Optional[RefreshSchedule], default: None ) –

    The refresh schedule configuration for the dashboard.

  • 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.

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.

  • ResourceNotFoundException –

    This exception is thrown when the specified resource is not found.

  • 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 update_dashboard(
    self,
    dashboard_id: "capo_cloudtrail.types.dashboard_arn.DashboardArn",
    *,
    config_overrides: Optional[AsyncCloudTrailClientConfig] = None,
    widgets: Optional[
        "capo_cloudtrail.types.request_widget_list.RequestWidgetList"
    ] = None,
    refresh_schedule: Optional[
        "capo_cloudtrail.types.refresh_schedule.RefreshSchedule"
    ] = None,
    termination_protection_enabled: Optional[
        "capo_cloudtrail.types.termination_protection_enabled.TerminationProtectionEnabled"
    ] = None,
) -> "capo_cloudtrail.types.update_dashboard_response.UpdateDashboardResponse":
    """<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> Updates the specified dashboard. </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> 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>

    Args:
        dashboard_id: <p> The name or ARN of the dashboard. </p>
        widgets: <p> An array of widgets for the dashboard. A custom dashboard can have a maximum of 10 widgets. </p> <p>To add new widgets, pass in an array that includes the existing widgets along with any new widgets. Run the <code>GetDashboard</code> operation to get the list of widgets for the dashboard.</p> <p>To remove widgets, pass in an array that includes the existing widgets minus the widgets you want removed.</p>
        refresh_schedule: <p> The refresh schedule configuration for the dashboard. </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>

    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.resource_not_found_exception.ResourceNotFoundException: <p>This exception is thrown when the specified resource is not found.</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.update_dashboard_request.UpdateDashboardRequest]",
    ) -> AsyncOperationResponse[
        "capo_cloudtrail.types.update_dashboard_response.UpdateDashboardResponse"
    ]:
        import capo_cloudtrail._operations.cloud_trail_20131101.update_dashboard

        (
            output,
            http_response,
        ) = await capo_cloudtrail._operations.cloud_trail_20131101.update_dashboard.async_update_dashboard(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateDashboard")
    )
    input_: capo_cloudtrail.types.update_dashboard_request.UpdateDashboardRequest = {
        "dashboard_id": dashboard_id
    }
    if widgets is not None:
        input_["widgets"] = widgets
    if refresh_schedule is not None:
        input_["refresh_schedule"] = refresh_schedule
    if termination_protection_enabled is not None:
        input_["termination_protection_enabled"] = termination_protection_enabled

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output