Skip to content

fix(event_source): change the import location of boto3 in CodePipelineJobEvent data class #2353

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
from typing import Any, Dict, List, Optional
from urllib.parse import unquote_plus

import boto3

from aws_lambda_powertools.shared import user_agent
from aws_lambda_powertools.utilities.data_classes.common import DictWrapper


Expand Down Expand Up @@ -204,6 +201,12 @@ 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

from aws_lambda_powertools.shared import user_agent

s3 = boto3.client(
"s3",
aws_access_key_id=self.data.artifact_credentials.access_key_id,
Expand Down
1 change: 1 addition & 0 deletions docs/core/logger.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
```

<!-- markdownlint-disable MD013 -->
### 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)