Using Python to Connect To Elastic Cloud

Greetings Everyone!

I am building a project for University and want to do some experimenting with connecting to Elastic Cloud using Python ...

I already have Elastic Cloud and Kibana set up and it's working perfectly well and ingesting data from a couple of different servers I'm running ...

I am having a hard time finding documentation that outlines the steps you need to take in order to create whatever certificates you need to connect securely from Python code and then, I think, you need to upload those to the cloud platform and install them locally as well on the machine you'll be connecting "from" ...

Not looking for someone to "hand hold" but perhaps kick me in the right direction for where to find some good documentation on what needs to be done to make this connection!

I appreciate any and all advice/direction I can get! Thanks so much!

The Elastic Cloud Elasticsearch service does not require any certificates to be set up. You can connect directly using HTTPS and basic auth.

Thank you very kindly for your response ... that's exactly what I needed ... I was spinning my wheels and going off of, what I was think is, old documentation located here:

I was trying to follow it and it just wasn't making sense!

I tried connecting with the following format:

es = Elasticsearch(['https://user:secret@localhost:9243'])

When trying to connect this way I still got the error message as follows:

elasticsearch.exceptions.ImproperlyConfigured: Root certificates are missing for certificate validation. Either pass them in using the ca_certs parameter or install certifi to use it automatically.

That is related to Elastic Cloud Enterprise which is a completely different product that allows you to manage multiple clusters.

Oh my .... no wonder I was confused and turned around!

I am new to the Elastic stack but learning at a rapid pace ...

Now I know! :slight_smile: I appreciate you taking the time to answer my questions...


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