// GetAwsSessWithProfile returns a pointer to profile that has got creds from aws profile.
// It also returns an error if there was any.
GetAwsSessWithProfile returns a pointer to profile that has got creds from aws profile.
It also returns an error if there was any.
// GetAwsSessWithProfile returns a pointer to profile that has got creds from aws profile . // It also returns an error if there was any .
func GetAwsSessWithProfile(profile string) (*session.Session, error) {
	sessPtr := createSession(session.Options{Profile: profile})
	if _, err := sessPtr.Config.Credentials.Get(); err != nil {
		return nil, fmt.Errorf("AWSProfileDoesNotExist: Failed To Retrieve Credentials From AWS Profile '%s'", profile)
	}
	svc := sts.New(sessPtr)
	if ok := IsCredsExpired(svc); ok {
		return nil, fmt.Errorf("AwsProfileCredsExpired: AWS Profile '%s's Credentials Have Expired", profile)
	}
	return sessPtr, nil
}
func GetAwsSessWithProfile ( profile string ) ( * session . Session , error ) { sessPtr := createSession ( session . Options { Profile : profile } ) if _ , err := sessPtr . Config . Credentials . Get ( ) ; err != nil { return nil , fmt . Errorf ( " " , profile ) } svc := sts . New ( sessPtr ) if ok := IsCredsExpired ( svc ) ; ok { return nil , fmt . Errorf ( " " , profile ) } return sessPtr , nil }
GetAwsSessWithProfile returns a pointer to profile that has got creds from aws profile.
GetAwsSessWithProfile returns a pointer to profile that has got creds from aws profile .