Added docs about AWS using IAM

This commit is contained in:
Honza Král
2015-12-27 16:11:15 -05:00
parent 6b579342a1
commit a7a56b1abd
+23
View File
@@ -222,6 +222,29 @@ bodies via post::
from elasticsearch import Elasticsearch
es = Elasticsearch(send_get_body_as='POST')
Running with AWS Elasticsearc service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you want to use this client with IAM based authentication on AWS you can use
the `requests-aws4auth`_ package::
from elasticsearch import Elasticsearch, RequestsHttpConnection
from requests_aws4auth import AWS4Auth
host = 'YOURHOST.us-east-1.es.amazonaws.com'
awsauth = AWS4Auth(YOUR_ACCESS_KEY, YOUR_SECRET_KEY, REGION, 'es')
es = Elasticsearch(
hosts=[{'host': host, 'port': 443}],
http_auth=awsauth,
use_ssl=True,
verify_certs=True,
connection_class=RequestsHttpConnection
)
print(es.info())
.. _requests-aws4auth: https://pypi.python.org/pypi/requests-aws4auth
Contents
--------