Amazon ECS environment variables - Amazon Elastic Container Service
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Amazon ECS environment variables

Environment variables control a task's behavior such as the capacity used to run the task. Amazon ECS sets the following environment variables for your tasks:

  • AWS_CONTAINER_CREDENTIALS_RELATIVE_URI - The full HTTP URL endpoint for the SDK to use when making a request for credentials. This includes both the scheme and the host. For more information, see Container credential provider in the Amazon SDKs Reference Guide.

  • ECS_CONTAINER_METADATA_URI_V4 - The address of the task metadata version 4. For more information, see Amazon ECS task metadata endpoint version 4.

  • ECS_CONTAINER_METADATA_URI - The address of the task metadata version 3. For more information, see Amazon ECS task metadata endpoint version 3.

  • ECS_AGENT_URI - The base address for different endpoints supported by Fargate. For more information, see:

  • AWS_EXECUTION_ENV - The information about the compute option the task runs on.

    • For Fargate, Amazon ECS sets this to AWS_ECS_FARGATE.

    • For EC2, Amazon ECS sets this to AWS_ECS_EC2.

  • AWS_DEFAULT_REGION – The default Amazon Web Services Region for your Amazon Web Services account. This is the default Region where your task runs.

  • AWS_REGION – The Region where the task runs. If defined, this value overrides the AWS_DEFAULT_REGION.

You can view the environment variables in the task metadata. For more information, see one of the following topics: