You need two things:

  1. IAM role or IAM user with permissions to call your lambda function in your code.
  2. To actually perform the calling action, using invoke method in boto3.

An alternative is to call your lambda function through an API Gateway. This does not require IAM roles or IAM user credentials for the caller. How to use lambda with API Gateway is shown in the following link:

  • Build an API Gateway REST API with Lambda integration
Answer from Marcin on Stack Overflow
🌐
Amazon Web Services
docs.aws.amazon.com › aws lambda › developer guide › aws lambda functions › programming languages › building lambda functions with python
Building Lambda functions with Python - AWS Lambda
Your code runs in an environment ... from an AWS Identity and Access Management (IAM) role that you manage. To learn more about the SDK versions included with the Python runtimes, see Runtime-included SDK versions. Lambda supports the following Python runtimes. ... Choose Create function...
Discussions

Call AWS lambda function from an existing lambda function on Python 2.7 - Stack Overflow
I'm trying to call another lambda function from an existing lambda fucntion as below (python 2.7) from __future__ import print_function import boto3 import json lambda_client = boto3.client('lamb... More on stackoverflow.com
🌐 stackoverflow.com
Calling a python function from an AWS lambda function - Stack Overflow
I am working on an AWS lambda function that calls python functions and prints what my python function prints. This is my python function named "template_utils.py" import json import More on stackoverflow.com
🌐 stackoverflow.com
amazon web services - Can an AWS Lambda function call another normal python function from a python file? - Stack Overflow
I have a python file that has a bunch of functions. For each function, I have to create a respective AWS lambda function so that the AWS Lambda function calls that normal function. Is there a way to More on stackoverflow.com
🌐 stackoverflow.com
How do I programmatically invoke a Lambda functin?
If you are using python, you can import the boto3 library and invoke a lambda from there. Check out the documentation here: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/lambda.html#Lambda.Client.invoke More on reddit.com
🌐 r/aws
13
1
October 10, 2019
🌐
Amazon Web Services
docs.aws.amazon.com › aws lambda › developer guide › aws lambda functions › programming languages › building lambda functions with python › define lambda function handler in python
Define Lambda function handler in Python - AWS Lambda
If you use the RequestResponse invocation type to invoke a Lambda function synchronously, Lambda returns the result of the Python function call to the client invoking the Lambda function (in the HTTP response to the invocation request, serialized into JSON). For example, AWS Lambda console ...
🌐
SentinelOne
sentinelone.com › blog › aws-lambda-with-python
AWS Lambda With Python: A Simple Introduction With Examples
April 13, 2024 - service: email-validator provider: name: aws runtime: python3.8 functions: main: handler: handler.validate events: - http: POST /email/validate · See those last two lines? That means we’ll create an API Gateway with a single endpoint. Whenever a HTTP call is made to that endpoint, AWS will route it through to our Lambda function.
🌐
TheServerSide
theserverside.com › blog › Coffee-Talk-Java-News-Stories-and-Opinions › create-python-aws-lambda-function-hello-world-tutorial-serverless-how-to-example
Create your first Python AWS Lambda function in minutes
Log into the AWS console and navigate to the Lambda dashboard. Click the orange Create Function button. Specify the function’s name and the Python version (Python 3.10 is recommended).
🌐
Stackify
stackify.com › aws-lambda-with-python-a-complete-getting-started-guide
AWS Lambda with Python: A Complete Getting Started Guide - Stackify
May 16, 2024 - Set this drop-down to the correct value of Python 3.7. Now go ahead and click the Create function button, which will bring you to the function configuration screen. This can be a bit overwhelming at first, but we’ll briefly cover a few of the essentials here. Also Read-https://stackify.com/aws-lambda-with-node-js-a-complete-getting-started-guide/
Find elsewhere
🌐
Stack Overflow
stackoverflow.com › questions › 65665342 › calling-a-python-function-from-an-aws-lambda-function
Calling a python function from an AWS lambda function - Stack Overflow
from jinja2 import Template from template_utils import create_aws_iam_policy_template import json def lambda_handler(event, context): template_data = {} region = event.get('region') instance_type = event.get('instance_type') ebs_volume_size = event.get('ebs_volume_size') print(template_json) ... What is template_json or what you think it should be in print(template_json)? Its not defined anywhere in your code. ... I have got an IAM policy and my python function prints "template_json" in a JSON format I want my lambda-handler to print that
🌐
SQL Shack
sqlshack.com › calling-an-aws-lambda-function-from-another-lambda-function
Calling an AWS Lambda function from another Lambda function
July 15, 2020 - I am calling this lambda function – “ParentFunction”. Choose the run time as Python 3.8 and assign the InvokeOtherLambdaRole role that we just created in the previous step. ... Let us now again head over to Visual Studio Code to write the code and then copy-paste it back to the lambda editor. Since we are going to use an AWS resource in this function, we need to use the Boto3 python library to use the AWS resources.
🌐
Kosli
kosli.com › blog › how-to-use-the-aws-lambda-function-in-python
How to Use the AWS Lambda Function in Python
March 21, 2023 - In order to execute the thumbnail-generation code in a serverless way, you need to create an AWS Lambda function using the AWS Console. In the AWS Console, search for “Lambda” and select it. Then click Create function: Select Author from ...
🌐
Full Stack Python
fullstackpython.com › blog › aws-lambda-python-3-6.html
How to Create Your First Python 3.6 AWS Lambda Function - Full Stack Python
Let's learn how to quickly write and run a Lambda function to execute basic Python 3.6 code which uses environment variables as input. This code, which is also available on GitHub under the blog-post-examples repository can be changed so that you can build much more complicated Python programs. No local development environment tools are required for this tutorial, other than a web browser. All the work will happen on AWS via their Console. These steps can also be completed from the command line via the boto3 library, but we won't cover that in this post.
🌐
AWS
docs.aws.amazon.com › aws sdk code examples › code library › code examples by sdk using aws sdks › code examples for sdk for python (boto3) › lambda examples using sdk for python (boto3)
Lambda examples using SDK for Python (Boto3) - AWS SDK Code Examples
May 13, 2026 - The following code examples show ... the AWS SDK for Python (Boto3) with Lambda. Basics are code examples that show you how to perform the essential operations within a service. Actions are code excerpts from larger programs and must be run in context. While actions show you how to call individual service functions, you can see ...
🌐
GeeksforGeeks
geeksforgeeks.org › devops › aws-lambda-create-a-lambda-function-in-python-integrated-with-api-gateway
AWS Lambda - Create a Lambda Function in Python, Integrated with API Gateway - GeeksforGeeks
July 23, 2025 - Step 1: Go to AWS Management Console and search for lambda. Click on "Lambda" and next click on "Create Function". Step 2: Give your function a name, here we have given it an if-test.
🌐
Medium
medium.com › swlh › a-guide-to-aws-lambdas-using-python-triggered-by-an-api-call-1e768edd13c5
A Guide to AWS Lambdas using Python, triggered by an API call | by llama | The Startup | Medium
October 16, 2018 - Let’s call this zip package lambda-test.zip · Crack your knuckles, this is pesky. Log in to you AWS account. Under services, go to lambdas. Create a new function, let’s call it test, change the runtime to Python2.7 and assign it a suitable role.
🌐
AWS
aws.amazon.com › blogs › compute › using-python-in-an-aws-lambda-function
Using Python in an AWS Lambda Function | Amazon Web Services
May 23, 2022 - Tim Wagner, AWS Lambda REVISED: Python 2.7 is now a first-class language in AWS Lambda…no workarounds required!
🌐
Adam the Automator
adamtheautomator.com › aws-lambda-python
Build AWS Lambda Python Functions from Scratch
October 1, 2023 - Assign a variable to the client called ec2. This object will represent the connection to EC2 where you can initiate starting the instance. ... To run the Boto3 code, you need a Python function. This function consists of two parameters – event and context. Currently, the function you’re building is stored locally. But, this function will be sent up to AWS later and needs to adhere to what Lambda expects.
🌐
Amazon Web Services
boto3.amazonaws.com › v1 › documentation › api › latest › reference › services › lambda.html
Lambda - Boto3 1.43.57 documentation
When making the API calls, you will need to authenticate your request by providing a signature. Lambda supports signature version 4. For more information, see Signature Version 4 signing process in the Amazon Web Services General Reference.. Because Amazon Web Services SDKs use the CA certificates from ...
🌐
Reddit
reddit.com › r/aws › how do i programmatically invoke a lambda functin?
r/aws on Reddit: How do I programmatically invoke a Lambda functin?
October 10, 2019 -

I'm a network guy but I'm trying to wrap my head around this new cloud stuff. I get what Lambda does, and I know I can call functions via stuff like the web console, but how do I integrate them into a production workflow? Lots of lambda tutorials show you how to use the console and don't take it any farther than that.

Googling suggests there's both a Lambda API and, of course, API Gateway. Are those the same thing?

Is there a decent 'hello world' out there which lets you call a lambda function via curl/requests, for example?

thanks!