I have an Elasticsearch instance, hosted on AWS. I can connect from my terminal with Curl. I am now trying to use the python elasticsearch wrapper. I have:
from
host = 'ec2-xx-xx-xxx-xxx.us-west-2.compute.amazonaws.com' #without 'https'
YOUR_ACCESS_KEY = ''
YOUR_SECRET_KEY = ''
REGION = 'us-west-2' #change to your region
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())