-
Notifications
You must be signed in to change notification settings - Fork 24
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(awsutil-v2): implement awsutil for aws-sdk-go-v2 #83
Conversation
8724ae3
to
9029211
Compare
@ddebko rather than making this |
Jeff's suggestion might make it easier to review too. |
26cdc20
to
1d97ab4
Compare
@jefferai @sgmiller I have updated the PR to move the code into a subdirectory/package called v2 in awsutil. I have 2
|
Just a note to please move the files back to the main directory and update Arguably it'd be more useful to have them there now as we could see the differences instead of it all being new code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Afaict it looks good to me.
2be4793
to
6309dc5
Compare
This major version release utilizes the latest version of the aws-sdk-go-v2. The following behavioral changes are included in this major version release: - Custom endpoint resolvers are attached to the STS and IAM clients, not to the credentials. This is apart of the aws-sdk-go-v2 EndpointResolverV2 feature. - withStsEndpoint is no longer a string type, but a sts.EndpointResolverV2 type. This option was relabeled to withStsEndpointResolver. - withIamEndpoint is no longer a string type, but a iam.EndpointResolverV2 type. This option was relabeled to withIamEndpointResolver. - By default, aws credential configurations will load values from environment variables. The user provided options will overload the default values. - The ability to mock out the underlying credential provider for unit testing. Changed behaviors from awsutil v1 includes the following: - Replaced aws errors with aws smithy-go errors - No longer able to utilize the aws default remote credential provider - The function GenerateCredentialChain returns a aws.Config, which contains the credential provider.
6309dc5
to
9d5d1bb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make sure to make the necessary changes to go.mod
given the version bump.
Unless the plan is to mark this as v1.0.0 since the current tags are still in v0
?
The current code will be kept as |
7ace4a6
to
21dec3d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving to unblock merge access
For some reason the changes from 1a4b955 were not ported over. The PR description does not seem to mention why they were dropped, nor provide a migration path forward. |
Summary
This PR is adding a new major version of
awsutil
. The breaking change that requires a major version release is using the latest aws sdk:aws-sdk-go-v2
.Disclaimer:
Feel free to update to this major release change if you are migrating to
aws-sdk-go-v2
. The Vault team should be cautious of updating to this version due to potential breaking changes from behavior differences between theaws-sdk-go
libraries.Note:
awsutil
package. For example, environment variables are always loaded by default in v2. The aws-sdk-go-v2 also doesn't supportRemoteCredProviders
. GetRegion no longer can get a default region value fromec2metadata
because it does not exist and the replacementimds
pkg does not support the same feature.The benefits of changing the endpoint options from a string to their respective EndpointResolverV2 definition type is that now we can enable complex routing to a set of different endpoints based on fields defined in the resolverV2 struct. Please follow this link to read more about the EndpointResolverV2 option. Example: