Created
April 13, 2021 17:29
-
-
Save kepstein/1033da2185461b9f07df11a97ad879bb to your computer and use it in GitHub Desktop.
Get AWS Account ID with Lambda
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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