AWS Serverless Training Lohika Course
serverless create --template aws-java-maven --path customFolderName
Define a different profile for Serverless in ~/.aws/credentials
:
[profileName1]
aws_access_key_id=***************
aws_secret_access_key=***************
[serverless]
aws_access_key_id=***************
aws_secret_access_key=***************
Switch to a different AWS profile per project:
export AWS_PROFILE="serverless"
Now everything is set to execute all the serverless CLI options like sls deploy
serverless deploy
serverless deploy -f myFunction
How to Test Serverless Applications
Local lambda invocation using a custom event
serverless invoke local -f myFunction -p myEvent.json
Remote lambda invocation using a custom event
serverless invoke -f myFunction -p myEvent.json
Investigating Internal Server Errors by using tailing logs
serverless logs -f myFunction --tail