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

feat(parameters): add support for custom AWS SDK v3 clients for providers #1260

Conversation

shdq
Copy link
Contributor

@shdq shdq commented Jan 25, 2023

This PR is intended to add support for custom AWS SDK v3 clients for providers

Providers covered:

  • AppConfigProvider
  • DynamoDBProvider
  • SecretsProvider
  • SSMProvider

Description of your changes

How to verify this change

Related issues, RFCs

Issue number: #1222

PR status

Is this ready for review?: NO
Is it a breaking change?: NO

Checklist

  • My changes meet the tenets criteria
  • I have performed a self-review of my own code
  • I have commented my code where necessary, particularly in areas that should be flagged with a TODO, or hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding changes to the examples
  • My changes generate no new warnings
  • The code coverage hasn't decreased
  • I have added tests that prove my change is effective and works
  • New and existing unit tests pass locally and in Github Actions
  • Any dependent changes have been merged and published
  • The PR title follows the conventional commit semantics

Breaking change checklist

  • I have documented the migration process
  • I have added, implemented necessary warnings (if it can live side by side)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@pull-request-size pull-request-size bot added the size/L PRs between 100-499 LOC label Jan 25, 2023
@shdq
Copy link
Contributor Author

shdq commented Jan 25, 2023

Hey @dreamorosi 👋
I hope you're doing well!

I have a couple of things to discuss:

To make clientConfig and awsSdkV3Client mutually exclusive I came up with this solution with types. Any comments?
If it is a decent way to type options, I will move to other providers.

The constructor method is getting messy, if it's ok we can leave it as is, or we can make something like in other packages with this.setOptions(options);

In tests, I used serviceId config option because when I try to set region for the client it doesn't work. Maybe a bug.

@github-actions github-actions bot added the feature PRs that introduce new features or minor changes label Jan 25, 2023
@shdq
Copy link
Contributor Author

shdq commented Feb 1, 2023

In the screenshot an example of the type error. The options variable has type error because it has both clientConfig and awsSdkV3Client properties. options2 and options3 variables don't have type errors.

Screenshot 2023-02-01 at 16 58 24

@shdq shdq marked this pull request as ready for review February 1, 2023 13:30
Copy link
Contributor

@dreamorosi dreamorosi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @shdq for working on this one, appreciate it!

I like the solution you have proposed with the interfaces, so let's go with it.

Regarding the setOptions method, I'd leave things as they are and prioritize the other items missing on the utility. However I agree with you, so if we make any further addition/change to the constructor, let's also extract the logic in its own method.

@dreamorosi dreamorosi linked an issue Feb 6, 2023 that may be closed by this pull request
2 tasks
@dreamorosi dreamorosi merged commit 3a8cfa0 into aws-powertools:main Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature PRs that introduce new features or minor changes size/L PRs between 100-499 LOC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: support providing aws sdk v3 client
2 participants