Lambda Event Source Mapping

AWS Lambda functions can interact with various event sources through Lambda Event Source Mapping Configuration. This feature enables seamless integration between your Lambda functions and AWS services by supporting both push-based and pull-based event sources.

Supported Event Sources

GitMoxi currently supports:

Event Source TypeSupported Services
Push-basedAPI Gateway, Elastic Load Balancer
Pull-basedAll sources supported by the Lambda Event Source Mapping API

Configuration File

Event source mappings are defined in the _lambdaeventsourcedef.json file, which contains configurations for both push and pull event sources.

Push Event Sources

Push event sources automatically invoke Lambda functions based on service-specific triggers, with each service having its own configuration requirements.

Elastic Load Balancer (ELB)

AttributeTypeRequiredDescription
ServicestringYesMust be elasticloadbalancing.amazonaws.com
TargetGroupArnstringYesARN of the target group associated with the Lambda function

Example:

{
  "Service": "elasticloadbalancing.amazonaws.com",
  "TargetGroupArn": "<target-group-arn>"
}

API Gateway

AttributeTypeRequiredDescription
ServicestringYesMust be apigateway.amazonaws.com
ApiIdstringYesUnique identifier of the API Gateway instance
RouteIdstringYesIdentifier for the API’s endpoint or route
AliasStageVariableNamestringNoName of the stage variable pointing to a specific Lambda alias (useful for versioning deployments)

Example:

{
  "Service": "apigateway.amazonaws.com",
  "ApiId": "<api-id>",
  "RouteId": "<api-route-id>",
  "AliasStageVariableName": "lambdaAlias"
}

Pull Event Sources

Pull event sources use Event Source Mapping to poll the source and invoke the Lambda function with batch processing capabilities.

Configuration Parameters

For pull event sources, use the exact configuration parameters required by the Lambda Event Source Mapping API. GitMoxi passes these parameters directly to the AWS API.

Common parameters include:

ParameterDescription
EventSourceArnARN of the event source (e.g., SQS queue, DynamoDB stream)
FunctionNameName or ARN of the Lambda function
BatchSizeMaximum number of items to retrieve in a single batch
MaximumBatchingWindowInSecondsMaximum amount of time to gather records before invoking the function

Complete Example

{
  "PushEventSources": [
    {
      "Service": "elasticloadbalancing.amazonaws.com",
      "TargetGroupArn": "<target-group-arn>"
    },
    {
      "Service": "apigateway.amazonaws.com",
      "ApiId": "<api-id>",
      "RouteId": "<api-route-id>",
      "AliasStageVariableName": "lambdaAlias"
    }
  ],
  "PullEventSources": {
    "EventSourceMapping": {
      "EventSourceArn": "<sqs-arn>",
      "FunctionName": "MyLambdaFunction",
      "BatchSize": 10,
      "MaximumBatchingWindowInSeconds": 60
    }
  }
}

Note: Replace placeholder values with your actual resource identifiers when implementing this configuration.

Elevate Your Deployment Experience Today

Experience the power of Gitmoxi — your go-to solution for simple, flexible, and transparent deployment management

Try Now for Free