func New(cfgs ...*aws.Config) *Session {
	envCfg := loadEnvConfig()
	if envCfg.EnableSharedConfig {
		var cfg aws.Config
		cfg.MergeIn(cfgs...)
		s, err := NewSessionWithOptions(Options{
			Config:            cfg,
			SharedConfigState: SharedConfigEnable,
		})
		if err != nil {
			msg := "failed to create session with AWS_SDK_LOAD_CONFIG enabled. " +
				"Use session.NewSession to handle errors occurring during session creation."
			s = &Session{Config: defaults.Config()}
			s.Config.MergeIn(cfgs...)
			s.Config.Logger.Log("ERROR:", msg, "Error:", err)
			s.Handlers.Validate.PushBack(func(r *request.Request) {
				r.Error = err
			})
		}
		return s
	}
	return deprecatedNewSession(cfgs...)
}
New creates a new instance of the handlers merging in the provided configs
on top of the SDK's default configurations. Once the Session is created it
can be mutated to modify the Config or Handlers. The Session is safe to be
read concurrently, but it should not be written to concurrently.

If the AWS_SDK_LOAD_CONFIG environment is set to a truthy value, the New
method could now encounter an error when loading the configuration. When
The environment variable is set, and an error occurs, New will return a
session that will fail all requests reporting the error that occurred while
loading the session. Use NewSession to get the error when creating the
session.

If the AWS_SDK_LOAD_CONFIG environment variable is set to a truthy value
the shared config file (~/.aws/config) will also be loaded, in addition to
the shared credentials file (~/.aws/credentials). Values set in both the
shared config, and shared credentials will be taken from the shared
credentials file.

Deprecated: Use NewSession functions to create sessions instead. NewSession
has the same functionality as New except an error can be returned when the
func is called instead of waiting to receive an error until a request is made.
package session
import (
	"crypto/tls"
	"crypto/x509"
	"fmt"
	"io"
	"io/ioutil"
	"net/http"
	"os"
	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/client"
	"github.com/aws/aws-sdk-go/aws/corehandlers"
	"github.com/aws/aws-sdk-go/aws/credentials"
	"github.com/aws/aws-sdk-go/aws/credentials/stscreds"
	"github.com/aws/aws-sdk-go/aws/defaults"
	"github.com/aws/aws-sdk-go/aws/endpoints"
	"github.com/aws/aws-sdk-go/aws/request"
)
type Session struct {
	Config   *aws.Config
	Handlers request.Handlers
}