github aws/aws-sdk-go-v2 v0.31.0
Release 2020-12-23 (Release Candidate 1)

latest releases: release-2024-07-05, service/qbusiness/v1.10.0, service/pinpointsmsvoicev2/v1.12.2...
pre-release3 years ago

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

Breaking Changes

  • Dependency github.com/awslabs/smithy-go has been relocated to github.com/aws/smithy-go
    • The smithy-go repository was moved from the awslabs GitHub organization to aws.
    • xml, httpbinding, and json package relocated under encoding package.
  • The module ec2imds moved to feature/ec2/imds path (#984)
    • Moves the ec2imds feature module to be in common location as other SDK features.
  • aws/signer/v4: Refactor AWS Sigv4 Signer and options types to allow function options (#955)
  • aws: CredentialCache type updated to require constructor function (#946)
  • credentials: ExpiryWindow and Jitter moved from credential provider to CredentialCache (#946)
    • Moves ExpiryWindow and Jitter options to common option of the CredentialCache instead of duplicated across providers.
    • Fixes #940
  • 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: Add context.Context to LoadDefaultConfig (#951)
    • Updates config#LoadDefaultConfig function to take context.Context as well as functional options for the config#LoadOptions type.
    • Fixes #926, #819
  • aws: Rename NoOpRetryer to NopRetryer to have consistent naming with rest of SDK (#987)
  • service/s3control: Change S3InitiateRestoreObjectOperation.ExpirationInDays from value to pointer type (#988)
  • aws: ReaderSeekerCloser and WriteAtBuffer have been relocated to feature/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
  • codegen: Fix API client union serialization (#979)

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)
  • service/s3, service/s3control:
    • Add support for reading s3_use_arn_region from shared config file (#991)
    • Add Utility for getting RequestID and HostID of response (#983)

Other changes

  • Updates branch HEAD points from master to main.
    • 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.

Don't miss a new aws-sdk-go-v2 release

NewReleases is sending notifications on new releases.