Skip to content

Commit 07f4534

Browse files
author
Michael Brewer
authored
Merge branch 'develop' into docs/1067
2 parents 38cd41d + 09f98f8 commit 07f4534

File tree

6 files changed

+67
-28
lines changed

6 files changed

+67
-28
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
@@ -374,7 +374,7 @@ You can nest `app.resolver()` decorator multiple times when resolving fields wit
374374
}
375375

376376
type Query {
377-
listLocations: [Todo]
377+
listLocations: [Location]
378378
}
379379

380380
type Location {

docs/index.md

Lines changed: 25 additions & 25 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

@@ -62,7 +62,7 @@ You can include Lambda Powertools Lambda Layer using [AWS Lambda Console](https:
6262
Type: AWS::Serverless::Function
6363
Properties:
6464
Layers:
65-
- !Sub arn:aws:lambda:${AWS::Region}:017000801446:layer:AWSLambdaPowertoolsPython:13
65+
- !Sub arn:aws:lambda:${AWS::Region}:017000801446:layer:AWSLambdaPowertoolsPython:15
6666
```
6767

6868
=== "Serverless framework"
@@ -72,7 +72,7 @@ You can include Lambda Powertools Lambda Layer using [AWS Lambda Console](https:
7272
hello:
7373
handler: lambda_function.lambda_handler
7474
layers:
75-
- arn:aws:lambda:${aws:region}:017000801446:layer:AWSLambdaPowertoolsPython:13
75+
- arn:aws:lambda:${aws:region}:017000801446:layer:AWSLambdaPowertoolsPython:15
7676
```
7777

7878
=== "CDK"
@@ -88,7 +88,7 @@ You can include Lambda Powertools Lambda Layer using [AWS Lambda Console](https:
8888
powertools_layer = aws_lambda.LayerVersion.from_layer_version_arn(
8989
self,
9090
id="lambda-powertools",
91-
layer_version_arn=f"arn:aws:lambda:{env.region}:017000801446:layer:AWSLambdaPowertoolsPython:13"
91+
layer_version_arn=f"arn:aws:lambda:{env.region}:017000801446:layer:AWSLambdaPowertoolsPython:15"
9292
)
9393
aws_lambda.Function(self,
9494
'sample-app-lambda',
@@ -135,7 +135,7 @@ You can include Lambda Powertools Lambda Layer using [AWS Lambda Console](https:
135135
role = aws_iam_role.iam_for_lambda.arn
136136
handler = "index.test"
137137
runtime = "python3.9"
138-
layers = ["arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPython:13"]
138+
layers = ["arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPython:15"]
139139

140140
source_code_hash = filebase64sha256("lambda_function_payload.zip")
141141
}
@@ -152,7 +152,7 @@ You can include Lambda Powertools Lambda Layer using [AWS Lambda Console](https:
152152
? Do you want to configure advanced settings? Yes
153153
...
154154
? Do you want to enable Lambda layers for this function? Yes
155-
? Enter up to 5 existing Lambda layer ARNs (comma-separated): arn:aws:lambda:eu-central-1:017000801446:layer:AWSLambdaPowertoolsPython:13
155+
? Enter up to 5 existing Lambda layer ARNs (comma-separated): arn:aws:lambda:eu-central-1:017000801446:layer:AWSLambdaPowertoolsPython:15
156156
❯ amplify push -y
157157

158158

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

170170
=== "Get the Layer .zip contents"
171171
Change {region} to your AWS region, e.g. `eu-west-1`
172172

173173
```bash title="AWS CLI"
174-
aws lambda get-layer-version-by-arn --arn arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPython:13 --region {region}
174+
aws lambda get-layer-version-by-arn --arn arn:aws:lambda:{region}:017000801446:layer:AWSLambdaPowertoolsPython:15 --region {region}
175175
```
176176

177177
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)