This release updates the SDK's configuration and bug fixes.


Created On: October 29, 2015
Last Updated: October 09, 2017


Latest Version

go get -u github.com/aws/aws-sdk-go/...

Updates

Change Description
SDK Configuration

Updates SDK to use session.Session when creating service clients. Service clients now require a session, which contains the SDK defaults and any additional configurations you've provided. This gives you control over how your configuration is shared across the SDK's service clients and tools.

Resolved Issues

Change Description
internal/protocol/json

Further reduce marshal allocs of JSON related marshalers.

aws/request

Adds retrying RequestTimeout request error code. S3 can return a RequestTimeout error code when the service has not received the full Content-Length bytes. The server will closed the connection with this error code. The failed request should be retried.

service/s3/s3manager

Fixes S3 Upload managers part size calculation to prevent integer division part size truncation.

SDK Configuration Migration Notes

Migrating to this change you'll need to add a session.Session to your application. The session will be used in each place a service client is created. Naively this can be s3.New(session.New()) instead of the previous s3.New(nil). If the aws.Config value was being passed in to the service client the code would become, s3.New(session.New(), cfg). If you used default.DefaultConfig you can replace this logic with a new session and set merge in the config which was beign set to the global default value. Like session.New(myCfg) or:

sess := session.New()
sess.Config.LogLevel = aws.LogLevel(aws.Debug)

Examples:

    // Create a session with the default config and request handlers.
    sess := session.New()

    // Create a session with a custom region
    sess := session.New(&aws.Config{Region: aws.String("us-east-1")})

    // Create a session, and add additional handlers for all service
    // clients created with the session to inherit.
    sess := session.New()
    sess.Handlers.Build.pushBack(func(r *request.Handlers) {
        // Log every request made and its payload
        logger.Println("Request: %s/%s, Payload: %s", r.ClientInfo.ServiceName, r.Operation, r.Params)
    })

    // Create a S3 client instance from a session
    sess := session.New()
    svc := s3.New(sess)

    // Create a S3 client with additional configuration
    svc := s3.New(sess, aws.NewConfig().WithRegion("us-west-2"))

In addition to this change there were a few other changes in this update.

  • aws/service.Service was renamed to aws/client.Client.
  • aws/service/serviceinfo.ServiceInfo was renamed to aws/client/metadata.ClientInfo
  • aws.DefaultRetries was renamed to aws.UseServiceDefaultRetries
  • aws/ec2metadata now takes a session and aws.Config like all other service clients
  • aws/credentails/ec2rolecreds.EC2RoleProvider now requires an ec2metadata.EC2Metadata and will not default to creating one.
  • service/s3/s3manager.Downloader now requires a S3 service client instance, and also takes functional options for setting the Downloader's options.
  • service/s3/s3manager.Uploader now requires a S3 service client instance, and also takes functional options for setting the Uploader's options.

Supported API Versions

This release of the SDK supports the following API versions:

Service API Version
Amazon API Gateway 2015-07-09
Amazon CloudFront 2015-07-27
Amazon CloudHSM 2014-05-30
Amazon CloudSearch 2013-01-01
Amazon CloudSearch Domain 2013-01-01
Amazon CloudWatch 2010-08-01
Amazon CloudWatch Logs 2014-03-28
Amazon Cognito Identity 2014-06-30
Amazon Cognito Sync 2014-06-30
Amazon DynamoDB 2012-08-10
Amazon DynamoDB Streams 2012-08-10
Amazon EC2 Container Service 2014-11-13
Amazon Elastic Compute Cloud 2015-10-01
Amazon Elastic File System 2015-02-01
Amazon Elastic MapReduce 2009-03-31
Amazon Elastic Transcoder 2012-09-25
Amazon ElastiCache 2015-02-02
Amazon Elasticsearch Service 2015-01-01
Amazon Glacier 2012-06-01
Amazon Inspector 2015-08-18
Amazon Kinesis 2013-12-02
Amazon Kinesis Firehose 2015-08-04
Amazon Machine Learning 2014-12-12
Amazon Mobile Analytics 2014-06-05
Amazon Redshift 2012-12-01
Amazon Relational Database Service 2014-10-31
Amazon Route 53 2013-04-01
Amazon Route 53 Domains 2014-05-15
Amazon Simple Email Service 2010-12-01
Amazon Simple Notification Service 2010-03-31
Amazon Simple Queue Service 2012-11-05
Amazon Simple Storage Service 2006-03-01
Amazon Simple Systems Management Service 2014-11-06
Amazon Simple Workflow Service 2012-01-25
Amazon SimpleDB 2009-04-15
Amazon WorkSpaces 2015-04-08
Auto Scaling 2011-01-01
AWS CloudFormation 2010-05-15
AWS CloudTrail 2013-11-01
AWS CodeCommit 2015-04-13
AWS CodeDeploy 2014-10-06
AWS CodePipeline 2015-07-09
AWS Config 2014-11-12
AWS Data Pipeline 2012-10-29
AWS Device Farm 2015-06-23
AWS Direct Connect 2012-10-25
AWS Directory Service 2015-04-16
AWS Elastic Beanstalk 2010-12-01
AWS Identity and Access Management 2010-05-08
AWS IoT 2015-05-28
AWS IoT Data Plane 2015-05-28
AWS Key Management Service 2014-11-01
AWS Lambda 2015-03-31
AWS Marketplace Commerce Analytics 2015-07-01
AWS OpsWorks 2013-02-18
AWS Security Token Service 2011-06-15
AWS Storage Gateway 2013-06-30
AWS Support 2013-04-15
AWS WAF 2015-08-24
Elastic Load Balancing 2012-06-01