Posted On: May 18, 2020
Amazon Elastic Container Service (ECS) now supports environment files to store environment variables for containers using the EC2 Launch type. This simplifies configuration of environment variables by editing or referencing centrally located files, instead of manual edits to environment variables as key value pairs across all your containers.
Large scale applications consisting of different types of containers need extensive configuration to ensure their workloads run as expected. This is especially important after the build and test phases and when moving the workload across environments e.g. from test to production. Environment files store environment variables in one to a few files hosted on Amazon S3. You no longer need to maintain hard coded variables in task definitions which is error prone and not scalable for large scale applications.
Environment files are available for ECS containers using the EC2 launch type in all ECS regions. To get started with environment files, see the instructions in the ECS documentation.