LoginSignup
4
1

More than 5 years have passed since last update.

AWS Lambdaが実行されているリージョンを取得する

Last updated at Posted at 2017-05-25

AWS_DEFAULT_REGIONという環境変数にリージョンが設定されいるので、お使いの言語で環境変数にアクセスすれば取得できます。
pythonだと以下のようになります。

import os
def lambda_handler(event, context):
    print "REGION:" + os.getenv("AWS_DEFAULT_REGION")

その他使用できる環境変数はこちらから確認できます。

4
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
1