In AWS, I have an elasticache cluster with one redis node inside and a ECS cluster. I cannot figure out what whould be the better way to pass the redis endpoint url to my docker container.
Currently, in my task definition, I use an environment param named REDIS_ENDPOINT with my value. It worked well before.
But I'm converting our deployment process from all manual operations (with AWS UI) to Terraform. And now, the REDIS_ENDPOINT environment variable doesn't work so well anymore because the redis node will be created by terraform (dns will change potentially) and the env variable (part of the container definition) must be inside a static json file.
I read some documentation but I cannot find the proper way of doing that. Or may be I'm lost in AWS documentation.