I have just started learning AWS and nodejs . I am trying to understand how this lambda in the serverless app gets the required information while execution .Let's consider the below piece of code
use strict';
var AWS = require("aws-sdk");
var lambda = new AWS.Lambda({
apiVersion: '2015-03-31',
endpoint: 'https://lambda.' + process.env.DYNAMODB_REGION + '.amazonaws.com',
logger: console
});
So the first statement it creates a variable AWS . In any normal application these dependencies will be available in node modules and when we refer to it , we will easily access it . But here in the case of lambda function which has been created as a serverless app how it gets the dependency.
My second question is when we refer to process.env.DYNAMODB_REGION what would be the value for process.env ?
My third question is it possible to create a common logger file, get it imported inside the lambda and use it to log the details ?
Please help me to understand how lambda function get all these details .