Skip to content

Commit edb858b

Browse files
author
Michael Brewer
authored
Merge branch 'develop' into docs/1064
2 parents 2055d66 + 09f98f8 commit edb858b

File tree

6 files changed

+64
-25
lines changed

6 files changed

+64
-25
lines changed

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@ All notable changes to this project will be documented in this file.
44

55
This project follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format for changes and adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## 1.25.5 - 2022-03-18
8+
9+
### Bug Fixes
10+
11+
* **logger-utils:** regression on exclude set leading to no formatter on append_keys ([#1080](https://github.com/awslabs/aws-lambda-powertools-python/issues/1080))
12+
13+
## 1.25.4 - 2022-03-17
14+
15+
### Bug Fixes
16+
17+
* **logger-utils**: ensure external loggers doesn't propagate logs when copying config
18+
19+
### Documentation
20+
21+
* **appsync:** fix typo on `listLocations` return
22+
* **contributing:** pause new features/enhancements over operational excellence focus
23+
724
## 1.25.3 - 2022-03-09
825

926
### Bug Fixes

aws_lambda_powertools/logging/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def copy_config_to_registered_loggers(
4141
source_logger_name = source_logger.name.split(".")[0]
4242

4343
if exclude:
44-
exclude.update(source_logger_name, PACKAGE_LOGGER)
44+
exclude.update([source_logger_name, PACKAGE_LOGGER])
4545
else:
4646
exclude = {source_logger_name, PACKAGE_LOGGER}
4747

docs/core/event_handler/appsync.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ You can nest `app.resolver()` decorator multiple times when resolving fields wit
183183
}
184184

185185
type Query {
186-
listLocations: [Todo]
186+
listLocations: [Location]
187187
}
188188

189189
type Location {

docs/index.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Core utilities such as Tracing, Logging, Metrics, and Event Handler will be avai
2424

2525
Powertools is available in the following formats:
2626

27-
* **Lambda Layer**: [**arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPython:13 :clipboard:**](#){: .copyMe}
27+
* **Lambda Layer**: [**arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPython:15 :clipboard:**](#){: .copyMe}
2828
* **PyPi**: **`pip install aws-lambda-powertools`**
2929

3030
### Lambda Layer
@@ -37,23 +37,23 @@ You can include Lambda Powertools Lambda Layer using [AWS Lambda Console](https:
3737

3838
| Region | Layer ARN
3939
|--------------------------- | ---------------------------
40-
| `us-east-1` | [arn:aws:lambda:us-east-1:017000801446:layer:AWSLambdaPowertoolsPython:13 :clipboard:](#){: .copyMe}
41-
| `us-east-2` | [arn:aws:lambda:us-east-2:017000801446:layer:AWSLambdaPowertoolsPython:13 :clipboard:](#){: .copyMe}
42-
| `us-west-1` | [arn:aws:lambda:us-west-1:017000801446:layer:AWSLambdaPowertoolsPython:13 :clipboard:](#){: .copyMe}
43-
| `us-west-2` | [arn:aws:lambda:us-west-2:017000801446:layer:AWSLambdaPowertoolsPython:13 :clipboard:](#){: .copyMe}
44-
| `ap-south-1` | [arn:aws:lambda:ap-south-1:017000801446:layer:AWSLambdaPowertoolsPython:13 :clipboard:](#){: .copyMe}
45-
| `ap-northeast-1` | [arn:aws:lambda:ap-northeast-1:017000801446:layer:AWSLambdaPowertoolsPython:13 :clipboard:](#){: .copyMe}
46-
| `ap-northeast-2` | [arn:aws:lambda:ap-northeast-2:017000801446:layer:AWSLambdaPowertoolsPython:13 :clipboard:](#){: .copyMe}
47-
| `ap-northeast-3` | [arn:aws:lambda:ap-northeast-3:017000801446:layer:AWSLambdaPowertoolsPython:13 :clipboard:](#){: .copyMe}
48-
| `ap-southeast-1` | [arn:aws:lambda:ap-southeast-1:017000801446:layer:AWSLambdaPowertoolsPython:13 :clipboard:](#){: .copyMe}
49-
| `ap-southeast-2` | [arn:aws:lambda:ap-southeast-2:017000801446:layer:AWSLambdaPowertoolsPython:13 :clipboard:](#){: .copyMe}
50-
| `eu-central-1` | [arn:aws:lambda:eu-central-1:017000801446:layer:AWSLambdaPowertoolsPython:13 :clipboard:](#){: .copyMe}
51-
| `eu-west-1` | [arn:aws:lambda:eu-west-1:017000801446:layer:AWSLambdaPowertoolsPython:13 :clipboard:](#){: .copyMe}
52-
| `eu-west-2` | [arn:aws:lambda:eu-west-2:017000801446:layer:AWSLambdaPowertoolsPython:13 :clipboard:](#){: .copyMe}
53-
| `eu-west-3` | [arn:aws:lambda:eu-west-3:017000801446:layer:AWSLambdaPowertoolsPython:13 :clipboard:](#){: .copyMe}
54-
| `eu-north-1` | [arn:aws:lambda:eu-north-1:017000801446:layer:AWSLambdaPowertoolsPython:13 :clipboard:](#){: .copyMe}
55-
| `ca-central-1` | [arn:aws:lambda:ca-central-1:017000801446:layer:AWSLambdaPowertoolsPython:13 :clipboard:](#){: .copyMe}
56-
| `sa-east-1` | [arn:aws:lambda:sa-east-1:017000801446:layer:AWSLambdaPowertoolsPython:13 :clipboard:](#){: .copyMe}
40+
| `us-east-1` | [arn:aws:lambda:us-east-1:017000801446:layer:AWSLambdaPowertoolsPython:15 :clipboard:](#){: .copyMe}
41+
| `us-east-2` | [arn:aws:lambda:us-east-2:017000801446:layer:AWSLambdaPowertoolsPython:15 :clipboard:](#){: .copyMe}
42+
| `us-west-1` | [arn:aws:lambda:us-west-1:017000801446:layer:AWSLambdaPowertoolsPython:15 :clipboard:](#){: .copyMe}
43+
| `us-west-2` | [arn:aws:lambda:us-west-2:017000801446:layer:AWSLambdaPowertoolsPython:15 :clipboard:](#){: .copyMe}
44+
| `ap-south-1` | [arn:aws:lambda:ap-south-1:017000801446:layer:AWSLambdaPowertoolsPython:15 :clipboard:](#){: .copyMe}
45+
| `ap-northeast-1` | [arn:aws:lambda:ap-northeast-1:017000801446:layer:AWSLambdaPowertoolsPython:15 :clipboard:](#){: .copyMe}
46+
| `ap-northeast-2` | [arn:aws:lambda:ap-northeast-2:017000801446:layer:AWSLambdaPowertoolsPython:15 :clipboard:](#){: .copyMe}
47+
| `ap-northeast-3` | [arn:aws:lambda:ap-northeast-3:017000801446:layer:AWSLambdaPowertoolsPython:15 :clipboard:](#){: .copyMe}
48+
| `ap-southeast-1` | [arn:aws:lambda:ap-southeast-1:017000801446:layer:AWSLambdaPowertoolsPython:15 :clipboard:](#){: .copyMe}
49+
| `ap-southeast-2` | [arn:aws:lambda:ap-southeast-2:017000801446:layer:AWSLambdaPowertoolsPython:15 :clipboard:](#){: .copyMe}
50+
| `eu-central-1` | [arn:aws:lambda:eu-central-1:017000801446:layer:AWSLambdaPowertoolsPython:15 :clipboard:](#){: .copyMe}
51+
| `eu-west-1` | [arn:aws:lambda:eu-west-1:017000801446:layer:AWSLambdaPowertoolsPython:15 :clipboard:](#){: .copyMe}
52+
| `eu-west-2` | [arn:aws:lambda:eu-west-2:017000801446:layer:AWSLambdaPowertoolsPython:15 :clipboard:](#){: .copyMe}
53+
| `eu-west-3` | [arn:aws:lambda:eu-west-3:017000801446:layer:AWSLambdaPowertoolsPython:15 :clipboard:](#){: .copyMe}
54+
| `eu-north-1` | [arn:aws:lambda:eu-north-1:017000801446:layer:AWSLambdaPowertoolsPython:15 :clipboard:](#){: .copyMe}
55+
| `ca-central-1` | [arn:aws:lambda:ca-central-1:017000801446:layer:AWSLambdaPowertoolsPython:15 :clipboard:](#){: .copyMe}
56+
| `sa-east-1` | [arn:aws:lambda:sa-east-1:017000801446:layer:AWSLambdaPowertoolsPython:15 :clipboard:](#){: .copyMe}
5757

5858
=== "SAM"
5959

@@ -68,7 +68,7 @@ You can include Lambda Powertools Lambda Layer using [AWS Lambda Console](https:
6868
hello:
6969
handler: lambda_function.lambda_handler
7070
layers:
71-
- arn:aws:lambda:${aws:region}:017000801446:layer:AWSLambdaPowertoolsPython:13
71+
- arn:aws:lambda:${aws:region}:017000801446:layer:AWSLambdaPowertoolsPython:15
7272
```
7373

7474
=== "CDK"
@@ -94,7 +94,7 @@ You can include Lambda Powertools Lambda Layer using [AWS Lambda Console](https:
9494
? Do you want to configure advanced settings? Yes
9595
...
9696
? Do you want to enable Lambda layers for this function? Yes
97-
? Enter up to 5 existing Lambda layer ARNs (comma-separated): arn:aws:lambda:eu-central-1:017000801446:layer:AWSLambdaPowertoolsPython:13
97+
? Enter up to 5 existing Lambda layer ARNs (comma-separated): arn:aws:lambda:eu-central-1:017000801446:layer:AWSLambdaPowertoolsPython:15
9898
❯ amplify push -y
9999

100100

@@ -105,15 +105,15 @@ You can include Lambda Powertools Lambda Layer using [AWS Lambda Console](https:
105105
- Name: <NAME-OF-FUNCTION>
106106
? Which setting do you want to update? Lambda layers configuration
107107
? Do you want to enable Lambda layers for this function? Yes
108-
? Enter up to 5 existing Lambda layer ARNs (comma-separated): arn:aws:lambda:eu-central-1:017000801446:layer:AWSLambdaPowertoolsPython:13
108+
? Enter up to 5 existing Lambda layer ARNs (comma-separated): arn:aws:lambda:eu-central-1:017000801446:layer:AWSLambdaPowertoolsPython:15
109109
? Do you want to edit the local lambda function now? No
110110
```
111111

112112
=== "Get the Layer .zip contents"
113113
Change {region} to your AWS region, e.g. `eu-west-1`
114114

115115
```bash title="AWS CLI"
116-
aws lambda get-layer-version-by-arn --arn arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPython:13 --region {region}
116+
aws lambda get-layer-version-by-arn --arn arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPython:15 --region {region}
117117
```
118118

119119
The pre-signed URL to download this Lambda Layer will be within `Location` key.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "aws_lambda_powertools"
3-
version = "1.25.3"
3+
version = "1.25.5"
44
description = "A suite of utilities for AWS Lambda functions to ease adopting best practices such as tracing, structured logging, custom metrics, batching, idempotency, feature flags, and more."
55
authors = ["Amazon Web Services"]
66
include = ["aws_lambda_powertools/py.typed", "THIRD-PARTY-LICENSES"]

tests/functional/test_logger_utils.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,28 @@ def test_copy_config_to_parent_loggers_only(stdout):
217217
assert child.parent.name == service
218218

219219

220+
def test_copy_config_to_parent_loggers_only_with_exclude(stdout):
221+
# GIVEN Powertools Logger and Child Logger are initialized
222+
# and Powertools Logger config is copied over with exclude set
223+
service = service_name()
224+
child = Logger(stream=stdout, service=service, child=True)
225+
parent = Logger(stream=stdout, service=service)
226+
utils.copy_config_to_registered_loggers(source_logger=parent, exclude={"test"})
227+
228+
# WHEN either parent or child logger append keys
229+
child.append_keys(customer_id="value")
230+
parent.append_keys(user_id="value")
231+
parent.info("Logger message")
232+
child.info("Child logger message")
233+
234+
# THEN both custom keys should be propagated bi-directionally in parent and child loggers
235+
# as child logger won't be touched when config is being copied
236+
parent_log, child_log = capture_multiple_logging_statements_output(stdout)
237+
assert "customer_id" in parent_log, child_log
238+
assert "user_id" in parent_log, child_log
239+
assert child.parent.name == service
240+
241+
220242
def test_copy_config_to_ext_loggers_no_duplicate_logs(stdout, logger, log_level):
221243
# GIVEN an root logger, external logger and powertools logger initialized
222244

0 commit comments

Comments
 (0)