Skip to content

Commit 6d1aa80

Browse files
committed
Merge branch 'develop' into feat(event-source)-1656-s3-event-eventbridge-dataclass
* develop: chore(deps-dev): bump mkdocs-material from 9.1.1 to 9.1.2 (aws-powertools#1994) chore(deps-dev): bump mypy-boto3-dynamodb from 1.26.84 to 1.26.87 (aws-powertools#1993) chore(deps): bump pydantic from 1.10.5 to 1.10.6 (aws-powertools#1991) chore(deps-dev): bump aws-cdk-lib from 2.67.0 to 2.68.0 (aws-powertools#1992) chore(deps-dev): bump cfn-lint from 0.74.0 to 0.74.1 (aws-powertools#1988) chore(deps): bump aws-actions/configure-aws-credentials from 1 to 2 (aws-powertools#1987) update changelog with latest changes chore(deps-dev): bump pytest from 7.2.1 to 7.2.2 (aws-powertools#1980) fix(ci): bump CDK version chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions from 2.1.1 to 2.1.2 (aws-powertools#1979) chore(deps-dev): bump types-python-dateutil from 2.8.19.9 to 2.8.19.10 (aws-powertools#1973) chore(deps-dev): bump hvac from 1.0.2 to 1.1.0 (aws-powertools#1983) chore(deps-dev): bump mkdocs-material from 9.1.0 to 9.1.1 (aws-powertools#1984) update changelog with latest changes docs(homepage): revamp install UX & share how we build Lambda Layer (aws-powertools#1978) chore(deps-dev): bump mypy-boto3-dynamodb from 1.26.24 to 1.26.84 (aws-powertools#1981) chore(deps-dev): bump mkdocs-material from 9.0.15 to 9.1.0 (aws-powertools#1976) chore(deps-dev): bump cfn-lint from 0.67.0 to 0.74.0 (aws-powertools#1974)
2 parents af71524 + d70892d commit 6d1aa80

10 files changed

+162
-140
lines changed

Diff for: .github/workflows/reusable_deploy_v2_layer_stack.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
- name: Install poetry
6969
run: pipx install poetry
7070
- name: aws credentials
71-
uses: aws-actions/configure-aws-credentials@67fbcbb121271f7775d2e7715933280b06314838
71+
uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef
7272
with:
7373
aws-region: ${{ matrix.region }}
7474
role-to-assume: ${{ secrets.AWS_LAYERS_ROLE_ARN }}

Diff for: .github/workflows/reusable_deploy_v2_sar.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ jobs:
5050
- name: Checkout
5151
uses: actions/checkout@v3
5252
- name: AWS credentials
53-
uses: aws-actions/configure-aws-credentials@67fbcbb121271f7775d2e7715933280b06314838
53+
uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef
5454
with:
5555
aws-region: ${{ env.AWS_REGION }}
5656
role-to-assume: ${{ secrets.AWS_LAYERS_ROLE_ARN }}
5757
- name: AWS credentials SAR role
58-
uses: aws-actions/configure-aws-credentials@67fbcbb121271f7775d2e7715933280b06314838
58+
uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef
5959
id: aws-credentials-sar-role
6060
with:
6161
aws-access-key-id: ${{ env.AWS_ACCESS_KEY_ID }}

Diff for: .github/workflows/run-e2e-tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
- name: Install dependencies
5353
run: make dev
5454
- name: Configure AWS credentials
55-
uses: aws-actions/configure-aws-credentials@v1
55+
uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef
5656
with:
5757
role-to-assume: ${{ secrets.AWS_TEST_ROLE_ARN }}
5858
aws-region: ${{ env.AWS_DEFAULT_REGION }}

Diff for: .github/workflows/secure_workflows.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Checkout code
1717
uses: actions/checkout@v3
1818
- name: Ensure 3rd party workflows have SHA pinned
19-
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@0168d43369f2c6661245b8b94a8c812e0867af4b # v2.1.1
19+
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@21991cec25093947ff3f62e4c223df0260c39944 # v2.1.2
2020
with:
2121
# Trusted GitHub Actions and/or organizations
2222
allowlist: |

Diff for: CHANGELOG.md

+26-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,29 @@
66

77
## Bug Fixes
88

9+
* **ci:** bump CDK version
10+
11+
## Documentation
12+
13+
* **homepage:** revamp install UX & share how we build Lambda Layer ([#1978](https://github.com/awslabs/aws-lambda-powertools-python/issues/1978))
14+
15+
## Maintenance
16+
17+
* **deps:** bump zgosalvez/github-actions-ensure-sha-pinned-actions from 2.1.1 to 2.1.2 ([#1979](https://github.com/awslabs/aws-lambda-powertools-python/issues/1979))
18+
* **deps-dev:** bump pytest from 7.2.1 to 7.2.2 ([#1980](https://github.com/awslabs/aws-lambda-powertools-python/issues/1980))
19+
* **deps-dev:** bump types-python-dateutil from 2.8.19.9 to 2.8.19.10 ([#1973](https://github.com/awslabs/aws-lambda-powertools-python/issues/1973))
20+
* **deps-dev:** bump hvac from 1.0.2 to 1.1.0 ([#1983](https://github.com/awslabs/aws-lambda-powertools-python/issues/1983))
21+
* **deps-dev:** bump mkdocs-material from 9.1.0 to 9.1.1 ([#1984](https://github.com/awslabs/aws-lambda-powertools-python/issues/1984))
22+
* **deps-dev:** bump mypy-boto3-dynamodb from 1.26.24 to 1.26.84 ([#1981](https://github.com/awslabs/aws-lambda-powertools-python/issues/1981))
23+
* **deps-dev:** bump mkdocs-material from 9.0.15 to 9.1.0 ([#1976](https://github.com/awslabs/aws-lambda-powertools-python/issues/1976))
24+
* **deps-dev:** bump cfn-lint from 0.67.0 to 0.74.0 ([#1974](https://github.com/awslabs/aws-lambda-powertools-python/issues/1974))
25+
* **deps-dev:** bump aws-cdk-lib from 2.66.1 to 2.67.0 ([#1977](https://github.com/awslabs/aws-lambda-powertools-python/issues/1977))
26+
27+
28+
<a name="v2.9.1"></a>
29+
## [v2.9.1] - 2023-03-01
30+
## Bug Fixes
31+
932
* **idempotency:** revert dict mutation that impacted static_pk_value feature ([#1970](https://github.com/awslabs/aws-lambda-powertools-python/issues/1970))
1033

1134
## Documentation
@@ -16,6 +39,7 @@
1639
## Maintenance
1740

1841
* update project description
42+
* update v2 layer ARN on documentation
1943
* **ci:** disable pypi test due to maintenance mode
2044
* **ci:** replace deprecated set-output commands ([#1957](https://github.com/awslabs/aws-lambda-powertools-python/issues/1957))
2145
* **deps:** bump fastjsonschema from 2.16.2 to 2.16.3 ([#1961](https://github.com/awslabs/aws-lambda-powertools-python/issues/1961))
@@ -2926,7 +2950,8 @@
29262950
* Merge pull request [#5](https://github.com/awslabs/aws-lambda-powertools-python/issues/5) from jfuss/feat/python38
29272951

29282952

2929-
[Unreleased]: https://github.com/awslabs/aws-lambda-powertools-python/compare/v2.9.0...HEAD
2953+
[Unreleased]: https://github.com/awslabs/aws-lambda-powertools-python/compare/v2.9.1...HEAD
2954+
[v2.9.1]: https://github.com/awslabs/aws-lambda-powertools-python/compare/v2.9.0...v2.9.1
29302955
[v2.9.0]: https://github.com/awslabs/aws-lambda-powertools-python/compare/v2.8.0...v2.9.0
29312956
[v2.8.0]: https://github.com/awslabs/aws-lambda-powertools-python/compare/v2.7.1...v2.8.0
29322957
[v2.7.1]: https://github.com/awslabs/aws-lambda-powertools-python/compare/v2.7.0...v2.7.1

Diff for: docs/index.md

+35-38
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: AWS Lambda Powertools for Python
55

66
<!-- markdownlint-disable MD043 MD013 -->
77

8-
A suite of utilities for AWS Lambda functions to ease adopting best practices such as tracing, structured logging, custom metrics, idempotency, batching, [**and more**](#features).
8+
Powertools is a developer toolkit to implement Serverless best practices and increase developer velocity.
99

1010
???+ tip
1111
Powertools is also available for [Java](https://awslabs.github.io/aws-lambda-powertools-java/){target="_blank"}, [TypeScript](https://awslabs.github.io/aws-lambda-powertools-typescript/latest/){target="_blank"}, and [.NET](https://awslabs.github.io/aws-lambda-powertools-dotnet/){target="_blank"}
@@ -24,41 +24,52 @@ A suite of utilities for AWS Lambda functions to ease adopting best practices su
2424

2525
## Install
2626

27-
Powertools is available in the following formats:
27+
You can install Powertools using one of the following options:
2828

2929
* **Lambda Layer (x86_64)**: [**arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPythonV2:23**](#){: .copyMe}:clipboard:
3030
* **Lambda Layer (arm64)**: [**arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPythonV2-Arm64:23**](#){: .copyMe}:clipboard:
31-
* **PyPi**: **`pip install "aws-lambda-powertools"`**
31+
* **Pip**: **[`pip install "aws-lambda-powertools"`](#){: .copyMe}:clipboard:**
3232

33-
???+ info "Some utilities require additional dependencies"
34-
You can stop reading if you're using Lambda Layer.
35-
36-
[Tracer](./core/tracer.md){target="_blank"}, [Validation](./utilities/validation.md){target="_blank"} and [Parser](./utilities/parser.md){target="_blank"} require additional dependencies. If you prefer to install all of them, use `pip install "aws-lambda-powertools[all]"`.
33+
??? question "Using Pip? You might need to install additional dependencies."
34+
[**Tracer**](./core/tracer.md){target="_blank"}, [**Validation**](./utilities/validation.md){target="_blank"} and [**Parser**](./utilities/parser.md){target="_blank"} require additional dependencies. If you prefer to install all of them, use [**`pip install "aws-lambda-powertools[all]"`**](#){: .copyMe}:clipboard:.
3735

3836
For example:
3937

40-
* [Tracer](./core/tracer.md#install){target="_blank"}: **`pip install "aws-lambda-powertools[tracer]"`**
41-
* [Validation](./utilities/validation.md#install){target="_blank"}: **`pip install "aws-lambda-powertools[validation]"`**
42-
* [Parser](./utilities/parser.md#install){target="_blank"}: **`pip install "aws-lambda-powertools[parser]"`**
43-
* [Tracer](./core/tracer.md#install){target="_blank"} and [Parser](./utilities/parser.md#install){target="_blank"}: **`pip install "aws-lambda-powertools[tracer,parser]"`**
38+
* **Tracer**: **[`pip install "aws-lambda-powertools[tracer]"`](#){: .copyMe}:clipboard:**
39+
* **Validation**: **[`pip install "aws-lambda-powertools[validation]"`](#){: .copyMe}:clipboard:**
40+
* **Parser**: **[`pip install "aws-lambda-powertools[parser]"`](#){: .copyMe}:clipboard:**
41+
* **Tracer** and **Parser**: **[`pip install "aws-lambda-powertools[tracer,parser]"`](#){: .copyMe}:clipboard:**
4442

4543
### Local development
4644

47-
Powertools relies on the AWS SDK bundled in the Lambda runtime. This helps us achieve an optimal package size and initialization.
45+
!!! info "Using Powertools via Lambda Layer? Simply add [**`"aws-lambda-powertools[all]"`**](#){: .copyMe}:clipboard: as a development dependency."
46+
47+
Powertools relies on the [AWS SDK bundled in the Lambda runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-python.html){target="_blank"}. This helps us achieve an optimal package size and initialization. However, when developing locally, you need to install AWS SDK as a development dependency (not as a production dependency):
48+
49+
* **Pip**: [**`pip install "aws-lambda-powertools[aws-sdk]"`**](#){: .copyMe}:clipboard:
50+
* **Poetry**: [**`poetry add "aws-lambda-powertools[aws-sdk]" --group dev`**](#){: .copyMe}:clipboard:
51+
* **Pipenv**: [**`pipenv install --dev "aws-lambda-powertools[aws-sdk]"`**](#){: .copyMe}:clipboard:
52+
53+
??? question "Why is that necessary?"
54+
Powertools relies on the AWS SDK being available to use in the target runtime (AWS Lambda).
4855

49-
This means you need to add AWS SDK as a development dependency (not as a production dependency).
56+
As a result, it affects your favorite IDE in terms of code auto-completion, or running your tests suite locally with no Lambda emulation such as [AWS SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html){target="_blank"}.
5057

51-
* **Pip**: `pip install "aws-lambda-powertools[aws-sdk]"`
52-
* **Poetry**: `poetry add "aws-lambda-powertools[aws-sdk]" --group dev`
53-
* **Pipenv**: `pipenv install --dev "aws-lambda-powertools[aws-sdk]"`
58+
**A word about dependency resolution**
5459

55-
???+ note "Local emulation"
56-
If you're running your code locally with [AWS SAM CLI](https://github.com/aws/aws-sam-cli){target="_blank"}, and not with your Python/IDE interpreter directly, this is not necessary. SAM CLI already brings the AWS SDK in its emulation image.
60+
In this context, `[aws-sdk]` is an alias to the `boto3` package. Due to dependency resolution, it'll either install:
61+
62+
* **(A)** the SDK version available in [Lambda runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-python.html){target="_blank"}
63+
* **(B)** a more up-to-date version if another package you use also depends on `boto3`, for example [Powertools Tracer](core/tracer.md){target="_blank"}
5764

5865
### Lambda Layer
5966

67+
???+ warning "As of now, Container Image deployment (OCI) or inline Lambda functions do not support Lambda Layers."
68+
6069
[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. Layers promote code sharing and separation of responsibilities so that you can iterate faster on writing business logic.
6170

71+
For our Layers, we compile and optimize [all dependencies](https://github.com/awslabs/aws-lambda-powertools-python/blob/develop/pyproject.toml#L98){target="_blank"}, and [remove duplicate dependencies already available in the Lambda runtime](https://github.com/awslabs/cdk-aws-lambda-powertools-layer/blob/main/layer/Python/Dockerfile#L36){target="_blank"} to achieve the most optimal size.
72+
6273
You can include Powertools Lambda Layer using [AWS Lambda Console](https://docs.aws.amazon.com/lambda/latest/dg/invocation-layers.html#invocation-layers-using){target="_blank"}, or your preferred deployment framework.
6374

6475
??? note "Note: Click to expand and copy any regional Lambda Layer ARN"
@@ -271,16 +282,6 @@ You can include Powertools Lambda Layer using [AWS Lambda Console](https://docs.
271282
? Do you want to edit the local lambda function now? No
272283
```
273284

274-
=== "Get the Layer .zip contents"
275-
276-
Change {region} to your AWS region, e.g. `eu-west-1`
277-
278-
```bash title="AWS CLI"
279-
aws lambda get-layer-version-by-arn --arn arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPythonV2:23 --region {region}
280-
```
281-
282-
The pre-signed URL to download this Lambda Layer will be within `Location` key.
283-
284285
=== "arm64"
285286

286287
=== "SAM"
@@ -439,18 +440,14 @@ You can include Powertools Lambda Layer using [AWS Lambda Console](https://docs.
439440
? Do you want to edit the local lambda function now? No
440441
```
441442

442-
=== "Get the Layer .zip contents"
443-
Change {region} to your AWS region, e.g. `eu-west-1`
443+
??? question "Want to inspect the contents of the Layer?"
444+
Change {region} to your AWS region, e.g. `eu-west-1`
444445

445-
```bash title="AWS CLI"
446-
aws lambda get-layer-version-by-arn --arn arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPythonV2-Arm64:23 --region {region}
447-
```
448-
449-
The pre-signed URL to download this Lambda Layer will be within `Location` key.
450-
451-
???+ warning "Warning: Limitations"
446+
```bash title="AWS CLI"
447+
aws lambda get-layer-version-by-arn --arn arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPythonV2:23 --region {region}
448+
```
452449

453-
Container Image deployment (OCI) or inline Lambda functions do not support Lambda Layers.
450+
The pre-signed URL to download this Lambda Layer will be within `Location` key.
454451

455452
#### SAR
456453

Diff for: package-lock.json

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"name": "aws-lambda-powertools-python-e2e",
33
"version": "1.0.0",
44
"devDependencies": {
5-
"aws-cdk": "^2.65.0"
5+
"aws-cdk": "^2.67.0"
66
}
77
}

0 commit comments

Comments
 (0)