AWS Dev Lambda
Lambda is a Serverless managed compute service from AWS.
AWS Console
Create a Lambda Function
- Open AWS Console
- Open Lambda service
- Create function
- Browse serverless app repository
- Select hello-world
- Enter a valid identityNameParameter
- Deploy
Test a Lambda Function
- Open your Lambda function
- Click on Test App
- At the bottom, click on the function name
- Click on Test
- Create a new event for testing
- Validate
- Select event in drop down
- Click on test
- The function is executed and you can see traces and output.
- You can edit the function with the built-in editor on the same screen
- You can monitor your function using monitor tab
SAM
- Install the AWS SAM CLI
- run the init command
sam init
- Choose 1 for the quickstart template
- Choose your prefered language
- Select the default name
- Select Hello World Example
- If you have docker installed, you can test the function locally
sam local invoke "HelloWorldFunction" -e events/event.json
- You can now deploy your function to AWS
sam deploy -g
- You can delete your stack using aws cli
aws cloudformation delete-stack --stack-name ${stackname} --region ${region}
Comments