View a markdown version of this page

Getting Started with the AWS SDK for Go - AWS SDK for Go (version 1)

AWS SDK for Go V1 has reached end-of-support. We recommend that you migrate to AWS SDK for Go V2. For additional details and information on how to migrate, please refer to this announcement.

Getting Started with the AWS SDK for Go

The AWS SDK for Go requires Go 1.5 or later. You can view your current version of Go by running the go version command. For information about installing or upgrading your version of Go, see https://golang.org/doc/install.

Sign up for an AWS account

To get started with AWS, you need an AWS account. For information about creating an AWS account, see Getting started with an AWS account in the AWS Account Management Reference Guide.

Install the AWS SDK for Go

To install the SDK and its dependencies, run the following Go command.

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

If you set the Go vendor experiment environment variable to 1, you can use the following command to get the SDK. The SDK's runtime dependencies are vendored in the vendor/ folder.

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

Import Packages

After you have installed the SDK, you import AWS packages into your Go applications to use the SDK, as shown in the following example, which imports the AWS, Session, and Amazon S3 libraries:

import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/s3" )