title: How to send messages from aiohttp service to SQS-queue?
body: <p>I need to send messages to SQS queue from aiohttp service.
  I read documentation of <a href="https://aiobotocore.readthedocs.io/en/latest/examples.html" rel="nofollow noreferrer">aiobotocore</a> and all examples, but I don`t see anything how to send messages same as postgres from aipg for <a href="https://aiohttp.readthedocs.io/en/stable/web_advanced.html#cleanup-context" rel="nofollow noreferrer">example</a>.</p>
  
  <pre><code>async def pg_engine(app):
      app['pg_engine'] = await create_engine(
          user='postgre',
          database='postgre',
          host='localhost',
          port=5432,
          password=''
      )
      yield
      app['pg_engine'].close()
      await app['pg_engine'].wait_closed()
  
  app.cleanup_ctx.append(pg_engine)
  </code></pre>
  
  <p><strong>UPD</strong>
  The solution is </p>
  
  <pre><code>async def sqs_client(app):
      session = get_session(loop=app.loop)
      app['sqs'] = session.create_client('sqs',
                                         endpoint_url=SQS_QUEUE_URL,
                                         region_name=SQS_REGION)
      yield
      # close connection after finish
      await app['sqs'].close()
  
  app.cleanup_ctx.append(sqs_client)
  </code></pre>