To create a Lambda function, you first package your code and dependencies in a deployment package. Then, you upload the deployment package to AWS Lambda to create your Lambda function.
You must first organize your code and dependencies in certain ways and create a deployment package. When you create Lambda functions using the console, the console creates the deployment package for you, and then uploads it to create your Lambda function.
Uploading a deployment package
AWS Lambda provides the CreateFunction operation, which is what you use to create a Lambda function. You can use the AWS Lambda console, AWS CLI, and AWS SDKs to create a Lambda function.
Testing your Lambda function
If your Lambda function is designed to process events of a specific type, you can use sample event data to test your Lambda function using one of the following methods:
- Test your Lambda function in the console.
- Test your Lambda function using the AWS CLI. You can use the Invoke method to invoke your Lambda function and pass in sample event data.
- Test your Lambda function locally using the AWS SAM CLI.