CfnDashboardPropsMixin

class aws_cdk.mixins_preview.aws_cloudtrail.mixins.CfnDashboardPropsMixin(props, *, strategy=None)

Bases: Mixin

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 AWS 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 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:

IConstruct

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 x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.

Stability:

experimental

FrequencyProperty

class CfnDashboardPropsMixin.FrequencyProperty(*, unit=None, value=None)

Bases: object

Specifies 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 be HOURS or DAYS . For the Highlights dashboard, the Unit must be HOURS .

  • value (Union[int, float, None]) – The value for the refresh schedule. For custom dashboards, the following values are valid when the unit is HOURS : 1 , 6 , 12 , 24 For custom dashboards, the only valid value when the unit is DAYS is 1 . For the Highlights dashboard, the Value must be 6 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-dashboard-frequency.html

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 HOURS or DAYS .

For the Highlights dashboard, the Unit must be HOURS .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-dashboard-frequency.html#cfn-cloudtrail-dashboard-frequency-unit

value

The value for the refresh schedule.

For custom dashboards, the following values are valid when the unit is HOURS : 1 , 6 , 12 , 24

For custom dashboards, the only valid value when the unit is DAYS is 1 .

For the Highlights dashboard, the Value must be 6 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-dashboard-frequency.html#cfn-cloudtrail-dashboard-frequency-value

RefreshScheduleProperty

class CfnDashboardPropsMixin.RefreshScheduleProperty(*, frequency=None, status=None, time_of_day=None)

Bases: object

The 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 to ENABLED to enable the refresh schedule, or to DISABLED to 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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-dashboard-refreshschedule.html

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-dashboard-refreshschedule.html#cfn-cloudtrail-dashboard-refreshschedule-frequency

status

Specifies whether the refresh schedule is enabled.

Set the value to ENABLED to enable the refresh schedule, or to DISABLED to turn off the refresh schedule.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-dashboard-refreshschedule.html#cfn-cloudtrail-dashboard-refreshschedule-status

time_of_day

The time of day in UTC to run the schedule;

for hourly only refer to minutes; default is 00:00.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-dashboard-refreshschedule.html#cfn-cloudtrail-dashboard-refreshschedule-timeofday

WidgetProperty

class CfnDashboardPropsMixin.WidgetProperty(*, query_parameters=None, query_statement=None, view_properties=None)

Bases: object

Contains 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 ? with eventTime , ? 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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-dashboard-widget.html

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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-dashboard-widget.html#cfn-cloudtrail-dashboard-widget-queryparameters

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: ``'?'`` .
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-dashboard-widget.html#cfn-cloudtrail-dashboard-widget-querystatement

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 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-dashboard-widget.html#cfn-cloudtrail-dashboard-widget-viewproperties