-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(awsutil-v2): implement awsutil for aws-sdk-go-v2 (#83)
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.
- Loading branch information
Showing
17 changed files
with
1,155 additions
and
639 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# AWSUTIL - Go library for generating aws credentials | ||
|
||
*NOTE*: This is version 2 of the library. The `v0` branch contains version 0, | ||
which may be needed for legacy applications or while transitioning to version 2. | ||
|
||
## Usage | ||
|
||
Following is an example usage of generating AWS credentials with static user credentials | ||
|
||
```go | ||
|
||
// AWS access keys for an IAM user can be used as your AWS credentials. | ||
// This is an example of an access key and secret key | ||
var accessKey = "AKIAIOSFODNN7EXAMPLE" | ||
var secretKey = "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" | ||
|
||
// Access key IDs beginning with AKIA are long-term access keys. A long-term | ||
// access key should be supplied when generating static credentials. | ||
config, err := awsutil.NewCredentialsConfig( | ||
awsutil.WithAccessKey(accessKey), | ||
awsutil.WithSecretKey(secretKey), | ||
) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
s3Client := s3.NewFromConfig(config) | ||
|
||
``` | ||
|
||
## Contributing to v0 | ||
|
||
To push a bug fix or feature for awsutil `v0`, branch out from the [awsutil/v0](https://github.com/hashicorp/go-secure-stdlib/tree/awsutil/v0) branch. | ||
Commit the code changes you want to this new branch and open a PR. Make sure the PR | ||
is configured so that the base branch is set to `awsutil/v0` and not `main`. Once the PR | ||
is reviewed, feel free to merge it into the `awsutil/v0` branch. When creating a new | ||
release, validate that the `Target` branch is `awsutil/v0` and the tag is `awsutil/v0.x.x`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.