Event represents the event or trigger that caused the invocation of the lambda. For example, if your lambda is triggered by an upload to S3 this will contain information about the object being uploaded for example:

    {
      "Records": [
        {
          "eventVersion": "2.0",
          "eventTime": "1970-01-01T00:00:00.000Z",
          "requestParameters": {
            "sourceIPAddress": "127.0.0.1"
          },
          "s3": {
            "configurationId": "testConfigRule",
            "object": {
              "eTag": "0123456789abcdef0123456789abcdef",
              "sequencer": "0A1B2C3D4E5F678901",
              "key": "HappyFace.jpg",
              "size": 1024
            },
            "bucket": {
              "arn": bucketarn,
              "name": "sourcebucket",
              "ownerIdentity": {
                "principalId": "EXAMPLE"
              }
            },
            "s3SchemaVersion": "1.0"
          },
          "responseElements": {
            "x-amz-id-2": "EXAMPLE123/5678abcdefghijklambdaisawesome/mnopqrstuvwxyzABCDEFGH",
            "x-amz-request-id": "EXAMPLE123456789"
          },
          "awsRegion": "us-east-1",
          "eventName": "ObjectCreated:Put",
          "userIdentity": {
            "principalId": "EXAMPLE"
          },
          "eventSource": "aws:s3"
        }
      ]
    }

Here is detailed information about events, with an example.

Context Provides information about the invocation, function, and execution environment of your lambda. So you can use this to check the memory allocation or to retrieve the number of milliseconds left before the execution times out. Here is detailed documentation about context, with an example.

Answer from Jarred Olson on Stack Overflow
🌐
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 - Example Python Lambda function codeHandler naming conventionsUsing the Lambda event objectAccessing and using the Lambda context objectValid handler signatures for Python handlersReturning a valueUsing the AWS SDK for Python (Boto3) in your handlerAccessing environment variablesCode best practices ...
🌐
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
In real-life, the event can come from whatever triggers the lambda, a good example, if the lambda were triggered from an HTTP api call via API Gateway, then the event object would look something like this:
Discussions

What are event and context in function call in AWS Lambda?
AWS Lambda official 'Getting started' section covers this quite well. Also see this brief docs. ... Event represents the event or trigger that caused the invocation of the lambda. For example, if your lambda is triggered by an upload to S3 this will contain information about the object being ... More on stackoverflow.com
🌐 stackoverflow.com
What fields/properties do 'event' and 'context' have in a Python Lambda invoked by API Gateway?
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 More on reddit.com
🌐 r/aws
4
3
September 23, 2022
AWS Lambda event parameter syntax
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. ... I created a lambda function to be called every month by using an EventBridge schedule. More on repost.aws
🌐 repost.aws
3
0
October 1, 2023
ELI5 Lambda Handler?
It's basically the starting point of running your code. When AWS starts your lambda it will invoke/call the handler function. More on reddit.com
🌐 r/aws
3
1
April 12, 2022
🌐
Amazon Web Services
docs.aws.amazon.com › aws lambda › developer guide › what is aws lambda? › how lambda works › creating event-driven architectures with lambda
Creating event-driven architectures with Lambda - AWS Lambda
Generally, the service or resource ... to manage this can result in infinite loops. For example, a Lambda function writes an object to an Amazon S3 object, which in turn invokes the same Lambda function via a put event....
Top answer
1 of 3
30

Event represents the event or trigger that caused the invocation of the lambda. For example, if your lambda is triggered by an upload to S3 this will contain information about the object being uploaded for example:

    {
      "Records": [
        {
          "eventVersion": "2.0",
          "eventTime": "1970-01-01T00:00:00.000Z",
          "requestParameters": {
            "sourceIPAddress": "127.0.0.1"
          },
          "s3": {
            "configurationId": "testConfigRule",
            "object": {
              "eTag": "0123456789abcdef0123456789abcdef",
              "sequencer": "0A1B2C3D4E5F678901",
              "key": "HappyFace.jpg",
              "size": 1024
            },
            "bucket": {
              "arn": bucketarn,
              "name": "sourcebucket",
              "ownerIdentity": {
                "principalId": "EXAMPLE"
              }
            },
            "s3SchemaVersion": "1.0"
          },
          "responseElements": {
            "x-amz-id-2": "EXAMPLE123/5678abcdefghijklambdaisawesome/mnopqrstuvwxyzABCDEFGH",
            "x-amz-request-id": "EXAMPLE123456789"
          },
          "awsRegion": "us-east-1",
          "eventName": "ObjectCreated:Put",
          "userIdentity": {
            "principalId": "EXAMPLE"
          },
          "eventSource": "aws:s3"
        }
      ]
    }

Here is detailed information about events, with an example.

Context Provides information about the invocation, function, and execution environment of your lambda. So you can use this to check the memory allocation or to retrieve the number of milliseconds left before the execution times out. Here is detailed documentation about context, with an example.

2 of 3
3

From the docs

When Lambda runs your function, it passes a context object to the handler. This object provides methods and properties that provide information about the invocation, function, and execution environment.

Event (and the args) are described here.

To put it more simply, think of event as an input to a regular function. Context is an extra input supplied by AWS to give you a variety of meta context and such.

🌐
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?
September 23, 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 node.js › define lambda function handler in node.js
Define Lambda function handler in Node.js - AWS Lambda
After you define these types in your JSDoc comment, you can access the fields of the event object directly in your code. For example, event.order_id retrieves the value of order_id from the original input. We recommend that you use async/await to declare the function handler instead of using callbacks.
🌐
AWS
docs.aws.amazon.com › amazon cloudfront › developer guide › customize at the edge with functions › customize at the edge with lambda@edge › lambda@edge event structure
Lambda@Edge event structure - Amazon CloudFront
In this example, Lambda@Edge automatically inserts "key": "User-Agent". For information about restrictions on header usage, see Restrictions on edge functions. ... The HTTP method of the request. ... The query string, if any, in the request. If the request doesn't include a query string, the event object still includes querystring with an empty value.
Find elsewhere
🌐
GitHub
github.com › tschoffelen › lambda-sample-events
GitHub - tschoffelen/lambda-sample-events: ⚡️ A library of example event payloads for AWS Lambda.
This is a library of sample event payloads for AWS Lambda.
Starred by 67 users
Forked by 6 users
Languages   JavaScript
🌐
Amazon Web Services
docs.aws.amazon.com › aws lambda › developer guide › invoking lambda with events from other aws services
Invoking Lambda with events from other AWS services - AWS Lambda
Some AWS services can directly invoke Lambda functions using triggers. These services push events to Lambda, and the function is invoked immediately when the specified event occurs. Triggers are suitable for discrete events and real-time processing. When you create a trigger using the Lambda console, the console interacts with the corresponding AWS service to configure the event notification on that service.
🌐
Dashbird
dashbird.io › home › knowledge base › aws lambda › anatomy of a lambda function
Anatomy Of A Lambda Function | Knowledge Base | Dashbird
January 11, 2021 - The most simplest Lambda function consist of one handler function. exports.handler = async function(event, context) { console.log('Hello world!'); }
🌐
Learning-Ocean
learning-ocean.com › tutorials › aws › mastering-aws-lambda-event-objects
Aws - AWS Lambda: Event Objects - Learning-Ocean
When you trigger a Lambda function using a Function URL, an event object is passed to the function. The contents of the event object vary depending on the trigger source: S3 Trigger: Contains details about the newly created S3 object.
🌐
AWS Cloud Community
docs.powertools.aws.dev › lambda › python › latest › utilities › data_classes
Event Source Data Classes - Powertools for AWS Lambda (Python)
This example is based on the AWS Cognito docs for Verify Auth Challenge Response Lambda Trigger. app.pyCognito Verify Auth Challengen Example Event · The example integrates with Amazon Connect by handling contact flow events. The function converts the event into a ConnectContactFlowEvent object, providing a structured representation of the contact flow data.
🌐
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
The eventSourceMappingArn property contains the event source mapping ARN. This will be a token that will resolve to the final value at the time of deployment. Amazon Simple Queue Service (Amazon SQS) allows you to build asynchronous workflows. For more information about Amazon SQS, see Amazon Simple Queue Service. You can configure AWS Lambda to poll for these messages as they arrive and then pass the event to a Lambda function invocation.
🌐
Amazon Web Services
docs.aws.amazon.com › aws lambda › developer guide › building lambda functions with typescript › define lambda function handler in typescript
Define Lambda function handler in TypeScript - AWS Lambda
The following example uses APIGatewayProxyCallback, which is a specialized callback type specific to API Gateway integrations. Most AWS event sources use the generic Callback type shown in the signatures above. import { Context, APIGatewayProxyCallback, APIGatewayEvent } from 'aws-lambda'; export const lambdaHandler = (event: APIGatewayEvent, context: Context, callback: APIGatewayProxyCallback): void => { console.log(`Event: ${JSON.stringify(event, null, 2)}`); console.log(`Context: ${JSON.stringify(context, null, 2)}`); callback(null, { statusCode: 200, body: JSON.stringify({ message: 'hello world', }), }); };
🌐
Medium
medium.com › the-symphonium › learning-lambda-part-6-dea1740f6c6f
Learning Lambda — Part 6. Invocation and Event Sources | by Mike Roberts | The Symphonium | Medium
November 14, 2017 - With that done, AWS will ask for secondary configuration. For S3 you’ll always need to specify the source bucket, and then you’ll also need to specify the Event Type. For our example this is PUT, under Object Created.
🌐
AWS re:Post
repost.aws › questions › QU5Q4mZH_GTR-HVgNvV8ktfA › aws-lambda-event-parameter-syntax
AWS Lambda event parameter syntax | AWS re:Post
October 1, 2023 - I am trying to figure out the "event" parameter -- I set it up so that I can call this lambda directly using a parameter like so: serverless invoke -f ScheduledBillingReportLambda** --data '2023-09-30'** -s prod and this works perfectly, but ...
🌐
Amazon Web Services
docs.aws.amazon.com › aws lambda › developer guide › invoking lambda with events from other aws services › process amazon s3 event notifications with lambda
Process Amazon S3 event notifications with Lambda - AWS Lambda
Amazon S3 invokes your function asynchronously with an event that contains details about the object. The following example shows an event that Amazon S3 sent when a deployment package was uploaded to Amazon S3. { "Records": [ { "eventVersion": "2.1", "eventSource": "aws:s3", "awsRegion": "us-east-2", "eventTime": "2019-09-03T19:37:27.192Z", "eventName": "ObjectCreated:Put", "userIdentity": { "principalId": "AWS:AIDAINPONIXQXHT3IKHL2" }, "requestParameters": { "sourceIPAddress": "205.255.255.255" }, "responseElements": { "x-amz-request-id": "D82B88E5F771F645", "x-amz-id-2": "vlR7PnpV2Ce81l0PRw6
🌐
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', ...