// GetAwsSession returns a session pointer based on given credential provider.
// It also returns an error if there was any.
GetAwsSession returns a session pointer based on given credential provider.
It also returns an error if there was any.
// GetAwsSession returns a session pointer based on given credential provider . // It also returns an error if there was any .
func GetAwsSession(credProviderInfo map[string]string) (*session.Session, error) {
	switch credProviderInfo["getCredsUsing"] {
	case "profile":
		clogger.Debugf("Will Get Creds Using AWS Profile: '%s'", credProviderInfo["profile"])
		return GetAwsSessWithProfile(credProviderInfo["profile"])
	case "roleArn":
		clogger.Debugf("Will Get Creds By Assuming AWS IAM Role: '%s'", credProviderInfo["roleArn"])
		return GetAwsSessWithAssumeRole(credProviderInfo["roleArn"])
	default:
		credLoadOrder := `
	 * Environment Variables
	 * Shared Credentials file
	 * Shared Configuration file
	 * EC2 Instance Metadata (credentials only)`
		clogger.Debugf("Will Attempt To Load Creds Using One Of the Providers Found In Following Order: %s", credLoadOrder)
		return GetAwsSessWithDefaultCreds()
	}
}
func GetAwsSession ( credProviderInfo map [ string ] string ) ( * session . Session , error ) { switch credProviderInfo [ " " ] { case " " : clogger . Debugf ( " " , credProviderInfo [ " " ] ) return GetAwsSessWithProfile ( credProviderInfo [ " " ] ) case " " : clogger . Debugf ( " " , credProviderInfo [ " " ] ) return GetAwsSessWithAssumeRole ( credProviderInfo [ " " ] ) default : credLoadOrder := `
	 * Environment Variables
	 * Shared Credentials file
	 * Shared Configuration file
	 * EC2 Instance Metadata (credentials only)` clogger . Debugf ( " " , credLoadOrder ) return GetAwsSessWithDefaultCreds ( ) } }
GetAwsSession returns a session pointer based on given credential provider.
GetAwsSession returns a session pointer based on given credential provider .