compwright/aws-elasticsearch-connector

Elastic Endpoints without `https://` doesn't work

madguy02 opened this issue · 2 comments

Here is a sample code that throws error without adding https:// at the beginning of the URL,

let esp = new es.Client({
    nodes: ['my-elastic-cluster.us-east-1.amazon.aws.com']
})

This above piece of code throws:

throw new ERR_INVALID_URL(input);
  ^
TypeError [ERR_INVALID_URL]: Invalid URL:my-elastic-cluster.us-east-1.amazon.aws.com 

Is there a way we can hit the endpoint without using https:// at the beginning of a url?

What is stopping you from specifying the protocol in front of the URL?

@avin-kavish this is resolved, but i wonder what exactly changed that we specifically need to specify https (otherwise it detects the URL to be invalid), earlier with elasticsearchJS this wasn't the case.

Its not exactly stopping from anything, but had to change a lot of configurations in serverless templates, hence wanted to ask this.