code: function getFunctionNameVersionAndAlias(awsContext) {
    const name = process.env.AWS_LAMBDA_FUNCTION_NAME;
    const version = process.env.AWS_LAMBDA_FUNCTION_VERSION;
  
    const nameFromContext = awsContext && awsContext.functionName;
    const versionFromContext = awsContext && awsContext.functionVersion;
  
    const invokedFunctionArn = awsContext && awsContext.invokedFunctionArn;
    const resources = getArnResources(invokedFunctionArn);
    const nameFromArn = resources.resource;
  
    if (nameFromContext && nameFromArn && nameFromArn !== nameFromContext) {
      console.warn(`Lambda context with function name (${nameFromContext}) has different name (${nameFromArn}) in invoked function ARN`);
    }
  
    const aliasOrVersion = resources.aliasOrVersion;
    const alias = aliasOrVersion && aliasOrVersion !== versionFromContext ? //&& aliasOrVersion !== version ?
      aliasOrVersion : '';
  
    const invokedFunctionNameWithAliasOrVersion = nameFromArn ? aliasOrVersion ?
      `${nameFromArn}:${aliasOrVersion}` : nameFromArn : '';
  
    return {
      functionName: name || nameFromContext || '',
      version: version || versionFromContext || '',
      alias: alias,
      invoked: invokedFunctionNameWithAliasOrVersion
    };
  }
docs: Returns the function name, version and alias (if any) from the given AWS context, which was passed to your Lambda
  function.
  
  Notes:
  - An invoked function ARN might be either an unqualified or qualified function ARN.
  - A qualified function ARN has a version or alias suffix, and maps to that version or alias.
  - An unqualified function ARN has NO version or alias suffix) and maps to the $LATEST version.
  
  @param {AWSContext} awsContext - the AWS context
  @returns {LambdaFunctionNameVersionAndAlias}