
A Lambda Trigger is some way to "trigger" your Lambda Function.
For example, let's say you have a Simple Notification Service (SNS) Topic named my-topic. Check out my article on Creating a Simple Notification Service (SNS) Topics using the AWS CLI.
~]$ aws sns create-topic --name my-topic
{
"TopicArn": "arn:aws:sns:us-east-1:123456789012:my-topic"
}
And you use the aws sns subscribe command to subscribe your Lambda Function to the SNS Topic.
~]$ aws sns subscribe --topic-arn arn:aws:sns:us-east-1:123456789012:my-topic --protocol lambda --notification-endpoint arn:aws:lambda:us-east-1:123456789012:function:my-lambda-function
{
"SubscriptionArn": "arn:aws:sns:us-east-1:123456789012:my-topic:e68a4a47-ce56-48a5-865d-31f5920c4355"
}
This creates a Lambda Trigger. For example, over in the AWS Lambda console, you should have an SNS trigger with your Lambda Function. Now, when messages are published to the SNS Topic, the Lambda Function will be invoked. Nice!
Or, you could have a CloudFront Distribution trigger your Lambda Function each time a resource is requested from the CloudFront Distribution. Check out my article Amazon Web Services (AWS) - Getting Started with Lambda@EDGE for more details on this.
Did you find this article helpful?
If so, consider buying me a coffee over at