Skip to content

A thing wrapper around the AWS Go SDK to allow for creating sessions using DSN strings.

Notifications You must be signed in to change notification settings

aaronland/go-aws-session

Repository files navigation

go-aws-session

This package is a thing wrapper around the AWS Go SDK to allow for creating sessions using DSN strings.

Example


import (
	"github.com/aaronland/go-aws-session"
)

func main() {
	str_dsn := "region=us-east-1 credentials=env:"
	sess, err := session.NewSessionWithDSN(str_dsn)

	// do something with sess or err here
}

DSN strings

The following properties are required in DSN strings:

Credentials

Credentials for AWS sessions are defined as string labels. They are:

Label Description
anon: Empty or anonymous credentials.
env: Read credentials from AWS defined environment variables.
iam: Assume AWS IAM credentials are in effect.
sts:{ARN} Assume the role defined by {ARN} using STS credentials.
{AWS_PROFILE_NAME} This this profile from the default AWS credentials location.
{AWS_CREDENTIALS_PATH}:{AWS_PROFILE_NAME} This this profile from a user-defined AWS credentials location.

For example:

s3:///bucket-name?region=us-east-1&credentials=iam:

Region

Any valid AWS region.

See also

About

A thing wrapper around the AWS Go SDK to allow for creating sessions using DSN strings.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages