open this project in vs code - amresh087/newronaRepos GitHub Wiki

Now we can open this project in vs code and we can open PowerShell if you want to perform Linux command like ls, pwd etc.

if you want to open this project in vs code then type . code command in powershell then it will open in vs code

In this project there are some below important files

  1. .gitignore : mean if you want to ignore some file or package then we need to in this file like below
  1. most important file is serverless.yml -> in this file function name is configure

Here function name and handle is configure mean function is index

  1. The most important file is index.js

what function name is configure in serverless yml same name can use as file name called index.js

Now let update some thing in code and deploy again

  module.exports.handler = async (event) => {
    return {
    statusCode: 200,
     body: JSON.stringify(
       {
         message: 'Hello again Your function executed successfully!',
        input: event,
       },
      null,
      2
    ),
  };
};

Re-deploy then run sls deploy in cmd

Now refresh aws lamda then it will show update code

If you want to deploy every thing then we need to use below command

  sls depoly

But if you want to deploy only function then we can use

 sls deploy function -f <function name>

 sls deploy function -f myfunction

Fetching the Function Logs from the CLI or invoke

sls invoke -f

sls invoke -f myfunction

sls invoke -f myfunction  --log

Now you can see Cloudwatch log when click on monitor section

Removing the Function Completely

 sls remove