Enable supply of pre-provisoned AWS clients #1163
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe the change
Added the option to provide an existing SQS client or Dynamo client rather than having the lock , persistence and queue providers creating them.
Describe your implementation or design
Added additional Service Collection extension methods to allow providing the clients. For default / current behaviour, the clients are now created in the extension method. For the new functionality, the client is passed into the extension method. The constructors on each of the providers has been altered receive the client rather than create it itself
Tests
No changes to functionality - only to how the objects are created
Breaking change
This is not a breaking change as the existing methods and signatures remain and work in the same way
Additional context
Using explicit AWS credentials in applications is not best practice as there are many ways in which these can be compromised. The encouraged practice is to execute your application in the context of an AWS role which will define the policies that the application is allow to execute. This approach does not use explicit credentials. Without this change, organisations that work in the encouraged manner cannot use the provided AWS lock, queue or persistence providers.