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
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
Confused about how to set up a lambda in a private subnet that should receive events from SQS
AWS is a public cloud: meaning most of its services, like S3, API Gateway, Lambda, DynamoDB, and SQS, are accessible over the public internet from anywhere. Then you’ve got VPC, which is the private side of things, used for resources like EC2 or RDS. When you place a Lambda inside a VPC, it basically moves from the public part into the private part, so it loses access to public services. The usual fix is adding a NAT Gateway or egress gateway so a Lambda in a private subnet can reach the internet or public AWS services. But honestly, that’s not ideal: it’s less secure, costs more, adds latency and bandwidth bottlenecks. That’s where VPC endpoints come in. They let private resources talk to public-facing AWS services, but keep all the traffic within AWS’s own network. For your specific use case, the only real options are a NAT Gateway, Egress Gateway, or VPC endpoint. That means you either need to set up that infrastructure (IaaS is a different thing) yourself or have it already in place. My ideal setup would be a queue locked down with a resource policy that only allows access from a specific VPC endpoint and the Lambda’s IAM role, plus a security group that only permits traffic from the Lambda’s own security group. Another option would be to refactor your function so it's not polling the queue in code, just let Lambda receive messages via triggers and consume the body from the event. You could still lock things down with resource policies, but keep in mind, a coworker with broad access could still override your restrictions. That’s why you want to layer in granular permissions. More on reddit.com
🌐 r/aws
22
4
February 26, 2026
🌐
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
🌐
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!'); }
🌐
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.
🌐
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.
🌐
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.
🌐
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', }), }); };
🌐
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 python › using the lambda context object to retrieve python function information
Using the Lambda context object to retrieve Python function information - AWS Lambda
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.
🌐
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
🌐
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.