In this video, we are going to see a number of typical events and test templates.
Most land based applications use a combination of resources for different requirements about storage,
API management and integrating with other systems and services.
In these applications, Lambda is connecting between services, providing business logic to transform
data that moves between services.
So we said that the service applications, mostly using a combination of several services that integrate
with custom code, run on the lambda functions.
So Lambda integrates with all these other services to invoke function or take other actions.
There are some common use cases that you can also see on the slide.
For example, invoke a function in response to the source lifecycle events.
For example, Amazon S3 storage.
If you upload the Amazon S3 storage, it could be triggered at the Lambda function and the photo different
devices.
And the second use case could be to respond to incoming HTTP requests.
You can see the web application and the application user click the button and this will be invoke the
API Gateway API.
Gateway will run the lambda function on behind the scenes.
Another case could be the consume event from the queue and as case could be pulling from the lambda
locations.
And also we can run a function on a cycle.
We can run the IWC lambda with scheduled events on Amazon event which depending on which service you
are using with lambda, the invocation works with the different events and objects.
So that means S3 triggered events and API gateway events and space events is different with each other.
Our lambda function should be developed according to incoming event object from other services.
So now I'm going to show you example test templates which we can simulate to trigger a lambda function
from other sources.
Please open the measurement console and open the one of the lambda function.
And if you go to the test section, maybe you remember we have create a new test templates and if you
click the create new test template and give the random name.
If you scroll down, you can see there is some templates in here.
If you click this dropdown, you can see the potential incoming events in here.
For example, I would like to show.
History.
But throughout the city you can see that a three put event.
If you think that your Amazon S3 object resources will trigger to your function, this is an example
incoming event JSON to the lambda function.
You can see that we have records and in every record we have some details about the S3 object, bucket
name and so on is the same way you can search for the case.
If the case triggered to your lambda function, you can see the records and in the records you can see
the details of the body, message, ID, even source and so on.
So at the same way you can search a SNS topic notification and here the is about the SNS topic notification
and you can see API gateway a list proxy.
This will be the API gateway invocation to a lambda.
You can get the body resource and pet HTTP method information in the incoming events object.
So this is very good resource to see and simulate your function to incoming event from different sources.
We're checking different templates in the test section of the lambda function, so we should develop
lambda functions according to the typical service and our use cases.