Skip to content

Commit 2890897

Browse files
Merge branch 'develop' into fix-idempotency-docs
2 parents 4ec7d81 + 8329bf3 commit 2890897

File tree

12 files changed

+101
-9
lines changed

12 files changed

+101
-9
lines changed

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,30 @@
44
<a name="unreleased"></a>
55
# Unreleased
66

7+
## Documentation
8+
9+
* **v3:** fix small things in the documentation ([#5224](https://github.com/aws-powertools/powertools-lambda-python/issues/5224))
10+
11+
## Maintenance
12+
13+
* **ci:** new pre-release 3.0.1a0 ([#5220](https://github.com/aws-powertools/powertools-lambda-python/issues/5220))
14+
* **deps:** bump actions/checkout from 4.1.6 to 4.1.7 ([#5206](https://github.com/aws-powertools/powertools-lambda-python/issues/5206))
15+
* **deps:** bump actions/setup-node from 4.0.3 to 4.0.4 ([#5186](https://github.com/aws-powertools/powertools-lambda-python/issues/5186))
16+
* **deps:** bump squidfunk/mkdocs-material from `a2e3a31` to `22a429f` in /docs ([#5201](https://github.com/aws-powertools/powertools-lambda-python/issues/5201))
17+
* **deps:** bump actions/download-artifact from 4.1.7 to 4.1.8 ([#5203](https://github.com/aws-powertools/powertools-lambda-python/issues/5203))
18+
* **deps:** bump docker/setup-qemu-action from 3.0.0 to 3.2.0 ([#5205](https://github.com/aws-powertools/powertools-lambda-python/issues/5205))
19+
* **deps:** bump pypa/gh-action-pypi-publish from 1.10.1 to 1.10.2 ([#5202](https://github.com/aws-powertools/powertools-lambda-python/issues/5202))
20+
* **deps:** bump actions/upload-artifact from 4.3.3 to 4.4.0 ([#5217](https://github.com/aws-powertools/powertools-lambda-python/issues/5217))
21+
* **deps:** bump actions/setup-python from 5.1.0 to 5.2.0 ([#5204](https://github.com/aws-powertools/powertools-lambda-python/issues/5204))
22+
* **deps-dev:** bump mkdocs-material from 9.5.34 to 9.5.36 ([#5210](https://github.com/aws-powertools/powertools-lambda-python/issues/5210))
23+
* **deps-dev:** bump cdklabs-generative-ai-cdk-constructs from 0.1.264 to 0.1.268 ([#5216](https://github.com/aws-powertools/powertools-lambda-python/issues/5216))
24+
* **deps-dev:** bump cfn-lint from 1.12.4 to 1.15.0 ([#5215](https://github.com/aws-powertools/powertools-lambda-python/issues/5215))
25+
* **deps-dev:** bump boto3-stubs from 1.35.17 to 1.35.25 ([#5218](https://github.com/aws-powertools/powertools-lambda-python/issues/5218))
26+
* **deps-dev:** bump bandit from 1.7.9 to 1.7.10 ([#5214](https://github.com/aws-powertools/powertools-lambda-python/issues/5214))
27+
* **deps-dev:** bump aws-cdk-lib from 2.158.0 to 2.159.1 ([#5208](https://github.com/aws-powertools/powertools-lambda-python/issues/5208))
28+
* **deps-dev:** bump aws-cdk from 2.157.0 to 2.159.1 ([#5194](https://github.com/aws-powertools/powertools-lambda-python/issues/5194))
29+
* **deps-dev:** bump ruff from 0.6.4 to 0.6.7 ([#5207](https://github.com/aws-powertools/powertools-lambda-python/issues/5207))
30+
731

832
<a name="v3.0.0"></a>
933
## [v3.0.0] - 2024-09-23
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""Exposes version constant to avoid circular dependencies."""
22

3-
VERSION = "3.0.0"
3+
VERSION = "3.0.1a0"

aws_lambda_powertools/utilities/data_classes/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
from .cloud_watch_custom_widget_event import CloudWatchDashboardCustomWidgetEvent
1919
from .cloud_watch_logs_event import CloudWatchLogsEvent
2020
from .cloudformation_custom_resource_event import CloudFormationCustomResourceEvent
21+
from .code_deploy_lifecycle_hook_event import (
22+
CodeDeployLifecycleHookEvent,
23+
)
2124
from .code_pipeline_job_event import CodePipelineJobEvent
2225
from .connect_contact_flow_event import ConnectContactFlowEvent
2326
from .dynamo_db_stream_event import DynamoDBStreamEvent
@@ -59,6 +62,7 @@
5962
"CloudWatchAlarmMetricStat",
6063
"CloudWatchDashboardCustomWidgetEvent",
6164
"CloudWatchLogsEvent",
65+
"CodeDeployLifecycleHookEvent",
6266
"CodePipelineJobEvent",
6367
"ConnectContactFlowEvent",
6468
"DynamoDBStreamEvent",
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from aws_lambda_powertools.utilities.data_classes.common import DictWrapper
2+
3+
4+
class CodeDeployLifecycleHookEvent(DictWrapper):
5+
@property
6+
def deployment_id(self) -> str:
7+
"""The unique ID of the calling CodeDeploy Deployment."""
8+
return self["DeploymentId"]
9+
10+
@property
11+
def lifecycle_event_hook_execution_id(self) -> str:
12+
"""The unique ID of a deployments lifecycle hook."""
13+
return self["LifecycleEventHookExecutionId"]

docs/index.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,14 @@ You can install Powertools for AWS Lambda (Python) using your favorite dependenc
6565

6666
[Lambda Layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html){target="_blank"} is a .zip file archive that can contain additional code, pre-packaged dependencies, data, or configuration files. We compile and optimize [all dependencies](#install), and remove duplicate dependencies [already available in the Lambda runtime](https://github.com/aws-powertools/powertools-lambda-layer-cdk/blob/d24716744f7d1f37617b4998c992c4c067e19e64/layer/Python/Dockerfile#L36){target="_blank"} to achieve the most optimal size.
6767

68-
For the latter, make sure to replace `{region}` with your AWS region, e.g., `eu-west-1`, and the `{python_version}` without the period (.), e.g., `312` for `Python 3.12`.
68+
For the latter, make sure to replace `{region}` with your AWS region, e.g., `eu-west-1`, and the `{python_version}` without the period (.), e.g., `python312` for `Python 3.12`.
6969

70-
* <u>x86 architecture</u>: __arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPythonV3-python{python_version}-x86:1__{: .copyMe}:clipboard:
71-
* <u>ARM architecture</u>: __arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPythonV3-python{python_version}-arm64:1__{: .copyMe}:clipboard:
70+
| Architecture | Layer ARN |
71+
| ------------ | --------------------------------------------------------------------------------------------------------- |
72+
| x86 | __arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPythonV3-{python_version}-x86:1__{: .copyMe}:clipboard: |
73+
| ARM | __arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPythonV3-{python_version}-arm64:1__{: .copyMe}:clipboard: |
74+
75+
=== "AWS Console"
7276

7377
You can add our layer using the [AWS Lambda Console _(direct link)_](https://console.aws.amazon.com/lambda/home#/add/layer){target="_blank"}:
7478

docs/overrides/main.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
{% extends "base.html" %}
22

3-
{% block announce %}
4-
🚨 The next major version (v3) is coming - <a href="https://github.com/aws-powertools/powertools-lambda-python/issues/4189">come learn and discuss upcoming changes</a>!
5-
{% endblock %}
6-
73
{% block outdated %}
84
You're not viewing the latest version.
95
<a href="{{ '../' ~ base_url }}">

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

docs/versioning.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ To see the list of available major versions of Powertools for AWS Lambda and whe
6969

7070
| SDK | Major version | Current Phase | General Availability Date | Notes |
7171
| -------------------------------- | ------------- | -------------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
72+
| Powertools for AWS Lambda (Python) | 3.x | General Availability | 23/09/2024 | See [Release notes](https://github.com/aws-powertools/powertools-lambda-python/releases/tag/v3.0.0) |
7273
| Powertools for AWS Lambda (Python) | 3.x | Developer Preview | | See [RFC](https://github.com/aws-powertools/powertools-lambda-python/issues/4189) |
7374
| Powertools for AWS Lambda (Python) | 2.x | General Availability | 10/24/2022 | See [Release Notes](https://github.com/aws-powertools/powertools-lambda-python/releases/tag/v2.0.0) |
7475
| Powertools for AWS Lambda (Python) | 1.x | End of Support | 06/18/2020 | See [RFC](https://github.com/aws-powertools/powertools-lambda-python/issues/1459) and [upgrade guide](https://docs.powertools.aws.dev/lambda/python/latest/upgrade/) |

0 commit comments

Comments
 (0)