7

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
  • 7,841
  • 12
  • 40
  • 77
Alex
  • 4,512
  • 6
  • 27
  • 47

1 Answers1

10

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,807
  • 1
  • 21
  • 53