How to Get Lambda Runtime Region via Python

To get the AWS Region where your Lambda Function is running you will need to import the os module.

import os

Then from the os module, you need to get the value of AWS_REGION from the environ mapping variable. This will return the AWS Region where the Lambda Function is running.

runtime_region = os.environ['AWS_REGION']

Note: The way of getting the Runtime AWS Region of your Lambda Function is the same as when you get a Lambda Environment Variable.

Continue reading How to Get Lambda Runtime Region via Python

How to get the AWS Region where Node.js Lambda Function is running

To get the AWS Region where your Lambda Function is running we need to access the Environment Variable AWS_REGION.

To access the environment variable AWS_REGION using Node.js Lambda Function we can use process.env.AWS_REGION.

Continue reading How to get the AWS Region where Node.js Lambda Function is running

How to get the Region of a Running AWS Lambda Function using Ruby

If you need to get the Region of your running Lambda Function then you should look for the AWS_REGION in the Environment Variables.

Below is the code on how to access the AWS_REGION Environment Variable using Ruby.

aws_region = ENV['AWS_REGION']
Continue reading How to get the Region of a Running AWS Lambda Function using Ruby