Documentation
¶
Overview ¶
Package sessions provides functions that return AWS sessions to use in the AWS SDK.
Index ¶
- func AreCredsFromEnvVars(sess *session.Session) (bool, error)
- func Creds(sess *session.Session) (credentials.Value, error)
- func UserAgentExtras(extras ...string) func(*Provider)
- type Provider
- func (p *Provider) Default() (*session.Session, error)
- func (p *Provider) DefaultWithRegion(region string) (*session.Session, error)
- func (p *Provider) FromProfile(name string) (*session.Session, error)
- func (p *Provider) FromRole(roleARN string, region string) (*session.Session, error)
- func (p *Provider) FromStaticCreds(accessKeyID, secretAccessKey, sessionToken string) (*session.Session, error)
- func (p *Provider) UserAgentExtras(extras ...string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AreCredsFromEnvVars ¶
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.
func UserAgentExtras ¶ added in v1.16.0
UserAgentExtras augments a session provider with additional User-Agent extras.
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 ImmutableProvider ¶ added in v1.16.0
ImmutableProvider returns an immutable session Provider with the options applied.
func (*Provider) Default ¶
Default returns a session configured against the "default" AWS profile. Default assumes that a region must be present with a session, otherwise it returns an error.
func (*Provider) DefaultWithRegion ¶
DefaultWithRegion returns a session configured against the "default" AWS profile and the input region.
func (*Provider) FromProfile ¶
FromProfile returns a session configured against the input profile name.
func (*Provider) FromRole ¶
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.
func (*Provider) UserAgentExtras ¶ added in v1.25.0
UserAgentExtras adds additional User-Agent extras to cached sessions and any new sessions.