Kibana docker trying to connect to default ( ignoring env ELASTICSEARCH_URL )

I am desperately trying to connect a docker Kibana instance to my AWS ES. When I try to provide and environment variable in docker-compose with the elasticsearch_url but docker defaults to the url provided with the image ( http://elasticsearch:9200 )

I am getting this error. {"type":"log","@timestamp":"2019-06-12T16:24:27Z","tags":["warning","elasticsearch","admin"],"pid":1,"message":"Unable to revive connection: http://elasticsearch:9200/"}

version: '3'
services:
  kibana:
    image: docker.elastic.co/kibana/kibana-oss:6.7.0
    ports:
      - "5601:5601"
    volumes:
      - ./kibana.yml:/usr/share/kibana/config/kibana.yml
    environment:
        ELASTICSEARCH_URL: http://domain_name.eu-west- 
2.es.amazonaws.com:80
             KIBANA_INDEX: .kibana-5
             SERVER_PORT: 5601

Have you followed the instructions at https://www.elastic.co/guide/en/kibana/current/docker.html? ELASTICSEARCH_URL is not an expected configuration. You must specify elasticsearch.hosts so kibana knows how to connect to elasticsearch

Hi Nathan,

It seems like ELASTICSEARCH_HOSTS seems to attempt to connect to AWS ES. However I am facing the same issue as before with authorisation issue with AWS ES from a container. User: anonymous is not authorized to perform: es:ESHttpPut. Please find the full error report here I could not find much information on AWS documentation on how to connect an external Kibana instance. If anyone has done it before I would greatly appreciate that. I have allowed the docker host ip on access policy for the AWS ES which in theory should permit the authorisation.

Many thanks,
Merril.