Skip to content
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

Allow passing Config object to cloudwanderer session #267

Open
0bart opened this issue Jan 11, 2022 · 0 comments
Open

Allow passing Config object to cloudwanderer session #267

0bart opened this issue Jan 11, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@0bart
Copy link

0bart commented Jan 11, 2022

Is your feature request related to a problem? Please describe.
Currently when I want to change boto3 client's config I have to pass the botocore.config.Config object to the CloudWandererBoto3Session's resource method. If I use CloudWandererAWSInterface to get resources the only way to pass config object to boto3 client is to include it as client_args in CloudWandererAWSInterface's get_resources method what causes unnecessary chain.
It makes impossible to inject ready-to-use CloudWandererAWSInterface object to high level code repositories or fetchers, since we have to pass client_args and handle passing client_args there.

Describe the solution you'd like
IMO good idea would be to allow passing Config object to CloudWandererBoto3Session's __init__ as an optional parameter:

class CloudWandererBoto3Session(boto3.session.Session):
    def __init__(
            self,
            ...,
            config: Optional[botocore.client.Config] = None,
        ) -> None:
        ...

then invoke super().resource() method with config=config or self.config

Describe alternatives you've considered
N/A

Additional context
N/A

@0bart 0bart added the enhancement New feature or request label Jan 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant