Assuming you are using a proxy integration the event looks like this: https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html#apigateway-example-event The context object: https://docs.aws.amazon.com/lambda/latest/dg/python-context.html Answer from chrisdubya555 on reddit.com
🌐
Amazon Web Services
docs.aws.amazon.com › aws lambda › developer guide › building lambda functions with python › define lambda function handler in python
Define Lambda function handler in Python - AWS Lambda
January 31, 2026 - The most common way to declare a handler function in Python is as follows: ... from typing import Dict, Any def lambda_handler(event: Dict[str, Any], context: Any) -> Dict[str, Any]: To use specific AWS typing for events generated by other AWS services and for the context object, add the aws-lambda-typing package to your function's deployment package.
🌐
Readthedocs
aws-lambda-for-python-developers.readthedocs.io › en › latest › 02_event_and_context
Chapter 2: What is the event & context? - AWS Lambda for Python Developers
As we dive deeper into AWS Lambda, we'll find more and more possible events that can trigger lambdas, such as: ... Each event will have a different format and carry different payloads, but the pattern is always the same. The lambda function is triggered, it will inspect its event and perform a logic on the event before returning and terminating. Now that we've covered event, let's move onto context. context is a Python ...
Discussions

amazon web services - How to access the event object with python in AWS Lambda? - Stack Overflow
To follow up on this question: Filter CloudWatch Logs to extract Instance ID I think it leaves the question incomplete because it does not say how to access the event object with python. My goal ... More on stackoverflow.com
🌐 stackoverflow.com
[deleted by user]
the answer is "historical reasons". but actually the value of a unified structure is unclear. why would you call the same lambda on different events? More on reddit.com
🌐 r/aws
28
17
April 7, 2022
Accessing Lambda Python event - ERROR
Help us improve the AWS re:Post Knowledge Center by sharing your feedback in a brief survey. Your input can influence how we create and update our content to better support your AWS journey. ... In a Lambda Python function, I desire to get 3 data items from the lambda_handler event. More on repost.aws
🌐 repost.aws
2
0
May 13, 2024
amazon web services - Navigating Event in AWS Lambda Python - Stack Overflow
So I'm fairly new to both AWS and Python. I'm on a uni assignment and have hit a road block. I'm uploading data to AWS S3, this information is being sent to an SQS Queue and passed into AWS Lambda. I More on stackoverflow.com
🌐 stackoverflow.com
🌐
Reddit
reddit.com › r/aws › what fields/properties do 'event' and 'context' have in a python lambda invoked by api gateway?
r/aws on Reddit: What fields/properties do 'event' and 'context' have in a Python Lambda invoked by API Gateway?
February 26, 2022 -

I am writing a Python Lambda that will be invoked via HTTP. A web service will make an HTTP call to an API Gateway resource that I define, which will then invoke the Lambda. My Lambda handler will look like:

def lambda_handler(event, context):
    // do stuff down here
    return responseObject

I am trying to find documentation on event and context so I know how to do things like:

  • extract query string parameters from requests

  • extract path parameters from requests

  • inspect the request entity

  • etc.

Surprising I can find no official AWS documentation on what fields/properties these two objects have on them when they are invoked from an API Gateway resource action. I found this article which was sort of helpful but nothing official from AWS. Can anyone point me in the right direction?

🌐
Amazon Web Services
docs.aws.amazon.com › aws lambda › developer guide › building lambda functions with python › using the lambda context object to retrieve python function information
Using the Lambda context object to retrieve Python function information - AWS Lambda
in the powertools-lambda-python repository on GitHub. The following example shows a handler function that logs context information. import time def lambda_handler(event, context): print("Lambda function ARN:", context.invoked_function_arn) print("CloudWatch log stream name:", context.log_stream_name) print("CloudWatch log group name:", context.log_group_name) print("Lambda Request ID:", context.aws_request_id) print("Lambda function memory limits in MB:", context.memory_limit_in_mb) # We have added a 1 second delay so you can see the time remaining in get_remaining_time_in_millis.
🌐
AWS Cloud Community
docs.powertools.aws.dev › lambda › python › latest › utilities › data_classes
Event Source Data Classes - Powertools for AWS Lambda (Python)
... Used when building Lambda GraphQL ... the locations field of the Merchant type. It uses the @event_source decorator to parse the AppSync event, handles pagination and filtering for locations, and demonstrates AppSyncIdentityCognito....
🌐
AWS
docs.aws.amazon.com › cdk › api › v2 › python › aws_cdk.aws_lambda_event_sources › README.html
AWS Lambda Event Sources — AWS Cloud Development Kit 2.238.0 documentation
You can use the bucket notification configuration feature in Amazon S3 to configure the event source mapping, identifying the bucket events that you want Amazon S3 to publish and which Lambda function to invoke. import aws_cdk.aws_s3 as s3 from aws_cdk.aws_lambda_event_sources import S3EventSource # fn: lambda.Function bucket = s3.Bucket(self, "mybucket") fn.add_event_source(S3EventSource(bucket, events=[s3.EventType.OBJECT_CREATED, s3.EventType.OBJECT_REMOVED], filters=[s3.NotificationKeyFilter(prefix="subdir/")] ))
Find elsewhere
🌐
PyPI
pypi.org › project › aws-lambda-event
aws-lambda-event
JavaScript is disabled in your browser · Please enable JavaScript to proceed · A required part of this site couldn’t load. This may be due to a browser extension, network issues, or browser settings. Please check your connection, disable any ad blockers, or try using a different browser
🌐
GeeksforGeeks
geeksforgeeks.org › cloud computing › lambda-function-handler-in-python
Lambda Function Handler In Python - GeeksforGeeks
July 23, 2025 - An event is generally a JSON Formatted String that contains the data that was passed by the external sources when invoking a Lambda function. It is usually of the 'dict' type in python but it can also be other types, such as 'list', 'int', 'float', ...
🌐
Kevinhakanson
kevinhakanson.com › 2022-04-10-python-typings-for-aws-lambda-function-events
Python Typings for AWS Lambda Function Events | kevinhakanson.com
import boto3 from aws_lambda_powertools.utilities.typing import LambdaContext from aws_lambda_powertools.utilities.data_classes import event_source, EventBridgeEvent from aws_lambda_powertools.utilities.data_classes.s3_event import S3Message @event_source(data_class=EventBridgeEvent) def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> None: # can use either event['detail'] or event.detail event_detail: S3Message = S3Message(event['detail']) bucket = event_detail.bucket.name file_key = event_detail.get_object.key s3 = boto3.client('s3') file_to_process = s3.get_object(Bucket=bucket, Key=file_key)
🌐
Amazon Web Services
docs.aws.amazon.com › aws lambda › developer guide › building lambda functions with python
Building Lambda functions with Python - AWS Lambda
You can run Python code in AWS Lambda. Lambda provides runtimes for Python that run your code to process events. Your code runs in an environment that includes the SDK for Python (Boto3), with credentials from an AWS Identity and Access Management (IAM) role that you manage.
🌐
Reddit
reddit.com › r/aws › [deleted by user]
Trying to better understand Lambda event objects (Python)
April 7, 2022 - First thing my lambda does is rip the event open, see what the EventSource is and then pass the event off to a different in-lambda python function for each event source, each of those functions knows how to parse their own events and they all hand back a python object that I then interact with.
🌐
CloudThat
cloudthat.com › home › blogs › understanding aws lambda event sources in python
Understanding AWS Lambda Event Sources in Python
February 9, 2026 - The aws_cdk.aws_lambda_event_sources module provides classes that represent different AWS services as event sources for AWS Lambda. This means you can use Python code to tell AWS Lambda where to listen for events.
🌐
PyPI
pypi.org › project › aws-lambda-event-handler
aws-lambda-event-handler · PyPI
This package provides a decorator for Python Lambda functions handling AWS Lambda Event Records.
      » pip install aws-lambda-event-handler
    
Published   Aug 25, 2018
Version   0.0.3
🌐
Medium
medium.com › @reach2shristi.81 › starting-your-lambda-journey-with-python-74d95346dd0
Starting your Lambda Journey with Python | by Min_Minu | Medium
June 25, 2023 - Set up event triggers to invoke your Lambda function based on specific events or schedule. Ensure that the Lambda function has the necessary permissions to access AWS resources, such as S3 buckets, DynamoDB tables, or SQS queues.
🌐
AWS re:Post
repost.aws › questions › QUrmI15oZ3TxqM1Q0nYKJqFA › accessing-lambda-python-event-error
Accessing Lambda Python event - ERROR | AWS re:Post
May 13, 2024 - In a Lambda Python function, I desire to get 3 data items from the lambda_handler event. Previously & recently this syntax worked: param = event.get('queryStringParameters') myUsername = param['Us...
🌐
Amazon Web Services
docs.aws.amazon.com › aws lambda › developer guide › building lambda functions with python › log and monitor python lambda functions
Log and monitor Python Lambda functions - AWS Lambda
START RequestId: 8f507cfc-xmpl-4697-b07a-ac58fc914c95 Version: $LATEST ## ENVIRONMENT VARIABLES /aws/lambda/my-function 2025/08/31/[$LATEST]3893xmpl7fac4485b47bb75b671a283c ## EVENT {'key': 'value'} END RequestId: 8f507cfc-xmpl-4697-b07a-ac58fc914c95 REPORT RequestId: 8f507cfc-xmpl-4697-b07a-ac58fc914c95 Duration: 15.74 ms Billed Duration: 147 ms Memory Size: 128 MB Max Memory Used: 56 MB Init Duration: 130.49 ms XRAY TraceId: 1-5e34a614-10bdxmplf1fb44f07bc535a1 SegmentId: 07f5xmpl2d1f6f85 Sampled: true · The Python runtime logs the START, END, and REPORT lines for each invocation.
🌐
Medium
medium.com › cyberark-engineering › aws-lambda-event-validation-from-zero-to-hero-2ca950acd2ea
AWS Lambda Event Validation — from Zero to Hero | by Ran Isenberg | CyberArk Engineering | Medium
April 23, 2022 - The Lambda receives the event parameter, which is a Python dictionary. If at this stage you access the dictionary without checking its validity, for the majority of Lambda invocations you will be fine.