How to change env variables inside of docker container in AWS ECS
Illia Hryhoryshyn
Posted on May 13, 2021
For example we have cluster in AWS ECS with 3 services:
And we want to change evn variables in api-staging
service.
To do it we should create a new revision of task definition with updated env variables and then tell the service to use new task definition.
So, to create a new revision of task definition we should go to list of all revisions, select the last one and create a new revision.
To change the container evn variables we should go to container definitions section and edit our container:
Set new values to env variables and then update container and save new revision of Task Definition:
When we have a new revision we should update our api-staging
service and set the latest revision. Also don't forget to set force new deployment checkbox
Posted on May 13, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.