How to get environment variables in ECS container?

11,473

Environment variables are defined inside the container and some are passed in the task definition. So you can use describe-task-definition to see the extra variables.

To get the default environment of the container image, you can register-task-definition for task with command 'env' and the specific container image for which you want to find out and then run-task this task.

Share:
11,473

Related videos on Youtube

Alex
Author by

Alex

Updated on September 18, 2022

Comments

  • Alex
    Alex over 1 year

    What AWS CLI command should I be using to access the environment variables in an AWS ECS cluster's task's container?

    I've seen describe-cluster, list-tasks, describe-tasks, describe-container-instances, etc... I can't seem to find one that lets me look at environment variables.

    Is this doable via the AWS CLI?