Documentation ¶
Index ¶
- func FindDefaultCfgFileLocation() string
- type Account
- func (a *Account) CreateSession() *session.Session
- func (a *Account) GetCurrentUserName(s *session.Session) *string
- func (a *Account) GetMFADeviceSerial(s *session.Session)
- func (a *Account) GetTempCredentials(s *session.Session, mfaSerial *string, durationSeconds int64, passCode string)
- func (a *Account) Print(format string)
- func (a *Account) PrintAccount(format string)
- func (a *Account) PrintAws()
- func (a *Account) PrintAwsRegion()
- func (a *Account) PrintDebug()
- func (a *Account) PrintEnv()
- func (a *Account) PrintMFAdAccount(format string)
- func (a *Account) PrintMFAdAws()
- func (a *Account) PrintMFAdAwsRegion()
- func (a *Account) PrintMFAdEnv()
- func (a *Account) SprintAws() string
- func (a *Account) SprintAwsRegion() string
- func (a *Account) SprintEnv() string
- func (a *Account) SprintMFAdAws() string
- func (a *Account) SprintMFAdAwsRegion() string
- func (a *Account) SprintMFAdEnv() string
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindDefaultCfgFileLocation ¶
func FindDefaultCfgFileLocation() string
FindDefaultCfgFileLocation determines default config location
Types ¶
type Account ¶
type Account struct { Name string `yaml:"name"` Region string `yaml:"region"` AccessKey string `yaml:"accessKey"` SecretKey string `yaml:"secretKey"` Expiration time.Time SessionToken string MFASerial string }
Account is aws account abstract object definition
func (*Account) CreateSession ¶
CreateSession creates new AWS session
func (*Account) GetCurrentUserName ¶
GetCurrentUserName determines current aws UserName
func (*Account) GetMFADeviceSerial ¶
GetMFADeviceSerial tries to get serial number of mfa device if configured
func (*Account) GetTempCredentials ¶
func (a *Account) GetTempCredentials(s *session.Session, mfaSerial *string, durationSeconds int64, passCode string)
GetTempCredentials gets temporary credentials for aws account and modifies its fields accordingly
func (*Account) Print ¶
Print outputs Account information in pretty formats It automatically detects wether Account is already MFAd or not Use this until more specific printing is required
func (*Account) PrintAccount ¶
PrintAccount outputs Account information in non-MFAd formats
func (*Account) PrintAws ¶
func (a *Account) PrintAws()
PrintAws prints Account in non-MFAd aws format for aws config file
func (*Account) PrintAwsRegion ¶
func (a *Account) PrintAwsRegion()
PrintAwsRegion prints Account in non-MFAd aws format for aws config file
func (*Account) PrintDebug ¶
func (a *Account) PrintDebug()
PrintDebug print Account in debug mode (struct)
func (*Account) PrintEnv ¶
func (a *Account) PrintEnv()
PrintEnv prints Account in non-MFAd env format
func (*Account) PrintMFAdAccount ¶
PrintMFAdAccount outputs Account information in MFAd formats
func (*Account) PrintMFAdAws ¶
func (a *Account) PrintMFAdAws()
PrintMFAdAws prints Account in MFAd aws format for aws credentials file
func (*Account) PrintMFAdAwsRegion ¶
func (a *Account) PrintMFAdAwsRegion()
PrintMFAdAwsRegion prints Account in MFAd aws format for aws config file
func (*Account) PrintMFAdEnv ¶
func (a *Account) PrintMFAdEnv()
PrintMFAdEnv prints Account in MFAd env format
func (*Account) SprintAws ¶
SprintAws string prints Account in non-MFAd aws format for aws config file
func (*Account) SprintAwsRegion ¶
SprintAwsRegion string prints Account in non-MFAd aws format for aws config file
func (*Account) SprintMFAdAws ¶
SprintMFAdAws string prints Account in MFAd aws format for aws credentials file
func (*Account) SprintMFAdAwsRegion ¶
SprintMFAdAwsRegion string prints Account in MFAd aws format for aws config file
func (*Account) SprintMFAdEnv ¶
SprintMFAdEnv string prints Account in MFAd env format
type Config ¶
type Config struct {
Accounts []Account
}
Config describes tool configuration
func ReadCfgFile ¶
ReadCfgFile reads config file and yaml unmarshals its content
func (*Config) CheckIfAccountExists ¶
CheckIfAccountExists checks if any account exists in config file and returns error value