@@ -90,6 +90,7 @@ Log Data Event for Troubleshooting
90
90
| [ CloudWatch Alarm State Change Action] ( #cloudwatch-alarm-state-change-action ) | ` CloudWatchAlarmEvent ` |
91
91
| [ CloudWatch Dashboard Custom Widget] ( #cloudwatch-dashboard-custom-widget ) | ` CloudWatchDashboardCustomWidgetEvent ` |
92
92
| [ CloudWatch Logs] ( #cloudwatch-logs ) | ` CloudWatchLogsEvent ` |
93
+ | [ CodeDeploy Lifecycle Hook] ( #codedeploy-lifecycle-hook ) | ` CodeDeployLifecycleHookEvent ` |
93
94
| [ CodePipeline Job Event] ( #codepipeline-job ) | ` CodePipelineJobEvent ` |
94
95
| [ Cognito User Pool] ( #cognito-user-pool ) | Multiple available under ` cognito_user_pool_event ` |
95
96
| [ Connect Contact Flow] ( #connect-contact-flow ) | ` ConnectContactFlowEvent ` |
@@ -615,6 +616,30 @@ Alternatively, you can use `extract_cloudwatch_logs_from_record` to seamless int
615
616
return processor.response()
616
617
```
617
618
619
+ ### CodeDeploy LifeCycle Hook
620
+
621
+ CodeDeploy triggers Lambdas with this event when defined in
622
+ [ AppSpec definitions] ( https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file-structure-hooks.html )
623
+ to test applications at different stages of deployment.
624
+
625
+
626
+ === "app.py"
627
+ ```python
628
+ from aws_lambda_powertools import Logger
629
+ from aws_lambda_powertools.utilities.data_classes import (
630
+ event_source,
631
+ CodeDeployLifeCycleHookEvent,
632
+ )
633
+
634
+ logger = Logger()
635
+
636
+ def lambda_handler(
637
+ event: CodeDeployLifeCycleHookEvent, context: LambdaContext
638
+ ) -> None:
639
+ deployment_id = event.deployment_id
640
+ lifecycle_event_hook_execution_id = event.lifecycle_event_hook_execution_id
641
+ ```
642
+
618
643
### CodePipeline Job
619
644
620
645
Data classes and utility functions to help create continuous delivery pipelines tasks with AWS Lambda
0 commit comments