Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrCredentialNotFound = errors.New("No rotatable credential found. You may need to run aws configure")
ErrCredentialNotFound means no credential existed that can be rotated by cloudkey.
var ErrUnknownSource = errors.New("Unknown source in profile")
ErrUnknownSource is for a source not configured in our AWS cloud provider
var ErrUnsupportedIdentityType = errors.New("Unsupported Identity Type--only supports user type")
ErrUnsupportedIdentityType is for any IAM resource that's not a user
Functions ¶
This section is empty.
Types ¶
type Credential ¶
type Credential struct { AccessKeyID string `mapstructure:"aws_access_key_id"` SecretAccessKey string `mapstructure:"aws_secret_access_key"` SessionToken string `mapstructure:"aws_session_token"` }
Credential is an AWS credential from the credentials file
func FromAccessKey ¶
func FromAccessKey(key iam.AccessKey) (Credential, error)
FromAccessKey converts an iam.AccessKey to a Credential
type Profile ¶
type Profile struct { Name string Cloud string Cred Credential // config Config Source string IsCurrent bool sts.GetCallerIdentityOutput Session *session.Session STS stsiface.STSAPI IAM iamiface.IAMAPI }
Profile is a local profile containing the credential and configuration.
func FromEnviron ¶
FromEnviron gets a profile from the credential environment variables
func (*Profile) NewIAM ¶
func (p *Profile) NewIAM()
NewIAM creates a new IAM client from the current session
func (*Profile) NewSTS ¶
func (p *Profile) NewSTS()
NewSTS creates a new STS client from the current session
func (*Profile) UpdateCredential ¶
func (p *Profile) UpdateCredential(cred Credential) error
UpdateCredential locally updates the credential based on the profile type
type Profiles ¶
type Profiles struct {
Profiles []Profile
}
Profiles is a collection of Profile
func FromConfigFile ¶
FromConfigFile gets a list of profiles from the configuration file (default path/file is ~/.aws/credentials)
func (*Profiles) WriteConfig ¶
WriteConfig writes the profiles to the default config file
func (*Profiles) WriteConfigAs ¶
WriteConfigAs writes the profiles to the config filename specified