CfnDashboardPropsMixin
- class aws_cdk.mixins_preview.aws_cloudtrail.mixins.CfnDashboardPropsMixin(props, *, strategy=None)
Bases:
MixinCreates 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
StartQueryoperation on your behalf. To provide permissions, run thePutResourcePolicyoperation 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 AWS CloudTrail User Guide .To set a refresh schedule, CloudTrail must be granted permissions to run the
StartDashboardRefreshoperation to refresh the dashboard on your behalf. To provide permissions, run thePutResourcePolicyoperation to attach a resource-based policy to the dashboard. For more information, see Resource-based policy example for a dashboard in the AWS CloudTrail User Guide .For more information about dashboards, see CloudTrail Lake dashboards in the AWS CloudTrail User Guide .
- See:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-dashboard.html
- CloudformationResource:
AWS::CloudTrail::Dashboard
- Mixin:
true
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview import mixins from aws_cdk.mixins_preview.aws_cloudtrail import mixins as cloudtrail_mixins cfn_dashboard_props_mixin = cloudtrail_mixins.CfnDashboardPropsMixin(cloudtrail_mixins.CfnDashboardMixinProps( name="name", refresh_schedule=cloudtrail_mixins.CfnDashboardPropsMixin.RefreshScheduleProperty( frequency=cloudtrail_mixins.CfnDashboardPropsMixin.FrequencyProperty( unit="unit", value=123 ), status="status", time_of_day="timeOfDay" ), tags=[CfnTag( key="key", value="value" )], termination_protection_enabled=False, widgets=[cloudtrail_mixins.CfnDashboardPropsMixin.WidgetProperty( query_parameters=["queryParameters"], query_statement="queryStatement", view_properties={ "view_properties_key": "viewProperties" } )] ), strategy=mixins.PropertyMergeStrategy.OVERRIDE )
Create a mixin to apply properties to
AWS::CloudTrail::Dashboard.- Parameters:
props (
Union[CfnDashboardMixinProps,Dict[str,Any]]) – L1 properties to apply.strategy (
Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE
Methods
- apply_to(construct)
Apply the mixin properties to the construct.
- Parameters:
construct (
IConstruct)- Return type:
- supports(construct)
Check if this mixin supports the given construct.
- Parameters:
construct (
IConstruct)- Return type:
bool
Attributes
- CFN_PROPERTY_KEYS = ['name', 'refreshSchedule', 'tags', 'terminationProtectionEnabled', 'widgets']
Static Methods
- classmethod is_mixin(x)
(experimental) Checks if
xis a Mixin.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsMixin.- Stability:
experimental
FrequencyProperty
- class CfnDashboardPropsMixin.FrequencyProperty(*, unit=None, value=None)
Bases:
objectSpecifies the frequency for a dashboard refresh schedule.
For a custom dashboard, you can schedule a refresh for every 1, 6, 12, or 24 hours, or every day.
- Parameters:
unit (
Optional[str]) – The unit to use for the refresh. For custom dashboards, the unit can beHOURSorDAYS. For the Highlights dashboard, theUnitmust beHOURS.value (
Union[int,float,None]) – The value for the refresh schedule. For custom dashboards, the following values are valid when the unit isHOURS:1,6,12,24For custom dashboards, the only valid value when the unit isDAYSis1. For the Highlights dashboard, theValuemust be6.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_cloudtrail import mixins as cloudtrail_mixins frequency_property = cloudtrail_mixins.CfnDashboardPropsMixin.FrequencyProperty( unit="unit", value=123 )
Attributes
- unit
The unit to use for the refresh.
For custom dashboards, the unit can be
HOURSorDAYS.For the Highlights dashboard, the
Unitmust beHOURS.
- value
The value for the refresh schedule.
For custom dashboards, the following values are valid when the unit is
HOURS:1,6,12,24For custom dashboards, the only valid value when the unit is
DAYSis1.For the Highlights dashboard, the
Valuemust be6.
RefreshScheduleProperty
- class CfnDashboardPropsMixin.RefreshScheduleProperty(*, frequency=None, status=None, time_of_day=None)
Bases:
objectThe schedule for a dashboard refresh.
- Parameters:
frequency (
Union[IResolvable,FrequencyProperty,Dict[str,Any],None]) – The frequency at which you want the dashboard refreshed.status (
Optional[str]) – Specifies whether the refresh schedule is enabled. Set the value toENABLEDto enable the refresh schedule, or toDISABLEDto turn off the refresh schedule.time_of_day (
Optional[str]) – The time of day in UTC to run the schedule; for hourly only refer to minutes; default is 00:00.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_cloudtrail import mixins as cloudtrail_mixins refresh_schedule_property = cloudtrail_mixins.CfnDashboardPropsMixin.RefreshScheduleProperty( frequency=cloudtrail_mixins.CfnDashboardPropsMixin.FrequencyProperty( unit="unit", value=123 ), status="status", time_of_day="timeOfDay" )
Attributes
- frequency
The frequency at which you want the dashboard refreshed.
- status
Specifies whether the refresh schedule is enabled.
Set the value to
ENABLEDto enable the refresh schedule, or toDISABLEDto turn off the refresh schedule.
- time_of_day
The time of day in UTC to run the schedule;
for hourly only refer to minutes; default is 00:00.
WidgetProperty
- class CfnDashboardPropsMixin.WidgetProperty(*, query_parameters=None, query_statement=None, view_properties=None)
Bases:
objectContains information about a widget on a CloudTrail Lake dashboard.
- Parameters:
query_parameters (
Optional[Sequence[str]]) – The optional query parameters. The following query parameters are valid:$StartTime$,$EndTime$, and$Period$.query_statement (
Optional[str]) – The query statement for the widget. For custom dashboard widgets, you can query across multiple event data stores as long as all event data stores exist in your account. .. epigraph:: When a query uses?witheventTime,?must be surrounded by single quotes as follows:'?'.view_properties (
Union[Mapping[str,str],IResolvable,None]) – The view properties for the widget. For more information about view properties, see View properties for widgets in the AWS CloudTrail User Guide .
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_cloudtrail import mixins as cloudtrail_mixins widget_property = cloudtrail_mixins.CfnDashboardPropsMixin.WidgetProperty( query_parameters=["queryParameters"], query_statement="queryStatement", view_properties={ "view_properties_key": "viewProperties" } )
Attributes
- query_parameters
The optional query parameters.
The following query parameters are valid:
$StartTime$,$EndTime$, and$Period$.
- query_statement
The query statement for the widget.
For custom dashboard widgets, you can query across multiple event data stores as long as all event data stores exist in your account. .. epigraph:
When a query uses ``?`` with ``eventTime`` , ``?`` must be surrounded by single quotes as follows: ``'?'`` .
- view_properties
The view properties for the widget.
For more information about view properties, see View properties for widgets in the AWS CloudTrail User Guide .