Skip to content

Replacing the default boto3 session with a custom one #704

Closed

Description

@adhorn

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...?

Activity

  1. added
    feature-request
    triage
    on Sep 28, 2021
  2. boring-cyborg commented on Sep 28, 2021

    @boring-cyborg

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

  3. added
    good first issue
    and removed
    triage
    on Sep 28, 2021
  4. modified the milestone: 1.20.3 on Oct 1, 2021
  5. added
    pending-release
    on Oct 1, 2021
  6. heitorlessa commented on Oct 5, 2021

    @heitorlessa
    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 ;)

  7. removed
    pending-release
    on Oct 5, 2021
  8. adhorn commented on Oct 6, 2021

    @adhorn
    Author

    Legends!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

feature-requestgood first issuep1

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions