code: func NewECSClient(
  	credentialProvider *credentials.Credentials,
  	config *config.Config,
  	ec2MetadataClient ec2.EC2MetadataClient) api.ECSClient {
  
  	var ecsConfig aws.Config
  	ecsConfig.Credentials = credentialProvider
  	ecsConfig.Region = &config.AWSRegion
  	ecsConfig.HTTPClient = httpclient.New(roundtripTimeout, config.AcceptInsecureCert)
  	if config.APIEndpoint != "" {
  		ecsConfig.Endpoint = &config.APIEndpoint
  	}
  	standardClient := ecs.New(session.New(&ecsConfig))
  	submitStateChangeClient := newSubmitStateChangeClient(&ecsConfig)
  	pollEndpoinCache := async.NewLRUCache(pollEndpointCacheSize, pollEndpointCacheTTL)
  	return &APIECSClient{
  		credentialProvider:      credentialProvider,
  		config:                  config,
  		standardClient:          standardClient,
  		submitStateChangeClient: submitStateChangeClient,
  		ec2metadata:             ec2MetadataClient,
  		pollEndpoinCache:        pollEndpoinCache,
  	}
  }
docs: // NewECSClient creates a new ECSClient interface object