Skip to content

Commit 373aeb7

Browse files
committed
Add docs
1 parent 573af29 commit 373aeb7

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

docs/utilities/data_classes.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ Log Data Event for Troubleshooting
9090
| [CloudWatch Alarm State Change Action](#cloudwatch-alarm-state-change-action) | `CloudWatchAlarmEvent` |
9191
| [CloudWatch Dashboard Custom Widget](#cloudwatch-dashboard-custom-widget) | `CloudWatchDashboardCustomWidgetEvent` |
9292
| [CloudWatch Logs](#cloudwatch-logs) | `CloudWatchLogsEvent` |
93+
| [CodeDeploy Lifecycle Hook](#codedeploy-lifecycle-hook) | `CodeDeployLifecycleHookEvent` |
9394
| [CodePipeline Job Event](#codepipeline-job) | `CodePipelineJobEvent` |
9495
| [Cognito User Pool](#cognito-user-pool) | Multiple available under `cognito_user_pool_event` |
9596
| [Connect Contact Flow](#connect-contact-flow) | `ConnectContactFlowEvent` |
@@ -615,6 +616,30 @@ Alternatively, you can use `extract_cloudwatch_logs_from_record` to seamless int
615616
return processor.response()
616617
```
617618

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+
618643
### CodePipeline Job
619644

620645
Data classes and utility functions to help create continuous delivery pipelines tasks with AWS Lambda

0 commit comments

Comments
 (0)