AddEventSelectorOptions

class aws_cdk.aws_cloudtrail.AddEventSelectorOptions(*, exclude_management_event_sources=None, include_management_events=None, read_write_type=None)

Bases: object

Options for adding an event selector.

Parameters:
  • exclude_management_event_sources (Optional[Sequence[ManagementEventSources]]) – An optional list of service event sources from which you do not want management events to be logged on your trail. Default: []

  • include_management_events (Optional[bool]) – Specifies whether the event selector includes management events for the trail. Default: true

  • read_write_type (Optional[ReadWriteType]) – Specifies whether to log read-only events, write-only events, or all events. Default: ReadWriteType.All

ExampleMetadata:

infused

Example:

import aws_cdk.aws_cloudtrail as cloudtrail

# source_bucket: s3.Bucket

source_output = codepipeline.Artifact()
key = "some/key.zip"
trail = cloudtrail.Trail(self, "CloudTrail")
trail.add_s3_event_selector([cloudtrail.S3EventSelector(
    bucket=source_bucket,
    object_prefix=key
)],
    read_write_type=cloudtrail.ReadWriteType.WRITE_ONLY
)
source_action = codepipeline_actions.S3SourceAction(
    action_name="S3Source",
    bucket_key=key,
    bucket=source_bucket,
    output=source_output,
    trigger=codepipeline_actions.S3Trigger.EVENTS
)

Attributes

exclude_management_event_sources

An optional list of service event sources from which you do not want management events to be logged on your trail.

Default:

[]

include_management_events

Specifies whether the event selector includes management events for the trail.

Default:

true

read_write_type

Specifies whether to log read-only events, write-only events, or all events.

Default:

ReadWriteType.All