title: Async connection to AWS elasticsearch
body: <p>I am struggling to connect to AWS elasticsearch with async connection.</p>
  <p>Regular sync connection works fine:</p>
  <pre><code>from requests_aws4auth import AWS4Auth
  from elasticsearch import Elasticsearch, RequestsHttpConnection
  
  AWS_ACCESS_KEY_ID = &quot;&lt;id&gt;&quot;
  AWS_SECRET_ACCESS_KEY = &quot;&lt;key&gt;&quot;
  AWS_REGION = &quot;us-east-1&quot;
  awsauth = AWS4Auth(AWS_ACCESS_KEY_ID,
                     AWS_SECRET_ACCESS_KEY,
                     AWS_REGION, 'es')
  
  
  es = Elasticsearch(
          ['https://url-to-elastic-in-aws/'],
          http_auth=awsauth,
          use_ssl=True,
          verify_certs=True,
          connection_class=RequestsHttpConnection
      )
  
  print(await es.info())
  </code></pre>
  <p>But async connection with connection_class=RequestsHttpConnection or connection_class=RequestsHttpConnection throw an exception</p>
  <pre><code>from requests_aws4auth import AWS4Auth
  from elasticsearch import AsyncElasticsearch, AIOHttpConnection
  
  AWS_ACCESS_KEY_ID = &quot;&lt;id&gt;&quot; 
  AWS_SECRET_ACCESS_KEY = &quot;&lt;key&gt;&quot; 
  AWS_REGION = &quot;us-east-1&quot; 
  awsauth = AWS4Auth(AWS_ACCESS_KEY_ID,
                     AWS_SECRET_ACCESS_KEY,
                     AWS_REGION, 'es')
  
  
  es = AsyncElasticsearch(
          ['https://url-to-elastic-in-aws/'],
          http_auth=awsauth,
          use_ssl=True,
          verify_certs=True,
          connection_class=AIOHttpConnection
      )
  
  print(await es.info())
  </code></pre>
  <p>It is either: TypeError: object tuple can't be used in 'await' expression
  it connection_class=RequestsHttpConnection</p>
  <p>or</p>
  <p>AttributeError: 'AWS4Auth' object has no attribute 'encode'</p>
  <p>I search the Internet and could not find a solution for this. Is there any way to connect to AWS elasticsearch with AsyncElasticsearch class.</p>