the major problem with elasticsearch service is the access for developers.
There are two elasticsearch vpc's configuration:
-
public domain
-
private domain inner vpc
The second option is better because this reduce atack surface in all your cloud resources.
We can increment a proxy with Application load balancer and authenticate the access with Cognito.
This image create conteiner with configured proxy between public access and private domain.
version: "3"
services:
app:
image: xdevelsistemas/traefik-aws-es-proxy:stable
environment:
- EXTERNAL_DOMAIN=<YOUR-PUBLIC-DOMAIN>
- VPC_DOMAIN=<YOUR-VPC-DOMAIN>
restart: always
ports:
- "80:80"
- "8080:8080"
You can monitor with "traefik monitor" in 8080's port
More about authenticate AWS Load Balancer: