How to Create Lambda function on Amazon Web Service(AWS).
AWS Lambda is a serverless compute service that runs your code in response to events and automatically manages the underlying compute resources for you. You can use AWS Lambda to extend other AWS services with custom logic, or create your own back-end services that operate at AWS scale, performance, and security.
- Login to aws portal.
- Click on Services.
- Under Compute select Lambda.
- Click on Create Function.
- We have multiple method to create lambda function.
- When select Author from scratch.
- Provide function name.
- Select Runtime Language: Node.js, java or python.
- Click on Advanced settings.
- Provide existing VPC.
- Click on Create Function.
- When select Use a blueprint.
- Then search Blueprint.For example hello-world.
- Select hello-world.Click on Configure.
- Provide function name.
- Click on Create function.
- When select Container Image.
- Provide function name.
- Provide Container image URI from ECR.
- Click on Create function.
- After sometime lambda is ready.
- Click on New Lambda function name.
- Click on Add trigger.
- Select a trigger.For example select Cloudwatch.
- Provide log group name,filter name & filter pattern.
- Click on Add.
- Click on Add destination.
- Create SNS topic for notification.
- Click on Save.
Create Lambda function using Shell
- Setup aws-cli on your system so click on link https://www.hackerxone.com/blog/how-install-configure-aws-cli-ubuntu-1804
- Run the following command:
aws lambda create-function –function-name my-function –runtime runtime-language