Skip to content

Commit 7be0d90

Browse files
Merge branch 'develop' into mkdocstrings/typing
2 parents 8efa0e0 + 9bb2216 commit 7be0d90

26 files changed

+178
-36
lines changed

.github/workflows/bootstrap_region.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
steps:
4646
- id: credentials
4747
name: AWS Credentials
48-
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
48+
uses: aws-actions/configure-aws-credentials@4fc4975a852c8cd99761e2de1f4ba73402e44dd9 # v4.0.3
4949
with:
5050
aws-region: ${{ inputs.region }}
5151
role-to-assume: ${{ secrets.REGION_IAM_ROLE }}
@@ -91,14 +91,14 @@ jobs:
9191
steps:
9292
- id: credentials
9393
name: AWS Credentials
94-
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
94+
uses: aws-actions/configure-aws-credentials@4fc4975a852c8cd99761e2de1f4ba73402e44dd9 # v4.0.3
9595
with:
9696
aws-region: us-east-1
9797
role-to-assume: ${{ secrets.REGION_IAM_ROLE }}
9898
mask-aws-account-id: true
9999
- id: go-setup
100100
name: Setup Go
101-
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
101+
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
102102
- id: go-env
103103
name: Go Env
104104
run: go env

.github/workflows/dispatch_analytics.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
statuses: read
4444
steps:
4545
- name: Configure AWS credentials
46-
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
46+
uses: aws-actions/configure-aws-credentials@4fc4975a852c8cd99761e2de1f4ba73402e44dd9 # v4.0.3
4747
with:
4848
aws-region: eu-central-1
4949
role-to-assume: ${{ secrets.AWS_LAYERS_ROLE_ARN }}

.github/workflows/layer_govcloud.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
environment: Prod (Readonly)
6060
steps:
6161
- name: Configure AWS Credentials
62-
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
62+
uses: aws-actions/configure-aws-credentials@4fc4975a852c8cd99761e2de1f4ba73402e44dd9 # v4.0.3
6363
with:
6464
role-to-assume: ${{ secrets.AWS_IAM_ROLE }}
6565
aws-region: us-east-1
@@ -116,7 +116,7 @@ jobs:
116116
SHA=$(jq -r '.Content.CodeSha256' '${{ matrix.layer }}_${{ matrix.arch }}.json')
117117
test "$(openssl dgst -sha256 -binary ${{ matrix.layer }}_${{ matrix.arch }}.zip | openssl enc -base64)" == "$SHA" && echo "SHA OK: ${SHA}" || exit 1
118118
- name: Configure AWS Credentials
119-
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
119+
uses: aws-actions/configure-aws-credentials@4fc4975a852c8cd99761e2de1f4ba73402e44dd9 # v4.0.3
120120
with:
121121
role-to-assume: ${{ secrets.AWS_IAM_ROLE }}
122122
aws-region: us-gov-east-1
@@ -185,7 +185,7 @@ jobs:
185185
SHA=$(jq -r '.Content.CodeSha256' '${{ matrix.layer }}_${{ matrix.arch }}.json')
186186
test "$(openssl dgst -sha256 -binary ${{ matrix.layer }}_${{ matrix.arch }}.zip | openssl enc -base64)" == "$SHA" && echo "SHA OK: ${SHA}" || exit 1
187187
- name: Configure AWS Credentials
188-
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
188+
uses: aws-actions/configure-aws-credentials@4fc4975a852c8cd99761e2de1f4ba73402e44dd9 # v4.0.3
189189
with:
190190
role-to-assume: ${{ secrets.AWS_IAM_ROLE }}
191191
aws-region: us-gov-west-1

.github/workflows/layer_govcloud_python313.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
environment: Prod (Readonly)
5656
steps:
5757
- name: Configure AWS Credentials
58-
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
58+
uses: aws-actions/configure-aws-credentials@4fc4975a852c8cd99761e2de1f4ba73402e44dd9 # v4.0.3
5959
with:
6060
role-to-assume: ${{ secrets.AWS_IAM_ROLE }}
6161
aws-region: us-east-1
@@ -108,7 +108,7 @@ jobs:
108108
SHA=$(jq -r '.Content.CodeSha256' '${{ matrix.layer }}_${{ matrix.arch }}.json')
109109
test "$(openssl dgst -sha256 -binary ${{ matrix.layer }}_${{ matrix.arch }}.zip | openssl enc -base64)" == "$SHA" && echo "SHA OK: ${SHA}" || exit 1
110110
- name: Configure AWS Credentials
111-
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
111+
uses: aws-actions/configure-aws-credentials@4fc4975a852c8cd99761e2de1f4ba73402e44dd9 # v4.0.3
112112
with:
113113
role-to-assume: ${{ secrets.AWS_IAM_ROLE }}
114114
aws-region: us-gov-east-1
@@ -173,7 +173,7 @@ jobs:
173173
SHA=$(jq -r '.Content.CodeSha256' '${{ matrix.layer }}_${{ matrix.arch }}.json')
174174
test "$(openssl dgst -sha256 -binary ${{ matrix.layer }}_${{ matrix.arch }}.zip | openssl enc -base64)" == "$SHA" && echo "SHA OK: ${SHA}" || exit 1
175175
- name: Configure AWS Credentials
176-
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
176+
uses: aws-actions/configure-aws-credentials@4fc4975a852c8cd99761e2de1f4ba73402e44dd9 # v4.0.3
177177
with:
178178
role-to-assume: ${{ secrets.AWS_IAM_ROLE }}
179179
aws-region: us-gov-west-1

.github/workflows/layer_govcloud_verify.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
environment: Prod (Readonly)
4040
steps:
4141
- name: Configure AWS Credentials
42-
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
42+
uses: aws-actions/configure-aws-credentials@4fc4975a852c8cd99761e2de1f4ba73402e44dd9 # v4.0.3
4343
with:
4444
role-to-assume: ${{ secrets.AWS_IAM_ROLE }}
4545
aws-region: us-east-1
@@ -69,7 +69,7 @@ jobs:
6969
environment: GovCloud Prod (East)
7070
steps:
7171
- name: Configure AWS Credentials
72-
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
72+
uses: aws-actions/configure-aws-credentials@4fc4975a852c8cd99761e2de1f4ba73402e44dd9 # v4.0.3
7373
with:
7474
role-to-assume: ${{ secrets.AWS_IAM_ROLE }}
7575
aws-region: us-gov-east-1
@@ -100,7 +100,7 @@ jobs:
100100
environment: GovCloud Prod (West)
101101
steps:
102102
- name: Configure AWS Credentials
103-
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
103+
uses: aws-actions/configure-aws-credentials@4fc4975a852c8cd99761e2de1f4ba73402e44dd9 # v4.0.3
104104
with:
105105
role-to-assume: ${{ secrets.AWS_IAM_ROLE }}
106106
aws-region: us-gov-east-1

.github/workflows/layer_rename.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
environment: layer-prod
5757
steps:
5858
- name: Configure AWS Credentials
59-
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
59+
uses: aws-actions/configure-aws-credentials@4fc4975a852c8cd99761e2de1f4ba73402e44dd9 # v4.0.3
6060
with:
6161
role-to-assume: ${{ secrets.AWS_LAYERS_ROLE_ARN }}
6262
aws-region: us-east-1
@@ -140,7 +140,7 @@ jobs:
140140
SHA=$(jq -r '.Content.CodeSha256' ${{ matrix.layer }}_x86_64.json)
141141
test $(openssl dgst -sha256 -binary ${{ matrix.layer }}_x86_64.zip | openssl enc -base64) == $SHA && echo "SHA OK: ${SHA}" || exit 1
142142
- name: Configure AWS Credentials
143-
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
143+
uses: aws-actions/configure-aws-credentials@4fc4975a852c8cd99761e2de1f4ba73402e44dd9 # v4.0.3
144144
with:
145145
role-to-assume: ${{ secrets.AWS_LAYERS_ROLE_ARN }}
146146
aws-region: ${{ matrix.region }}

.github/workflows/pre-release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ jobs:
232232

233233
- name: Upload to PyPi prod
234234
if: ${{ !inputs.skip_pypi }}
235-
uses: pypa/gh-action-pypi-publish@67339c736fd9354cd4f8cb0b744f2b82a74b5c70 # v1.12.3
235+
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
236236

237237
# Creates a PR with the latest version we've just released
238238
# since our trunk is protected against any direct pushes from automation

.github/workflows/release-drafter.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ jobs:
2727
permissions:
2828
contents: write # create release in draft mode
2929
steps:
30-
- uses: release-drafter/release-drafter@3f0f87098bd6b5c5b9a36d49c41d998ea58f9348 # v5.20.1
30+
- uses: release-drafter/release-drafter@b1476f6e6eb133afa41ed8589daba6dc69b4d3f5 # v5.20.1
3131
env:
3232
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release-v3.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,12 @@ jobs:
237237

238238
- name: Upload to PyPi prod
239239
if: ${{ !inputs.skip_pypi }}
240-
uses: pypa/gh-action-pypi-publish@67339c736fd9354cd4f8cb0b744f2b82a74b5c70 # v1.12.3
240+
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
241241

242242
# PyPi test maintenance affected us numerous times, leaving for history purposes
243243
# - name: Upload to PyPi test
244244
# if: ${{ !inputs.skip_pypi }}
245-
# uses: pypa/gh-action-pypi-publish@67339c736fd9354cd4f8cb0b744f2b82a74b5c70 # v1.12.3
245+
# uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
246246
# with:
247247
# repository-url: https://test.pypi.org/legacy/
248248

.github/workflows/release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,12 @@ jobs:
237237

238238
- name: Upload to PyPi prod
239239
if: ${{ !inputs.skip_pypi }}
240-
uses: pypa/gh-action-pypi-publish@67339c736fd9354cd4f8cb0b744f2b82a74b5c70 # v1.12.3
240+
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
241241

242242
# PyPi test maintenance affected us numerous times, leaving for history purposes
243243
# - name: Upload to PyPi test
244244
# if: ${{ !inputs.skip_pypi }}
245-
# uses: pypa/gh-action-pypi-publish@67339c736fd9354cd4f8cb0b744f2b82a74b5c70 # v1.12.3
245+
# uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
246246
# with:
247247
# repository-url: https://test.pypi.org/legacy/
248248

.github/workflows/reusable_deploy_v2_layer_stack.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ jobs:
153153
- name: Install poetry
154154
run: pipx install git+https://github.com/python-poetry/poetry@bd500dd3bdfaec3de6894144c9cedb3a9358be84 # v2.0.1
155155
- name: Configure AWS Credentials
156-
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
156+
uses: aws-actions/configure-aws-credentials@4fc4975a852c8cd99761e2de1f4ba73402e44dd9 # v4.0.3
157157
with:
158158
aws-region: ${{ matrix.region }}
159159
role-to-assume: ${{ secrets.AWS_LAYERS_ROLE_ARN }}

.github/workflows/reusable_deploy_v2_sar.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090
artifact_name: ${{ inputs.source_code_artifact_name }}
9191

9292
- name: Configure AWS credentials
93-
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
93+
uses: aws-actions/configure-aws-credentials@4fc4975a852c8cd99761e2de1f4ba73402e44dd9 # v4.0.3
9494
with:
9595
aws-region: ${{ env.AWS_REGION }}
9696
role-to-assume: ${{ secrets.AWS_LAYERS_ROLE_ARN }}
@@ -101,7 +101,7 @@ jobs:
101101
# we then jump to our specific SAR Account with the correctly scoped IAM Role
102102
# this allows us to have a single trail when a release occurs for a given layer (beta+prod+SAR beta+SAR prod)
103103
- name: AWS credentials SAR role
104-
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
104+
uses: aws-actions/configure-aws-credentials@4fc4975a852c8cd99761e2de1f4ba73402e44dd9 # v4.0.3
105105
id: aws-credentials-sar-role
106106
with:
107107
aws-access-key-id: ${{ env.AWS_ACCESS_KEY_ID }}

.github/workflows/reusable_deploy_v3_layer_stack.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ jobs:
157157
pipx install git+https://github.com/python-poetry/poetry@bd500dd3bdfaec3de6894144c9cedb3a9358be84 # v2.0.1
158158
pipx inject poetry git+https://github.com/python-poetry/poetry-plugin-export@8c83d26603ca94f2e203bfded7b6d7f530960e06 # v1.8.0
159159
- name: Configure AWS credentials
160-
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
160+
uses: aws-actions/configure-aws-credentials@4fc4975a852c8cd99761e2de1f4ba73402e44dd9 # v4.0.3
161161
with:
162162
aws-region: ${{ matrix.region }}
163163
role-to-assume: ${{ secrets.AWS_LAYERS_ROLE_ARN }}

.github/workflows/reusable_deploy_v3_sar.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ jobs:
8787

8888

8989
- name: Configure AWS credentials
90-
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
90+
uses: aws-actions/configure-aws-credentials@4fc4975a852c8cd99761e2de1f4ba73402e44dd9 # v4.0.3
9191
with:
9292
aws-region: ${{ env.AWS_REGION }}
9393
role-to-assume: ${{ secrets.AWS_LAYERS_ROLE_ARN }}
@@ -98,7 +98,7 @@ jobs:
9898
# we then jump to our specific SAR Account with the correctly scoped IAM Role
9999
# this allows us to have a single trail when a release occurs for a given layer (beta+prod+SAR beta+SAR prod)
100100
- name: AWS credentials SAR role
101-
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
101+
uses: aws-actions/configure-aws-credentials@4fc4975a852c8cd99761e2de1f4ba73402e44dd9 # v4.0.3
102102
id: aws-credentials-sar-role
103103
with:
104104
aws-access-key-id: ${{ env.AWS_ACCESS_KEY_ID }}

.github/workflows/reusable_publish_docs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979
poetry run mike set-default --push latest
8080
8181
- name: Configure AWS credentials
82-
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
82+
uses: aws-actions/configure-aws-credentials@4fc4975a852c8cd99761e2de1f4ba73402e44dd9 # v4.0.3
8383
with:
8484
aws-region: us-east-1
8585
role-to-assume: ${{ secrets.AWS_DOCS_ROLE_ARN }}

.github/workflows/run-e2e-tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
- name: Install dependencies
7373
run: make dev-quality-code
7474
- name: Configure AWS credentials
75-
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
75+
uses: aws-actions/configure-aws-credentials@4fc4975a852c8cd99761e2de1f4ba73402e44dd9 # v4.0.3
7676
with:
7777
role-to-assume: ${{ secrets.AWS_TEST_ROLE_ARN }}
7878
aws-region: ${{ env.AWS_DEFAULT_REGION }}

.github/workflows/secure_workflows.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Checkout code
3333
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3434
- name: Ensure 3rd party workflows have SHA pinned
35-
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@64418826697dcd77c93a8e4a1f7601a1942e57b5 # v3.0.18
35+
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@c3a2b64f69b7a1542a68f44d9edbd9ec3fc1455e # v3.0.20
3636
with:
3737
allowlist: |
3838
slsa-framework/slsa-github-generator

.github/workflows/update_ssm.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
run: |
6767
echo 'CONVERTED_REGION=${{ matrix.region }}' | tr 'a-z\-' 'A-Z_' >> "$GITHUB_OUTPUT"
6868
- id: creds
69-
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
69+
uses: aws-actions/configure-aws-credentials@4fc4975a852c8cd99761e2de1f4ba73402e44dd9 # v4.0.3
7070
with:
7171
aws-region: ${{ matrix.region }}
7272
role-to-assume: ${{ secrets[format('{0}', steps.transform.outputs.CONVERTED_REGION)] }}

CHANGELOG.md

+17-2
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,30 @@
1111

1212
## Documentation
1313

14+
* **api:** migrating the validation utility to mkdocstrings ([#5972](https://github.com/aws-powertools/powertools-lambda-python/issues/5972))
1415
* **layer:** update layer version number - v3.5.0 ([#5952](https://github.com/aws-powertools/powertools-lambda-python/issues/5952))
1516

17+
## Features
18+
19+
* **logger:** add clear_state method ([#5956](https://github.com/aws-powertools/powertools-lambda-python/issues/5956))
20+
1621
## Maintenance
1722

1823
* **ci:** new pre-release 3.5.1a0 ([#5945](https://github.com/aws-powertools/powertools-lambda-python/issues/5945))
19-
* **ci:** install & configure mkdocstrings plugin ([#5959](https://github.com/aws-powertools/powertools-lambda-python/issues/5959))
2024
* **ci:** new pre-release 3.5.1a1 ([#5954](https://github.com/aws-powertools/powertools-lambda-python/issues/5954))
21-
* **deps:** bump actions/setup-python from 5.3.0 to 5.4.0 ([#5960](https://github.com/aws-powertools/powertools-lambda-python/issues/5960))
25+
* **ci:** new pre-release 3.5.1a2 ([#5970](https://github.com/aws-powertools/powertools-lambda-python/issues/5970))
26+
* **ci:** install & configure mkdocstrings plugin ([#5959](https://github.com/aws-powertools/powertools-lambda-python/issues/5959))
27+
* **deps:** bump actions/setup-node from 4.1.0 to 4.2.0 ([#5963](https://github.com/aws-powertools/powertools-lambda-python/issues/5963))
28+
* **deps:** bump actions/upload-artifact from 4.5.0 to 4.6.0 ([#5962](https://github.com/aws-powertools/powertools-lambda-python/issues/5962))
29+
* **deps:** bump codecov/codecov-action from 5.1.2 to 5.3.1 ([#5964](https://github.com/aws-powertools/powertools-lambda-python/issues/5964))
2230
* **deps:** bump docker/setup-qemu-action from 3.2.0 to 3.3.0 ([#5961](https://github.com/aws-powertools/powertools-lambda-python/issues/5961))
31+
* **deps:** bump actions/setup-python from 5.3.0 to 5.4.0 ([#5960](https://github.com/aws-powertools/powertools-lambda-python/issues/5960))
32+
* **deps:** bump aws-actions/configure-aws-credentials from 4.0.2 to 4.0.3 ([#5975](https://github.com/aws-powertools/powertools-lambda-python/issues/5975))
33+
* **deps-dev:** bump isort from 5.13.2 to 6.0.0 ([#5965](https://github.com/aws-powertools/powertools-lambda-python/issues/5965))
34+
* **deps-dev:** bump cfn-lint from 1.22.7 to 1.23.1 ([#5967](https://github.com/aws-powertools/powertools-lambda-python/issues/5967))
35+
* **deps-dev:** bump ruff from 0.9.3 to 0.9.4 ([#5969](https://github.com/aws-powertools/powertools-lambda-python/issues/5969))
36+
* **deps-dev:** bump black from 24.10.0 to 25.1.0 ([#5968](https://github.com/aws-powertools/powertools-lambda-python/issues/5968))
37+
* **deps-dev:** bump mkdocs-material from 9.5.50 to 9.6.1 ([#5966](https://github.com/aws-powertools/powertools-lambda-python/issues/5966))
2338

2439

2540
<a name="v3.5.0"></a>

aws_lambda_powertools/logging/logger.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ def __init__(
222222
choice=sampling_rate,
223223
env=os.getenv(constants.LOGGER_LOG_SAMPLING_RATE),
224224
)
225+
self._default_log_keys: dict[str, Any] = {"service": self.service, "sampling_rate": self.sampling_rate}
225226
self.child = child
226227
self.logger_formatter = logger_formatter
227228
self._stream = stream or sys.stdout
@@ -231,7 +232,6 @@ def __init__(
231232
self._is_deduplication_disabled = resolve_truthy_env_var_choice(
232233
env=os.getenv(constants.LOGGER_LOG_DEDUPLICATION_ENV, "false"),
233234
)
234-
self._default_log_keys = {"service": self.service, "sampling_rate": self.sampling_rate}
235235
self._logger = self._get_logger()
236236

237237
# NOTE: This is primarily to improve UX, so IDEs can autocomplete LambdaPowertoolsFormatter options
@@ -605,6 +605,14 @@ def append_context_keys(self, **additional_keys: Any) -> Generator[None, None, N
605605
with self.registered_formatter.append_context_keys(**additional_keys):
606606
yield
607607

608+
def clear_state(self) -> None:
609+
"""Removes all custom keys that were appended to the Logger."""
610+
# Clear all custom keys from the formatter
611+
self.registered_formatter.clear_state()
612+
613+
# Reset to default keys
614+
self.structure_logs(**self._default_log_keys)
615+
608616
# These specific thread-safe methods are necessary to manage shared context in concurrent environments.
609617
# They prevent race conditions and ensure data consistency across multiple threads.
610618
def thread_safe_append_keys(self, **additional_keys: object) -> None:

docs/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# v9.1.18
2-
FROM squidfunk/mkdocs-material@sha256:41942f7a2f5163aacd0e866e076d95db4f26550b97d76c1594c04250cbb580e9
2+
FROM squidfunk/mkdocs-material@sha256:471695f3e611d9858788ac04e4daa9af961ccab73f1c0f545e90f8cc5d4268b8
33
# pip-compile --generate-hashes --output-file=requirements.txt requirements.in
44
COPY requirements.txt /tmp/
55
RUN pip install --require-hashes -r /tmp/requirements.txt

0 commit comments

Comments
 (0)