Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions aws_lambda_powertools/utilities/parser/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@
)
from .event_bridge import EventBridgeModel
from .event_bridge_v2 import EventBridgeV2Model, EventBridgeV2RecordModel, EventBridgeV2SystemMetadataModel
from .iot_registry_events import (
IoTCoreAddOrDeleteFromThingGroupEvent,
IoTCoreAddOrRemoveFromThingGroupEvent,
IoTCoreThingEvent,
IoTCoreThingGroupEvent,
IoTCoreThingTypeAssociationEvent,
IoTCoreThingTypeEvent,
)
from .kafka import (
KafkaBaseEventModel,
KafkaMskEventModel,
Expand Down Expand Up @@ -203,6 +211,12 @@
"EventBridgeV2Model": "event_bridge_v2",
"EventBridgeV2RecordModel": "event_bridge_v2",
"EventBridgeV2SystemMetadataModel": "event_bridge_v2",
"IoTCoreAddOrDeleteFromThingGroupEvent": "iot_registry_events",
"IoTCoreAddOrRemoveFromThingGroupEvent": "iot_registry_events",
"IoTCoreThingEvent": "iot_registry_events",
"IoTCoreThingGroupEvent": "iot_registry_events",
"IoTCoreThingTypeAssociationEvent": "iot_registry_events",
"IoTCoreThingTypeEvent": "iot_registry_events",
"KafkaBaseEventModel": "kafka",
"KafkaMskEventModel": "kafka",
"KafkaRecordModel": "kafka",
Expand Down Expand Up @@ -370,6 +384,12 @@ def __dir__() -> list[str]:
"KafkaSelfManagedEventModel",
"KafkaRecordModel",
"KafkaMskEventModel",
"IoTCoreAddOrDeleteFromThingGroupEvent",
"IoTCoreAddOrRemoveFromThingGroupEvent",
"IoTCoreThingEvent",
"IoTCoreThingGroupEvent",
"IoTCoreThingTypeAssociationEvent",
"IoTCoreThingTypeEvent",
"KafkaBaseEventModel",
"KinesisFirehoseSqsModel",
"KinesisFirehoseSqsRecord",
Expand Down
4 changes: 2 additions & 2 deletions docs/utilities/parser.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ The example above uses `SqsModel`. Other built-in models can be found below.
| **CloudFormationCustomResourceCreateModel** | Lambda Event Source payload for AWS CloudFormation `CREATE` operation |
| **CloudFormationCustomResourceUpdateModel** | Lambda Event Source payload for AWS CloudFormation `UPDATE` operation |
| **CloudFormationCustomResourceDeleteModel** | Lambda Event Source payload for AWS CloudFormation `DELETE` operation |
| **CloudwatchLogsModel** | Lambda Event Source payload for Amazon CloudWatch Logs |
| **CloudWatchLogsModel** | Lambda Event Source payload for Amazon CloudWatch Logs |
| **CognitoPreSignupTriggerModel** | Lambda User Pool Pre-Sign-Up trigger event |
| **CognitoPostConfirmationTriggerModel** | Lambda User Pool Post Confirmation trigger event |
| **CognitoPreAuthenticationTriggerModel** | Lambda User Pool Pre Authentication trigger event |
Expand Down Expand Up @@ -212,7 +212,7 @@ You can use pre-built envelopes provided by the Parser to extract and parse spec
| **EventBridgeEnvelope** | 1. Parses data using `EventBridgeModel`. ``2. Parses `detail` key using your model`` and returns it. | `Model` |
| **EventBridgeV2Envelope** | 1. Parses data using `EventBridgeV2Model`. ``2. Parses `Data` (or `Data.detail` for PutEvents) of each record using your model`` and returns them in a list. Also accepts RAW deliveries. | `List[Model]` |
| **SqsEnvelope** | 1. Parses data using `SqsModel`. ``2. Parses records in `body` key using your model`` and return them in a list. | `List[Model]` |
| **CloudWatchLogsEnvelope** | 1. Parses data using `CloudwatchLogsModel` which will base64 decode and decompress it. ``2. Parses records in `message` key using your model`` and return them in a list. | `List[Model]` |
| **CloudWatchLogsEnvelope** | 1. Parses data using `CloudWatchLogsModel` which will base64 decode and decompress it. ``2. Parses records in `message` key using your model`` and return them in a list. | `List[Model]` |
| **KinesisDataStreamEnvelope** | 1. Parses data using `KinesisDataStreamModel` which will base64 decode it. ``2. Parses records in the `Records` key using your model`` and returns them in a list. | `List[Model]` |
| **KinesisFirehoseEnvelope** | 1. Parses data using `KinesisFirehoseModel` which will base64 decode it. ``2. Parses records in the `Records` key using your model`` and returns them in a list. | `List[Model]` |
| **SnsEnvelope** | 1. Parses data using `SnsModel`. ``2. Parses records in `body` key using your model`` and return them in a list. | `List[Model]` |
Expand Down
6 changes: 6 additions & 0 deletions tests/functional/parser/test_model_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@

MODEL_IMPORT_CASES = [
("SqsModel", "sqs", ["sqs"]),
("IoTCoreThingEvent", "iot_registry_events", ["iot_registry_events"]),
("IoTCoreThingTypeEvent", "iot_registry_events", ["iot_registry_events"]),
("IoTCoreThingTypeAssociationEvent", "iot_registry_events", ["iot_registry_events"]),
("IoTCoreThingGroupEvent", "iot_registry_events", ["iot_registry_events"]),
("IoTCoreAddOrRemoveFromThingGroupEvent", "iot_registry_events", ["iot_registry_events"]),
("IoTCoreAddOrDeleteFromThingGroupEvent", "iot_registry_events", ["iot_registry_events"]),
("S3Model", "s3", ["s3", "event_bridge"]),
("AppSyncEventsModel", "appsync_events", ["appsync_events", "appsync"]),
("LambdaFunctionUrlModel", "lambda_function_url", ["lambda_function_url", "apigwv2"]),
Expand Down