aws

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RemoveProfile added in v0.2.0

func RemoveProfile(profile string, config, credentials *ini.File, configFile, credentialsFile string) error

RemoveProfile will remove the profile section from each AWS config and credentials file (if possible).

Types

type Profile

type Profile struct {
	Name                     string `ini:"-"`
	AccessKeyID              string `ini:"aws_access_key_id,omitempty"`
	SecretAccessKey          string `ini:"aws_secret_access_key,omitempty"`
	SessionToken             string `ini:"aws_session_token,omitempty"`
	MFASerial                string `ini:"mfa_serial,omitempty"`
	Region                   string `ini:"region,omitempty"`
	AuthenticationExpiration string `ini:"authentication_expiration,omitempty"`
}

Profile represents a structure that includes authentication fields necessary to authenticate with AWS.

func Authenticate

func Authenticate(duration int64, serialNumber, token string) (Profile, error)

Authenticate will establish a set of temporary AWS credentials for the specific duration. The serialNumber and token are linked to the MFA device that is connected to the AWS profile/account.

func NewProfile

func NewProfile(profile, region, serialNumber, accessKeyID, secretAccessKey string) (Profile, error)

NewProfile will return a new profile based on parameters that are passed in.

func ReadConfigFile

func ReadConfigFile(filename string) ([]Profile, error)

ReadConfigFile will read the specific filename and parse the file specifically for AWS config file formats and return a list of Profiles.

func (Profile) Save

func (p Profile) Save(config, credentials *ini.File, configFile, credentialsFile string) error

Save will persist the Profile's information to their respective places.

Jump to

Keyboard shortcuts

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