Skip to content

Commit 92363ac

Browse files
committed
fix mypy and use events from tests
1 parent 51db5d5 commit 92363ac

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+87
-1278
lines changed

docs/utilities/data_classes.md

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ for more details.
120120
=== "Active MQ Example Event"
121121

122122
```json hl_lines="6 9 18 21"
123-
--8<-- "examples/event_sources/events/active_mq_event_example.json"
123+
--8<-- "tests/events/activeMQEvent.json"
124124
```
125125

126126
### API Gateway Authorizer
@@ -138,7 +138,7 @@ Use **`APIGatewayAuthorizerRequestEvent`** for type `REQUEST` and **`APIGatewayA
138138
=== "API Gateway Authorizer Request Example Event"
139139

140140
```json hl_lines="3 11"
141-
--8<-- "examples/event_sources/events/apiGatewayAuthorizerRequestEvent.json"
141+
--8<-- "tests/events/apiGatewayAuthorizerRequestEvent.json"
142142
```
143143

144144
=== "app_token.py"
@@ -150,7 +150,7 @@ Use **`APIGatewayAuthorizerRequestEvent`** for type `REQUEST` and **`APIGatewayA
150150
=== "API Gateway Authorizer Token Example Event"
151151

152152
```json hl_lines="2 3"
153-
--8<-- "examples/event_sources/events/apiGatewayAuthorizerTokenEvent.json"
153+
--8<-- "tests/events/apiGatewayAuthorizerTokenEvent.json"
154154
```
155155

156156
### API Gateway Authorizer V2
@@ -167,7 +167,7 @@ See also [this blog post](https://aws.amazon.com/blogs/compute/introducing-iam-a
167167
=== "API Gateway Authorizer V2 Example Event"
168168

169169
```json
170-
--8<-- "examples/event_sources/events/apiGatewayAuthorizerV2Event.json"
170+
--8<-- "tests/events/apiGatewayAuthorizerV2Event.json"
171171
```
172172

173173
### API Gateway Proxy
@@ -199,7 +199,7 @@ It is used for HTTP API using v2 proxy event.
199199
=== "API Gateway Proxy V2 Example Event"
200200

201201
```json
202-
--8<-- "examples/event_sources/events/apiGatewayProxyV2Event.json"
202+
--8<-- "tests/events/apiGatewayProxyV2Event.json"
203203
```
204204

205205
### Application Load Balancer
@@ -215,7 +215,7 @@ Is it used for [Application load balancer](https://docs.aws.amazon.com/elasticlo
215215
=== "Application Load Balancer Example Event"
216216

217217
```json hl_lines="7 8"
218-
--8<-- "examples/event_sources/events/albEvent.json"
218+
--8<-- "tests/events/albEvent.json"
219219
```
220220

221221
### AppSync Authorizer
@@ -233,7 +233,7 @@ or read the Amplify documentation on using [AWS Lambda for authorization](https:
233233
=== "AppSync Authorizer Example Event"
234234

235235
```json
236-
--8<-- "examples/event_sources/events/appSyncAuthorizerEvent.json"
236+
--8<-- "tests/events/appSyncAuthorizerEvent.json"
237237
```
238238

239239
### AppSync Resolver
@@ -252,7 +252,7 @@ The example serves as an AppSync resolver for the `locations` field of the `Merc
252252
=== "AppSync Resolver Example Event"
253253

254254
```json
255-
--8<-- "examples/event_sources/events/appSyncResolverEvent.json"
255+
--8<-- "tests/events/appSyncResolverEvent.json"
256256
```
257257

258258
### AWS Config Rule
@@ -266,7 +266,7 @@ The example utilizes AWSConfigRuleEvent to parse the incoming event. The functio
266266

267267
=== "ScheduledNotification Example Event"
268268
```json
269-
--8<-- "examples/event_sources/src/aws_config_rule_scheduled.json"
269+
--8<-- "tests/events/awsConfigRuleScheduled.json"
270270
```
271271

272272
### Bedrock Agent
@@ -281,7 +281,7 @@ The example handles [Bedrock Agent event](https://aws.amazon.com/bedrock/agents/
281281

282282
=== "Bedrock Agent Example Event"
283283
```json
284-
--8<-- "examples/event_sources/events/bedrockAgentEvent.json"
284+
--8<-- "tests/events/bedrockAgentEvent.json"
285285
```
286286

287287
### CloudFormation Custom Resource
@@ -296,7 +296,7 @@ The example focuses on the `Create` request type, generating a unique physical r
296296

297297
=== "CloudFormation Custom Resource Example Event"
298298
```json
299-
--8<-- "examples/event_sources/events/cloudformationCustomResourceCreate.json"
299+
--8<-- "tests/events/cloudformationCustomResourceCreate.json"
300300
```
301301

302302
### CloudWatch Dashboard Custom Widget
@@ -311,7 +311,7 @@ Thie example for `CloudWatchDashboardCustomWidgetEvent` logs the dashboard name,
311311

312312
=== "CloudWatch Dashboard Example Event"
313313
```json
314-
--8<-- "examples/event_sources/events/cloudWatchDashboardEvent.json"
314+
--8<-- "tests/events/cloudWatchDashboardEvent.json"
315315
```
316316

317317
### CloudWatch Alarm State Change Action
@@ -327,7 +327,7 @@ You can use the `CloudWathAlarmEvent` data class to access the fields containing
327327

328328
=== "CloudWatch Alarm Example Event"
329329
```json
330-
--8<-- "examples/event_sources/events/cloudWatchAlarmEventSingleMetric.json"
330+
--8<-- "tests/events/cloudWatchAlarmEventSingleMetric.json"
331331
```
332332

333333
### CloudWatch Logs
@@ -343,7 +343,7 @@ decompress and parse json data from the event.
343343

344344
=== "CloudWatch Logs Example Event"
345345
```json
346-
--8<-- "examples/event_sources/events/cloudWatchLogEvent.json"
346+
--8<-- "tests/events/cloudWatchLogEvent.json"
347347
```
348348

349349
#### Kinesis integration
@@ -358,7 +358,7 @@ decompress and parse json data from the event.
358358

359359
=== "Kinesis Stream CloudWatch Logs Example Event"
360360
```json
361-
--8<-- "examples/event_sources/events/kinesisStreamCloudWatchLogsEvent.json"
361+
--8<-- "tests/events/kinesisStreamCloudWatchLogsEvent.json"
362362
```
363363

364364
Alternatively, you can use `extract_cloudwatch_logs_from_record` to seamless integrate with the [Batch utility](./batch.md){target="_blank"} for more robust log processing.
@@ -371,7 +371,7 @@ Alternatively, you can use `extract_cloudwatch_logs_from_record` to seamless int
371371

372372
=== "Kinesis Stream CloudWatch Logs Example Event"
373373
```json
374-
--8<-- "examples/event_sources/events/kinesisStreamCloudWatchLogsEvent.json"
374+
--8<-- "tests/events/kinesisStreamCloudWatchLogsEvent.json"
375375
```
376376

377377
### CodeDeploy LifeCycle Hook
@@ -388,7 +388,7 @@ to test applications at different stages of deployment.
388388

389389
=== "CodeDeploy LifeCycle Hook Example Event"
390390
```json
391-
--8<-- "examples/event_sources/events/codeDeployLifecycleHookEvent.json"
391+
--8<-- "tests/events/codeDeployLifecycleHookEvent.json"
392392
```
393393

394394
### CodePipeline Job
@@ -401,7 +401,7 @@ Data classes and utility functions to help create continuous delivery pipelines
401401
```
402402
=== "CodePipeline Job Example Event"
403403
```json hl_lines="3 19"
404-
--8<-- "examples/event_sources/events/codePipelineEvent.json"
404+
--8<-- "tests/events/codePipelineEvent.json"
405405
```
406406

407407
### Cognito User Pool
@@ -437,7 +437,7 @@ Some examples for the Cognito User Pools Lambda triggers sources:
437437

438438
=== "Cognito Post Confirmation Example Event"
439439
```json hl_lines="12-14"
440-
--8<-- "examples/event_sources/events/cognitoPostConfirmationEvent.json"
440+
--8<-- "tests/events/cognitoPostConfirmationEvent.json"
441441
```
442442

443443
#### Define Auth Challenge Example
@@ -455,7 +455,7 @@ This example is based on the AWS Cognito docs for [Define Auth Challenge Lambda
455455

456456
=== "Cognito Define Auth Challengen Example Event"
457457
```json
458-
--8<-- "examples/event_sources/events/cognitoDefineAuthChallengeEvent.json"
458+
--8<-- "tests/events/cognitoDefineAuthChallengeEvent.json"
459459
```
460460

461461
#### Create Auth Challenge Example
@@ -468,9 +468,9 @@ This example is based on the AWS Cognito docs for [Create Auth Challenge Lambda
468468
--8<-- "examples/event_sources/src/cognito_create_auth.py"
469469
```
470470

471-
=== "Cognito Define Auth Challengen Example Event"
471+
=== "Cognito Create Auth Challengen Example Event"
472472
```json
473-
--8<-- "examples/event_sources/events/cognitoCreateAuthChallengeEvent.json"
473+
--8<-- "tests/events/cognitoCreateAuthChallengeEvent.json"
474474
```
475475

476476
#### Verify Auth Challenge Response Example
@@ -485,7 +485,7 @@ This example is based on the AWS Cognito docs for [Verify Auth Challenge Respons
485485

486486
=== "Cognito Verify Auth Challengen Example Event"
487487
```json
488-
--8<-- "examples/event_sources/events/cognitoVerifyAuthChallengeResponseEvent.json"
488+
--8<-- "tests/events/cognitoVerifyAuthChallengeResponseEvent.json"
489489
```
490490

491491
### Connect Contact Flow
@@ -500,7 +500,7 @@ The example integrates with [Amazon Connect](https://docs.aws.amazon.com/connect
500500

501501
=== "Connect Contact Flow Example Event"
502502
```json
503-
--8<-- "examples/event_sources/events/connectContactFlowEventAll.json"
503+
--8<-- "tests/events/connectContactFlowEventAll.json"
504504
```
505505

506506
### DynamoDB Streams
@@ -519,7 +519,7 @@ The class automatically deserializes DynamoDB types into their equivalent Python
519519
```
520520
=== "DynamoDB Streams Example Event"
521521
```json
522-
--8<-- "examples/event_sources/events/dynamoStreamEvent.json"
522+
--8<-- "tests/events/dynamoStreamEvent.json"
523523
```
524524

525525
### EventBridge
@@ -534,7 +534,7 @@ The class automatically deserializes DynamoDB types into their equivalent Python
534534

535535
=== "EventBridge Example Event"
536536
```json
537-
--8<-- "examples/event_sources/events/eventBridgeEvent.json"
537+
--8<-- "tests/events/eventBridgeEvent.json"
538538
```
539539

540540
### Kafka
@@ -549,7 +549,7 @@ This example is based on the AWS docs for [Amazon MSK](https://docs.aws.amazon.c
549549

550550
=== "Kafka Example Event"
551551
```json
552-
--8<-- "examples/event_sources/events/kafkaEventMsk.json"
552+
--8<-- "tests/events/kafkaEventMsk.json"
553553
```
554554

555555
### Kinesis streams
@@ -565,7 +565,7 @@ or plain text, depending on the original payload.
565565

566566
=== "Kinesis streams Example Event"
567567
```json
568-
--8<-- "examples/event_sources/events/kinesisStreamEvent.json"
568+
--8<-- "tests/events/kinesisStreamEvent.json"
569569
```
570570

571571
### Kinesis Firehose delivery stream
@@ -605,7 +605,7 @@ To do that, you can use `KinesisFirehoseDataTransformationResponse` class along
605605

606606
=== "kinesisFirehoseEvent.json"
607607
```json
608-
--8<-- "examples/event_sources/events/kinesisFirehoseKinesisEvent.json"
608+
--8<-- "tests/events/kinesisFirehoseKinesisEvent.json"
609609
```
610610

611611
### Lambda Function URL
@@ -620,7 +620,7 @@ To do that, you can use `KinesisFirehoseDataTransformationResponse` class along
620620

621621
=== "Lambda Function URL Example Event"
622622
```json
623-
--8<-- "examples/event_sources/events/lambdaFunctionUrlEvent.json"
623+
--8<-- "tests/events/lambdaFunctionUrlEvent.json"
624624
```
625625

626626
### Rabbit MQ
@@ -637,7 +637,7 @@ for more details.
637637

638638
=== "Rabbit MQ Example Event"
639639
```json
640-
--8<-- "examples/event_sources/events/rabbitMQEvent.json"
640+
--8<-- "tests/events/rabbitMQEvent.json"
641641
```
642642

643643
### S3
@@ -652,7 +652,7 @@ Integration with Amazon S3 enables automatic, serverless processing of object-le
652652

653653
=== "S3 Example Event"
654654
```json
655-
--8<-- "examples/event_sources/events/s3Event.json"
655+
--8<-- "tests/events/s3Event.json"
656656
```
657657

658658
### S3 Batch Operations
@@ -668,7 +668,7 @@ This example is based on the AWS S3 Batch Operations documentation [Example Lamb
668668
=== "S3 Batch Operations Example Event"
669669

670670
```json
671-
--8<-- "examples/event_sources/events/s3BatchOperationEventSchemaV2.json"
671+
--8<-- "tests/events/s3BatchOperationEventSchemaV2.json"
672672
```
673673

674674
### S3 Object Lambda
@@ -700,7 +700,7 @@ This example is based on the AWS Blog post [Introducing Amazon S3 Object Lambda
700700
=== "S3 EventBridge Notification Example Event"
701701

702702
```json
703-
--8<-- "examples/event_sources/events/s3EventBridgeNotificationObjectCreatedEvent.json"
703+
--8<-- "tests/events/s3EventBridgeNotificationObjectCreatedEvent.json"
704704
```
705705

706706
### Secrets Manager
@@ -782,7 +782,7 @@ You can register your Lambda functions as targets within an Amazon VPC Lattice s
782782
=== "Lattice Example Event"
783783

784784
```json
785-
--8<-- "examples/event_sources/src/vpc_lattice_v2_payload.json"
785+
--8<-- "examples/event_sources/events/vpc_lattice_v2_payload.json"
786786
```
787787

788788
### VPC Lattice V1
@@ -800,7 +800,7 @@ You can register your Lambda functions as targets within an Amazon VPC Lattice s
800800
=== "Lattice Example Event"
801801

802802
```json
803-
--8<-- "examples/event_sources/src/vpc_lattice_payload.json"
803+
--8<-- "examples/event_sources/events/vpc_lattice_payload.json"
804804
```
805805

806806
## Advanced
@@ -820,9 +820,9 @@ However, certain events may contain sensitive fields such as `secret_access_key`
820820

821821
=== "debugging_event.json"
822822
```json hl_lines="28 29"
823-
--8<-- "examples/event_sources/src/debugging_event.json"
823+
--8<-- "examples/event_sources/events/debugging_event.json"
824824
```
825825
=== "debugging_output.json"
826826
```json hl_lines="16 17 18"
827-
--8<-- "examples/event_sources/src/debugging_output.json"
827+
--8<-- "examples/event_sources/events/debugging_output.json"
828828
```

examples/event_sources/events/albEvent.json

Lines changed: 0 additions & 28 deletions
This file was deleted.

examples/event_sources/events/apiGatewayAuthorizerRequestEvent.json

Lines changed: 0 additions & 29 deletions
This file was deleted.

examples/event_sources/events/apiGatewayAuthorizerTokenEvent.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)