I currently have a lambda that reads from my DynamoDB and S3, where I pass in us-east-1 as the region. I am now deploying a backup region as well, but I am not sure how to make the region variable in my lambda based on whether it's in the default region or warm/backup region. Is there a way to detect what region my lambda is running on, whether in Terraform where I have my lambda set up or anywhere else?
Asked
Active
Viewed 896 times
1 Answers
1
Out of the box, Lambda functions have access to various environment variables, including:
- AWS_REGION
- AWS_LAMBDA_FUNCTION_NAME
- AWS_LAMBDA_LOG_GROUP_NAME
- AWS_LAMBDA_LOG_STREAM_NAME

jarmod
- 71,565
- 16
- 115
- 122
-
Thanks a lot! I tried looking up the same for Glue and my UI (S3, Route53, Cloudfront) but couldn't find environment variables besides default region. When I tried using the same way of retrieving the region variable on Glue as the Lambda docs, it didn't work. Any recs? – bnykpp Oct 27 '21 at 22:04
-
Ideas [here](https://stackoverflow.com/a/52149901/271415) for Glue ETL scripts. Not sure what you're referring to when you say UI. – jarmod Oct 27 '21 at 22:13