sts

package
v0.0.0-...-cbea63e Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssumeRole

func AssumeRole(roleArn string, sessionName string, duration int) (*aws.Auth, error)

Assume role uses the current server role to call STS and assume a different role if permitted Params:

roleArn - the requested role ARN (example: arn:aws:iam::11111111111:role/myrole )
sessionName - a name to associate with the current session. Use the service name +
              unique idenfitifier preferebly.
duration - the duration of the session in seconds. Must be between 900 and 3600

Returns aws.Auth object that can be used with any of the existing goamz APIs

Check http://goo.gl/M6uCu5 for more information

Types

type STSConnectionManager

type STSConnectionManager struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewSTSConnectionManager

func NewSTSConnectionManager() *STSConnectionManager

func (*STSConnectionManager) Delete

func (m *STSConnectionManager) Delete(key string)

func (*STSConnectionManager) Get

func (m *STSConnectionManager) Get(key string) *aws.Auth

func (*STSConnectionManager) GetRoleAuth

func (m *STSConnectionManager) GetRoleAuth(roleArn string, renew bool) (*aws.Auth, error)

GetRoleAuth - Returns an (existing) authentication token for assuming an STS role

roleArn - the requested role ARN (example: arn:aws:iam::11111111111:role/myrole )
renew - explicitely request session renewing

Returns aws.Auth object that can be used with any of the existing goamz APIs

func (*STSConnectionManager) Set

func (m *STSConnectionManager) Set(key string, auth *aws.Auth)

Jump to

Keyboard shortcuts

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