Skip to content

Radish Logic

Developer Blog

  • Home
  • About
  • Contact Us
  • Facebook
  • Twitter
  • Instagram

Recent Posts

  • How to set the default screen resolution for VNC Viewer when Raspberry Pi is not connected to a monitor
  • How to Fix Typing Wrong Keyboard Characters in Raspberry Pi
  • How to change the System Font and Icon Size of Raspberry Pi Desktop
  • How to change the Desktop Background of Raspberry Pi
  • How to Disable Screen Sleep in Raspberry Pi

Recent Comments

  • Gwen Creswick on How to connect Google Nest to Windows 11 as Speaker
  • Natasha on How to connect Logitech K380 Keyboard to Windows 11
  • Vincentwef on How to Fix Typing Wrong Keyboard Characters in Raspberry Pi
  • Chris Davis on How to Fix Typing Wrong Keyboard Characters in Raspberry Pi
  • Dmitry on How to reverse the F-Keys of Logitech K380 Keyboard

Categories

  • Adafruit
  • Amazon S3
  • Amazon Workspaces
  • Arduino
  • Atom Text Editor
  • AWS
  • AWS Certificate Manager
  • AWS CloudShell
  • AWS Cognito
  • AWS EC2
  • AWS IAM
  • AWS Lambda
  • boto3
  • CloudFormation
  • CloudFront
  • Electronics
  • IIS
  • Kubernetes
  • Linux
  • Photos
  • PostgreSQL
  • Projects
  • Python 3
  • Raspberry Pi
  • Route 53
  • Terraform
  • Tools
  • Ubuntu
  • Visual Studio Code
  • Windows
  • Wordpress

Tags

  • Active Directory
  • Amazon Web Services
  • Amazon Workspaces
  • Arduino
  • Arduino IDE
  • AWS
  • AWS Account ID
  • AWS Lambda
  • AWS Region
  • AWS S3
  • AWS Workspaces
  • Bluetooth
  • Bluetooth Keyboard
  • boto3
  • EC2
  • EC2 Instance
  • Environment Variables
  • IAM User
  • Installation
  • Javascript
  • K380
  • Keyboard
  • Lambda
  • Lambda Environment Variables
  • Logitech
  • microSD Card
  • Node.js
  • Python
  • Python 3
  • Raspberry Pi
  • Raspberry Pi OS
  • Region
  • Ruby
  • S3
  • S3 Bucket
  • SD Card
  • Ubuntu
  • Visual Studio Code
  • Windows
  • Windows 10
  • Windows 11
  • Windows Server
  • Windows Server 2016
  • Windows Server 2019
  • Workspaces

Tag: AWS Account ID

How to get the AWS Account ID in Lambda Python

There are use cases where the need to get the AWS Account ID of the Lambda Function during runtime is required. I thought it was easy as getting the AWS Region but it was not. Luckily there is a way to get it, use the step-by-step instructions below.

To get the AWS Account ID where the Lambda Function is running use the code below.

def lambda_handler(event, context):

    aws_account_id = context.invoked_function_arn.split(":")[4]

    print(aws_account_id)

How does the code work?

The context object that is being passed to the lambda_handler function provides different methods and properties about the lambda function, like invocation and execution environment.

Continue reading How to get the AWS Account ID in Lambda Python
Posted on November 21, 2023November 21, 2023Categories AWS LambdaTags AWS, AWS Account ID, AWS Lambda, Lambda1 Comment on How to get the AWS Account ID in Lambda Python

How to get the AWS Account ID in Lambda Node.js

To get the AWS Account ID of the currently running Lambda Function using Node.js use the code below.

exports.handler = async (event, context) => {
    
    const awsAccountId = context.invokedFunctionArn.split(':')[4]
    
    console.log(awsAccountId)
};
Continue reading How to get the AWS Account ID in Lambda Node.js
Posted on November 21, 2023November 21, 2023Categories AWS LambdaTags Amazon Web Services, AWS, AWS Account ID, AWS Lambda, Lambda, Node.jsLeave a comment on How to get the AWS Account ID in Lambda Node.js

How to get AWS Account ID in Lambda using Ruby

If you want to get the AWS Account ID of your Lambda Function while it is running then you can use the code below. The code below is written in Ruby.

Continue reading How to get AWS Account ID in Lambda using Ruby
Posted on November 21, 2023November 21, 2023Categories AWS, AWS LambdaTags Amazon Web Services, AWS Account ID, AWS Lambda, AWS Lambda Ruby, Lambda, RubyLeave a comment on How to get AWS Account ID in Lambda using Ruby
Proudly powered by WordPress