AWS Elasticsearch and CORS

I am testing the AWS Elasticsearch service:

https://aws.amazon.com/elasticsearch-service/

Very easy to set up. Basically just hit the deployment. Unfortunately, I cannot connect to the Elasticsearch GUI (ElasticHQ, Elasticsearch Head), since CORS is not included in the AWS assembly, and there is no way to change the elasticsearch configuration or install plugins that I can see.

Does anyone know how to change these settings on AWS?

+5
source share
2 answers

My workaround, while remaining within the AWS ecosystem, was to create an API using an API gateway.

I created a new POST endpoint with the address of my elasticsearch instance, and then followed the following guide: CORS on the AWS API Gateway before adding CORS to this endpoint. This allowed my user interface to make requests from another domain.

+1
source

In case this is useful to anyone else, you can disable CORS for testing purposes using the Chrome plugin .

ElasticHQ and Elasticsearch Head will still not work properly with AWS Elasticsearch, although (at the time of writing), because they make calls to /_cluster/state , which is not currently one of the AWS ElasticSearch operations .

Disabling CORS and executing GET on /_cluster/state returns

 { Message: "Your request: '/_cluster/state' is not allowed." } 

Some functions still work in ElasticHQ, but I cannot get Elasticsearch Head to work.

0
source

Source: https://habr.com/ru/post/1234495/


All Articles