Skip to content

Instantly share code, notes, and snippets.

@kepstein
Created April 13, 2021 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kepstein/1033da2185461b9f07df11a97ad879bb to your computer and use it in GitHub Desktop.
Save kepstein/1033da2185461b9f07df11a97ad879bb to your computer and use it in GitHub Desktop.
Get AWS Account ID with Lambda
# https://www.radishlogic.com/aws/lambda/how-to-get-the-aws-account-id-in-lambda-python/
def lambda_handler(event, context):
aws_account_id = context.invoked_function_arn.split(":")[4]
print(aws_account_id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment