From 7e54945f5a6ca107e091090008543a5c4f5b38e2 Mon Sep 17 00:00:00 2001 From: Darnley Costa Date: Wed, 31 May 2023 23:15:31 -0300 Subject: [PATCH 1/2] fix(code_pipeline_job_event): Change `boto3` import location --- .../utilities/data_classes/code_pipeline_job_event.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws_lambda_powertools/utilities/data_classes/code_pipeline_job_event.py b/aws_lambda_powertools/utilities/data_classes/code_pipeline_job_event.py index c502aacb090..d1f537afa6f 100644 --- a/aws_lambda_powertools/utilities/data_classes/code_pipeline_job_event.py +++ b/aws_lambda_powertools/utilities/data_classes/code_pipeline_job_event.py @@ -4,8 +4,6 @@ from typing import Any, Dict, List, Optional from urllib.parse import unquote_plus -import boto3 - from aws_lambda_powertools.utilities.data_classes.common import DictWrapper @@ -203,6 +201,10 @@ def setup_s3_client(self): BaseClient An S3 client with the appropriate credentials """ + # IMPORTING boto3 within the FUNCTION and not at the top level to get + # it only when we explicitly want it for better performance. + import boto3 + return boto3.client( "s3", aws_access_key_id=self.data.artifact_credentials.access_key_id, From 29a43c4c3b7db3df3d53ae2ff085933621fabb25 Mon Sep 17 00:00:00 2001 From: Leandro Damascena Date: Thu, 1 Jun 2023 11:14:38 +0100 Subject: [PATCH 2/2] chore: fix md file --- docs/core/logger.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/core/logger.md b/docs/core/logger.md index 064328dabb0..305a7cef0f3 100644 --- a/docs/core/logger.md +++ b/docs/core/logger.md @@ -741,6 +741,7 @@ Here's an example where we persist `payment_id` not `request_id`. Note that `pay ---8<-- "examples/logger/src/append_keys_vs_extra_output.json" ``` + ### How do I aggregate and search Powertools for AWS Lambda (Python) logs across accounts? As of now, ElasticSearch (ELK) or 3rd party solutions are best suited to this task. Please refer to this [discussion for more details](https://github.com/awslabs/aws-lambda-powertools-python/issues/460)