We’re happy to announce the Release Candidate (RC) of the AWS SDK for Go v2.
This RC follows the developer preview release of the AWS SDK for Go v2. The SDK
has undergone a major rewrite from the v1 code base to incorporate your
feedback and to take advantage of modern Go language features.
Documentation
- Developer Guide: https://aws.github.io/aws-sdk-go-v2/docs/
- API Reference docs: https://pkg.go.dev/github.com/aws/aws-sdk-go-v2
- Migration Guide: https://aws.github.io/aws-sdk-go-v2/docs/migrating/
Breaking Changes
- Dependency
github.com/awslabs/smithy-go
has been relocated togithub.com/aws/smithy-go
- The
smithy-go
repository was moved from theawslabs
GitHub organization toaws
. xml
,httpbinding
, andjson
package relocated underencoding
package.
- The
- The module
ec2imds
moved tofeature/ec2/imds
path (#984)- Moves the
ec2imds
feature module to be in common location as other SDK features.
- Moves the
aws/signer/v4
: Refactor AWS Sigv4 Signer and options types to allow function options (#955)aws
: CredentialCache type updated to require constructor function (#946)- Fixes #940
credentials
: ExpiryWindow and Jitter moved from credential provider toCredentialCache
(#946)- Moves ExpiryWindow and Jitter options to common option of the
CredentialCache
instead of duplicated across providers. - Fixes #940
- Moves ExpiryWindow and Jitter options to common option of the
config
: Ensure shared credentials file has precedence over shared config file (#990)- The shared config file was incorrectly overriding the shared credentials file when merging values.
config
: Addcontext.Context
toLoadDefaultConfig
(#951)aws
: RenameNoOpRetryer
toNopRetryer
to have consistent naming with rest of SDK (#987)- Fixes #878
service/s3control
: ChangeS3InitiateRestoreObjectOperation.ExpirationInDays
from value to pointer type (#988)aws
:ReaderSeekerCloser
andWriteAtBuffer
have been relocated tofeature/s3/manager
.
New Features
- Waiters: Add Waiter utilities for API clients (aws/smithy-go#237)
- Your application can now use Waiter utilities to wait for AWS resources.
feature/dynamodb/attributevalue
: Add Amazon DynamoDB Attribute value marshaler utility (#948)- Adds a utility for marshaling Go types too and from Amazon DynamoDB AttributeValues.
- Also includes utility for converting from Amazon DynamoDB Streams AttributeValues to Amazon DynamoDB AttributeValues.
feature/dynamodbstreams/attributevalue
: Add Amazon DynamoDB Streams Attribute value marshaler utility (#948)- Adds a utility for marshaling Go types too and from Amazon DynamoDB Streams AttributeValues.
- Also includes utility for converting from Amazon DynamoDB AttributeValues to Amazon DynamoDB Streams AttributeValues.
feature/dynamodb/expression
: Add Amazon DynamoDB expression utility (#981)- Adds the expression utility to the SDK for easily building Amazon DynamoDB operation expressions in code.
Bug Fixes
service/s3
: Fix Presigner to configure client correctly for Amazon S3 (#969)- service/s3: Fix deserialization of CompleteMultipartUpload (#965
- Fixes #927
codegen
: Fix API client union serialization (#979)- Fixes #978
Service Client Highlights
- API Clients have been bumped to version
v0.31.0
- Regenerate API Clients from updated API models adding waiter utilities, and union parameters.
codegen
:- Add documentation to union API parameters describing valid member types, and usage example (aws/smithy-go#239)
- Normalize Metadata header map keys to be lower case (aws/smithy-go#241), (#982)
- Fixes #376 Amazon S3 Metadata parameters keys are always returned as lower case.
- Fix API client deserialization of XML based responses (aws/smithy-go#245), (#992)
- Fixes #910
service/s3
,service/s3control
:
Other changes
- Updates branch
HEAD
points frommaster
tomain
.- This should not impact your application, but if you have pull requests or forks of the SDK you may need to update the upstream branch your fork is based off of.
Migrating from v2 preview SDK's v0.30.0 to v0.31.0 release candidate
smithy-go module relocation
If your application uses smithy-go
utilities for request pipeline your application will need to be updated to refer to the new import path of github.com/aws/smithy-go
. If you application did not use smithy-go
utilities directly, your application will update automatically.
EC2 IMDS module relocation
If your application used the ec2imds
module, it has been relocated to feature/ec2/imds
. Your application will need to update to the new import path, github.com/aws/aws-sdk-go-v2/feature/ec2/imds
.
CredentialsCache Constructor and ExpiryWindow Options
The aws#CredentialsCache
type was updated, and a new constructor function, NewCredentialsCache
was added. This function needs to be used to initialize the CredentialCache
. The constructor also has function options to specify additional configuration, e.g. ExpiryWindow and Jitter.
If your application was specifying the ExpiryWindow
with the credentials/stscreds#AssumeRoleOptions
, credentials/stscreds#WebIdentityRoleOptions
, credentials/processcreds#Options
, or credentials/ec2rolecrds#Options
types the ExpiryWindow
option will need to specified on the CredentialsCache
constructor instead.
AWS Sigv4 Signer Refactor
The aws/signer/v4
package's Signer.SignHTTP
and Signer.PresignHTTP
methods were updated to take functional options. If your application provided a custom implementation for API client's HTTPSignerV4
or HTTPPresignerV4
interfaces, that implementation will need to be updated for the new function signature.
Configuration Loading
The config#LoadDefaultConfig
function has been updated to require a context.Context
as the first parameter, with additional optional function options as variadic additional arguments. Your application will need to update its usage of LoadDefaultConfig
to pass in context.Context
as the first parameter. If your application used the With...
helpers those should continue to work without issue.
The v2 SDK corrects its behavior to be inline with the AWS CLI and other AWS SDKs. Refer to https://docs.aws.amazon.com/credref/latest/refdocs/overview.html for more information how to use the shared config and credentials files.