func()

in aws.go [255:286]


func (c *AWSConfig) GetProfile(profileName string) (*ProfileConfiguration, error) {
	section, err := c.profileIniSection(profileName)
	if err != nil {
		return nil, err
	}

	profileConfig := &ProfileConfiguration{}

	if key := section.Key("expiration"); key != nil {
		if value, err := key.TimeFormat(time.RFC3339); err == nil {
			profileConfig.Expires = value
		}
	}

	if key := section.Key("mfa_serial"); key != nil {
		profileConfig.MFASerial = key.String()
	}

	if key := section.Key("source_profile"); key != nil {
		profileConfig.SourceProfile = key.String()
	}

	if key := section.Key("role_arn"); key != nil {
		profileConfig.RoleARN = key.String()
	}

	if key := section.Key("role_session_name"); key != nil {
		profileConfig.RoleSessionName = key.String()
	}

	return profileConfig, nil
}