ArchiveProps

class aws_cdk.aws_events.ArchiveProps(*, archive_name=None, description=None, event_pattern, retention=None, source_event_bus)

Bases: aws_cdk.aws_events.BaseArchiveProps

The event archive properties.

Parameters
  • archive_name (Optional[str]) – The name of the archive. Default: - Automatically generated

  • description (Optional[str]) – A description for the archive. Default: - none

  • event_pattern (EventPattern) – An event pattern to use to filter events sent to the archive.

  • retention (Optional[Duration]) – The number of days to retain events for. Default value is 0. If set to 0, events are retained indefinitely. Default: - Infinite

  • source_event_bus (IEventBus) – The event source associated with the archive.

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_events as events
import aws_cdk.core as cdk

# detail is of type object
# event_bus is of type EventBus

archive_props = events.ArchiveProps(
    event_pattern=events.EventPattern(
        account=["account"],
        detail={
            "detail_key": detail
        },
        detail_type=["detailType"],
        id=["id"],
        region=["region"],
        resources=["resources"],
        source=["source"],
        time=["time"],
        version=["version"]
    ),
    source_event_bus=event_bus,

    # the properties below are optional
    archive_name="archiveName",
    description="description",
    retention=cdk.Duration.minutes(30)
)

Attributes

archive_name

The name of the archive.

Default
  • Automatically generated

Return type

Optional[str]

description

A description for the archive.

Default
  • none

Return type

Optional[str]

event_pattern

An event pattern to use to filter events sent to the archive.

Return type

EventPattern

retention

The number of days to retain events for.

Default value is 0. If set to 0, events are retained indefinitely.

Default
  • Infinite

Return type

Optional[Duration]

source_event_bus

The event source associated with the archive.

Return type

IEventBus