Skip to content

Replacing the default boto3 session with a custom one #704

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

Closed
adhorn opened this issue Sep 28, 2021 · 3 comments
Closed

Replacing the default boto3 session with a custom one #704

adhorn opened this issue Sep 28, 2021 · 3 comments
Assignees
Labels
feature-request feature request good first issue Good for newcomers p1

Comments

@adhorn
Copy link

adhorn commented Sep 28, 2021

Is your feature request related to a problem? Please describe.

I would like to replace the default boto3 powertools client and provide my own boto3 session to record local calls using Placebo

Describe the solution you'd like

For example, here's how you could inject a Placebo client for local tests:

import placebo
import boto3
from aws_lambda_powertools.utilities import Parameters

session = boto3.Session()
pill = placebo.attach(session, data_path=PLACEBO_PATH)
pill.playback()
client = session.client('appconfig')
Parameters.set_boto3_client(client)

something like this...?

@adhorn adhorn added feature-request feature request triage Pending triage from maintainers labels Sep 28, 2021
@boring-cyborg
Copy link

boring-cyborg bot commented Sep 28, 2021

Thanks for opening your first issue here! We'll come back to you as soon as we can.

@heitorlessa
Copy link
Contributor

This is now available as part of 1.21.0 release: https://github.com/awslabs/aws-lambda-powertools-python/releases/tag/v1.21.0

We've added others besides the parameters utility ;)

@heitorlessa heitorlessa removed the pending-release Fix or implementation already in dev waiting to be released label Oct 5, 2021
@adhorn
Copy link
Author

adhorn commented Oct 6, 2021

Legends!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request feature request good first issue Good for newcomers p1
Projects
None yet
Development

No branches or pull requests

3 participants