sessions

package
v1.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package sessions provides functions that return AWS sessions to use in the AWS SDK.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AreCredsFromEnvVars

func AreCredsFromEnvVars(sess *session.Session) (bool, error)

AreCredsFromEnvVars returns true if the session's credentials provider is environment variables, false otherwise. An error is returned if the credentials are invalid or the request times out.

func Creds

func Creds(sess *session.Session) (credentials.Value, error)

Creds returns the credential values from a session.

Types

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider provides methods to create sessions. Once a session is created, it's cached locally so that the same session is not re-created.

func NewProvider

func NewProvider() *Provider

NewProvider returns a session Provider singleton.

func (*Provider) Default

func (p *Provider) Default() (*session.Session, error)

Default returns a session configured against the "default" AWS profile.

func (*Provider) DefaultWithRegion

func (p *Provider) DefaultWithRegion(region string) (*session.Session, error)

DefaultWithRegion returns a session configured against the "default" AWS profile and the input region.

func (*Provider) FromProfile

func (p *Provider) FromProfile(name string) (*session.Session, error)

FromProfile returns a session configured against the input profile name.

func (*Provider) FromRole

func (p *Provider) FromRole(roleARN string, region string) (*session.Session, error)

FromRole returns a session configured against the input role and region.

func (*Provider) FromStaticCreds

func (p *Provider) FromStaticCreds(accessKeyID, secretAccessKey, sessionToken string) (*session.Session, error)

FromStaticCreds returns a session from static credentials.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL