javaamazon-web-servicesaws-fargate

How can we determine the current region with AWS Fargate


I have a Java application running on AWS Fargate. Regions.getCurrentRegion() returns null from within an AWS Fargate for security reasons

Is there an alternative way to determine which region the fargate container is running in?


Solution

  • In Fargate, the current region is available via the AWS_REGION environment variable.