A typical life cycle of how AWS Lambda works is shown in this list and the following diagram:
- Upload your function to either S3 or directly to AWS Lambda.
- Configure the events/triggers for the AWS Lambda.
- Based on the events/triggers that you have configured, AWS Lambda will execute the function.
- Pay for the compute resources only for the time that you have used them:
How AWS Lambda works