# Connecting to Elasticsearch cluster in cloud from Django using connections.create\_connection API

**URL:** <https://discuss.elastic.co/t/connecting-to-elasticsearch-cluster-in-cloud-from-django-using-connections-create-connection-api/104650>\
**Category:** Elasticsearch\
**Created:** [October 20, 2017, 5:14am UTC](https://discuss.elastic.co/t/connecting-to-elasticsearch-cluster-in-cloud-from-django-using-connections-create-connection-api/104650 "2017-10-20T05:14:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shethsaam](https://avatars.discourse-cdn.com/v4/letter/s/f1d935/32.png) [@shethsaam](https://discuss.elastic.co/u/shethsaam)\
**Post date:** [October 20, 2017, 5:14am UTC](https://discuss.elastic.co/t/connecting-to-elasticsearch-cluster-in-cloud-from-django-using-connections-create-connection-api/104650/1 "2017-10-20T05:14:51Z")

</div>

I am working on connecting Django to Elastic Search cluster held in cloud. To do so I am using the connections.create\_connection API. I am able to connect to my local ElasticSearch cluster using: connections.create\_connection(host= 'localhost', http\_auth=('user', 'password')) but when I try connecting to cluster in the cloud using: connections.create\_connection(host= 'https://xxxxxxxxxxxxxxxxx.us-west-1.aws.found.io:9xxx',http\_auth=('user', 'lpassword')) , I am getting error:  
elasticsearch.exceptions.ConnectionError: ConnectionError(\<urllib3.connection.HTTPConnection object at 0x03xxxxx\>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed) caused by: NewConnectionError(\<urllib3.connection.HTTPConnection object at 0x03Exxxxx\>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed). Would appreciate if anyone can help me with the error and connecting to the cluster in the cloud.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 17, 2017, 5:15am UTC](https://discuss.elastic.co/t/connecting-to-elasticsearch-cluster-in-cloud-from-django-using-connections-create-connection-api/104650/2 "2017-11-17T05:15:00Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
