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. There are two ways to sign up for AWS. If you want complete control over account configuration and where your content is stored, or if you have regulated workloads such as HIPAA or FedRAMP, use Sign up for AWS (advanced). If you are a new user and want to use a login you already own to sign in to AWS and create an AWS environment with preconfigured defaults in select AWS Regions, use Sign up for AWS.
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 experiment1, 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" )