Deploy Lambda

In this step we will use the Amazon.Lambda.Tools, to deploy our Lambda to API Gatway.

  1. From the the Cloud9 terminal window, we will need to run the serverless deployment command. Make sure you are in the same directory location as the “aws-lambda-tools-defaults.json” file, then run this command:

    dotnet lambda deploy-serverless
    
  2. That will build and deploy the .Net Core application. Once the deployment is complete. The CLI will return a url end point that can be used to manually test the lambda.

Run a few test

  1. Use the url provided to execute the lambda a few times and review the output for each run.
  2. The url should return a json file like this:

    {
    "Calls":3,
    "ElapsedTime":"00:00:00.0189810",
    "ElapsedTimeMilli":"18",
    "IPAddress":"10.0.3.249",
    "LamCalls":0,
    "LamElapsedTime":"00:00:00.0190611",
    "LamElapsedTimeMilli":"19.0611"
    }