I've got an Amazon ElasticSearch Service running and I can connect fine using a curl/postman, but when I try to create a elasticsearch-py instance my ide hangs indefinitely.
endpoints = ['http://XXX.us-east-1.es.amazonaws.com',
'http://XXX.us-east-1.es.amazonaws.com:443',
'http://XXX.us-east-1.es.amazonaws.com:9200']
for endpoint in endpoints:
try:
es = Elasticsearch(endpoint)
print es.count('analytics_v4')
except Exception, e:
print e
print endpoint + " didn't work"
This is my current test set up, my IDE (pycharm) completely stops at this point and I need to end the run to be able to try again, I've tried each endpoint individually and none of them work.
My access policy is :
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "es:*",
"Resource": "arn:aws:es:us-east-1:MYIDdomain/analytics/*",
"Condition": {
"IpAddress": {
"aws:SourceIp": [
"MYIP"
]
}
}
}
]
}
I'm getting an error for :433 of :
ConnectionError(HTTPConnectionPool(host='MYID.us-east-1.es.amazonaws.com', port=443): Max retries exceeded with url: /analytics_v4/_count (Caused by <class 'httplib.BadStatusLine'>: '')) caused by: MaxRetryError(HTTPConnectionPool(host='MYID.us-east-1.es.amazonaws.com', port=443): Max retries exceeded with url: /analytics_v4/_count (Caused by <class 'httplib.BadStatusLine'>: ''))
Elasticsearch([endpoint])and not just the endpoint...Elasticsearch(endpoint)?