Fargate Environment Variables
Stephen3443 opened this issue · comments
Documentation outlining the environment variables available within a Fargate hosted environment that are preset by AWS. For example, there is the following page for Lambda:
Three years later and this is still a problem. In case it's useful to anyone, below is the list of environment variables set by Fargate at the time of this comment. (Up to you to decide if you want to rely on them though as they're not [all] documented!)
var | comment |
---|---|
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI |
mentioned here: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html#task-iam-role-considerations |
AWS_DEFAULT_REGION |
|
AWS_EXECUTION_ENV |
Stack Overflow says the values are AWS_ECS_EC2 for EC2 launch type and AWS_ECS_FARGATE for Fargate. I can confirm the latter. |
AWS_REGION |
|
ECS_CONTAINER_METADATA_URI |
mentioned here: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-metadata-endpoint-v3.html |
ECS_CONTAINER_METADATA_URI_V4 |
mentioned here: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-metadata-endpoint-v4.html |
Closing this issue or pull request in advance of archiving this repo. For more information about the decision to archive this repo (and others in the 'awsdocs' org), see the announcement on the AWS News Blog.