AWS SDK For Go Version 2 Now Generally Available

GA of AWS SDK For Go version 2 features Modularization, Intuitive Configuration, Simplified API client methods, and Fewer API Parameter Pointers.

Recently, Amazon announced the General Availability (GA) release of the AWS SDK for Go version 2. The release features Modularization, Intuitive Configuration, Simplified API client methods, Fewer API Parameter Pointers, Paginate with Iterator, and more.

The AWS SDK for Go v2 needs Go 1.15 or higher, and provides notable performance improvements in CPU and memory utilization as compared to the version 1.

Source: Amazon

The SDK for Go v2 packages each AWS service client as an independent Go module. This enables developers to model service dependencies in their application, and independently control service client and feature updates. This in turn reduces the individual module size. 

Version-2 consolidates multiple ways to make an API call, offering a simpler API client. Now, service operations invoke on the client directly, with each operation method taking the API input along with context, and returning the response or error.

Version-2 provides a single Config type, which simplifies the Session and Config type interaction from the v1 SDK.  Also, the service-specific configuration flags has been moved to the individual service client option types. This enhances the discoverability of configuration values supported by the service client. You can use LoadDefaultConfig in the config package in order to create the default config value, and load configuration values from the external configuration sources.

The new version also reduces the amount of pointer references you need to pass to the SDK. v2 takes advantage of API model data to provide types as values when possible, including map and slice elements. Enums are now typed string aliases - generated as constants and used directly in the code.

Version 2 of the SDK also offer context per page, and easy iteration over API results that span multiple page.