8

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?

kenorb
  • 8,011
  • 14
  • 43
  • 80
Alex
  • 4,612
  • 6
  • 29
  • 49

1 Answers1

11

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.

Jiri Klouda
  • 5,867
  • 1
  • 22
  • 54