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.
** Problem **
This library is a key tool in dev testing aws services particular self hosted api gateway instances as it has strong integration with api gateway.
However there can be problems in using this in high availability multi-region solutions built on top of AWS due to the fact that in these situations it is not always easy to determine what the region you will be talking to will be at request signing time.
Luckily AWS introduced sigv4a to solve this problem and allow flexibilty, this Pull Request impliments sigv4a for awscurl
** Solution **
This is a minimal proposed fix that pulls in logic written in amazon and vended out to do most of the heavy lifting. pulling a dependency on awscrt for the credential logic.
This is largely based off of the example for sigv4a from aws: here.
** Testing **
I hit an endpoint for an API Gateway instance in us-west-2, below was the outcome