Menu
AWS SDK for Go
Developer Guide

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.

Install the AWS SDK for Go

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

Copy
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 dependancies are vendored in the vendor/ folder.

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

Get your AWS access keys

Access keys consist of an access key ID and secret access key, which are used to sign programmatic requests that you make to AWS. If you don't have access keys, you can create them by using the AWS Management Console. We recommend that you use IAM access keys instead of AWS root account access keys. IAM lets you securely control access to AWS services and resources in your AWS account.

Note

To create access keys, you must have permissions to perform the required IAM actions. For more information, see Granting IAM User Permission to Manage Password Policy and Credentials in the IAM User Guide.

To get your access key ID and secret access key

  1. Open the IAM console.

  2. From the navigation menu, click Users.

  3. Select your IAM user name.

  4. Click User Actions, and then click Manage Access Keys.

  5. Click Create Access Key.

    Your keys will look something like this:

    • Access key ID example: AKIAIOSFODNN7EXAMPLE

    • Secret access key example: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

  6. Click Download Credentials, and store the keys in a secure location.

Important

Your secret key will no longer be available through the AWS Management Console; you will have the only copy. Keep it confidential in order to protect your account, and never email it. Do not share it outside your organization, even if an inquiry appears to come from AWS or Amazon.com.

No one who legitimately represents Amazon will ever ask you for your secret key.

Related topics

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:

Copy
import "github.com/aws/aws-sdk-go/service/s3"