Add a Create Note API


#61

I am getting the following error. Please help.

    { ResourceNotFoundException: Requested resource not found
    at Request.extractError (C:\Acctech\loginBackend\notes-app-api\node_modules\                                                                                                              aws-sdk\lib\protocol\json.js:48:27)
    at Request.callListeners (C:\Acctech\loginBackend\notes-app-api\node_modules                                                                                                              \aws-sdk\lib\sequential_executor.js:105:20)
    at Request.emit (C:\Acctech\loginBackend\notes-app-api\node_modules\aws-sdk\                                                                                                              lib\sequential_executor.js:77:10)
    at Request.emit (C:\Acctech\loginBackend\notes-app-api\node_modules\aws-sdk\                                                                                                              lib\request.js:683:14)
    at Request.transition (C:\Acctech\loginBackend\notes-app-api\node_modules\aw                                                                                                              s-sdk\lib\request.js:22:10)
    at AcceptorStateMachine.runTo (C:\Acctech\loginBackend\notes-app-api\node_mo                                                                                                              dules\aws-sdk\lib\state_machine.js:14:12)
    at C:\Acctech\loginBackend\notes-app-api\node_modules\aws-sdk\lib\state_mach                                                                                                              ine.js:26:10
    at Request.<anonymous> (C:\Acctech\loginBackend\notes-app-api\node_modules\a                                                                                                              ws-sdk\lib\request.js:38:9)
    at Request.<anonymous> (C:\Acctech\loginBackend\notes-app-api\node_modules\a                                                                                                              ws-sdk\lib\request.js:685:12)
    at Request.callListeners (C:\Acctech\loginBackend\notes-app-api\node_modules                                                                                                              \aws-sdk\lib\sequential_executor.js:115:18)
    at Request.emit (C:\Acctech\loginBackend\notes-app-api\node_modules\aws-sdk\                                                                                                              lib\sequential_executor.js:77:10)
    at Request.emit (C:\Acctech\loginBackend\notes-app-api\node_modules\aws-sdk\                                                                                                              lib\request.js:683:14)
    at Request.transition (C:\Acctech\loginBackend\notes-app-api\node_modules\aw                                                                                                              s-sdk\lib\request.js:22:10)
    at AcceptorStateMachine.runTo (C:\Acctech\loginBackend\notes-app-api\node_mo                                                                                                              dules\aws-sdk\lib\state_machine.js:14:12)
    at C:\Acctech\loginBackend\notes-app-api\node_modules\aws-sdk\lib\state_mach                                                                                                              ine.js:26:10
    at Request.<anonymous> (C:\Acctech\loginBackend\notes-app-api\node_modules\a                                                                                                              ws-sdk\lib\request.js:38:9)
    at Request.<anonymous> (C:\Acctech\loginBackend\notes-app-api\node_modules\a                                                                                                              ws-sdk\lib\request.js:685:12)
    at Request.callListeners (C:\Acctech\loginBackend\notes-app-api\node_modules                                                                                                              \aws-sdk\lib\sequential_executor.js:115:18)
    at callNextListener (C:\Acctech\loginBackend\notes-app-api\node_modules\aws-                                                                                                              sdk\lib\sequential_executor.js:95:12)
    at IncomingMessage.onEnd (C:\Acctech\loginBackend\notes-app-api\node_modules                                                                                                              \aws-sdk\lib\event_listeners.js:269:13)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickDomainCallback (internal/process/next_tick.js:218:9)
  message: 'Requested resource not found',
  code: 'ResourceNotFoundException',
  time: 2018-05-28T19:57:53.953Z,
  requestId: 'DO5PFITQC2EH2M00DEU8VQM237VV4KQNSO5AEMVJF66Q9ASUAAJG',
  statusCode: 400,
  retryable: false,
  retryDelay: 34.8159613214668 }
{
    "statusCode": 500,
    "headers": {
        "Access-Control-Allow-Origin": "*",
        "Access-Control-Allow-Credentials": true
    },
    "body": "{\"status\":false}"
}

#62

Usually this is related to the way your serverless.yml is indented. Can you compare it to this and make sure it looks okay? https://github.com/AnomalyInnovations/serverless-stack-demo-api/blob/add-a-create-note-api/serverless.yml


#63

Facing this issue. Everything is running fine when tested.

while calling

    serverless deploy 

the following error is generated.


#64

It looks like the serverless.yml might have some issues. It is looking for this line.

Make sure that part of your serverless.yml is formatted correctly.


#65

Hi! firstly, great tutorial so far!!

I am having a problem with create.js. I have adjusted my code slightly for my own use cases, but not by much at all. I have simply renamed the table to “services” instead of “notes”, and hence changed “noteId” to “serviceId”. Everywhere in your tutorial that you reference “notes” I replace with “services”. So here is my create.js:

import uuid from "uuid";
import * as dynamoDbLib from "./libs/dynamodb-lib";
import { success, failure } from "./libs/response-lib";

export async function main(event, context, callback) {
  const data = JSON.parse(event.body);
  const params = {
    TableName: "services",
    Item: {
      userId: event.requestContext.identity.cognitoIdentityId,
      serviceId: uuid.v1(),
      content: data.content,
      attachment: data.attachment,
      createdAt: Date.now()
    }
  };

  try {
    await dynamoDbLib.call("put", params);
    callback(null, success(params.Item));
  } catch (e) {
    console.log(e);
    callback(null, failure({ status: false }));
  }
}

but when I run serverless invoke local --function create --path mocks/create-event.json

I get the following error:

Entrypoint create = create.js create.js.map
[./create.js] 2.39 KiB {create} [built]
[./libs/dynamodb-lib.js] 526 bytes {create} [built]
[./libs/response-lib.js] 762 bytes {create} [built]
[aws-sdk] external "aws-sdk" 42 bytes {create} [built]
[babel-runtime/core-js/json/stringify] external "babel-runtime/core-js/json/stringify" 42 bytes {create} [built]
[babel-runtime/helpers/asyncToGenerator] external "babel-runtime/helpers/asyncToGenerator" 42 bytes {create} [built]
[babel-runtime/regenerator] external "babel-runtime/regenerator" 42 bytes {create} [built]
[source-map-support/register] external "source-map-support/register" 42 bytes {create} [built]
[uuid] external "uuid" 42 bytes {create} [built]
{ ValidationException: One or more parameter values were invalid: Missing the key userid in the item
    at Request.extractError (/home/joe/tradeswap-serverless-api/node_modules/aws-sdk/lib/protocol/json.js:48:27)
    at Request.callListeners (/home/joe/tradeswap-serverless-api/node_modules/aws-sdk/lib/sequential_executor.js:105:20)
    at Request.emit (/home/joe/tradeswap-serverless-api/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
    at Request.emit (/home/joe/tradeswap-serverless-api/node_modules/aws-sdk/lib/request.js:683:14)
    at Request.transition (/home/joe/tradeswap-serverless-api/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/home/joe/tradeswap-serverless-api/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /home/joe/tradeswap-serverless-api/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/home/joe/tradeswap-serverless-api/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/home/joe/tradeswap-serverless-api/node_modules/aws-sdk/lib/request.js:685:12)
    at Request.callListeners (/home/joe/tradeswap-serverless-api/node_modules/aws-sdk/lib/sequential_executor.js:115:18)
    at Request.emit (/home/joe/tradeswap-serverless-api/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
    at Request.emit (/home/joe/tradeswap-serverless-api/node_modules/aws-sdk/lib/request.js:683:14)
    at Request.transition (/home/joe/tradeswap-serverless-api/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/home/joe/tradeswap-serverless-api/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /home/joe/tradeswap-serverless-api/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/home/joe/tradeswap-serverless-api/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/home/joe/tradeswap-serverless-api/node_modules/aws-sdk/lib/request.js:685:12)
    at Request.callListeners (/home/joe/tradeswap-serverless-api/node_modules/aws-sdk/lib/sequential_executor.js:115:18)
    at callNextListener (/home/joe/tradeswap-serverless-api/node_modules/aws-sdk/lib/sequential_executor.js:95:12)
    at IncomingMessage.onEnd (/home/joe/tradeswap-serverless-api/node_modules/aws-sdk/lib/event_listeners.js:294:13)
    at IncomingMessage.emit (events.js:164:20)
    at endReadableNT (_stream_readable.js:1062:12)
    at process._tickCallback (internal/process/next_tick.js:152:19)
  message: 'One or more parameter values were invalid: Missing the key userid in the item',
  code: 'ValidationException',
  time: 2018-07-20T23:26:25.381Z,
  requestId: 'P8NS2EGQQJDJ1TOPOI3NDO0IOFVV4KQNSO5AEMVJF66Q9ASUAAJG',
  statusCode: 400,
  retryable: false,
  retryDelay: 2.878769684274174 }
{
    "statusCode": 500,
    "headers": {
        "Access-Control-Allow-Origin": "*",
        "Access-Control-Allow-Credentials": true
    },
    "body": "{\"status\":false}"
}

Any help would be greatly appreciated!

PS. Here are the details of my dynamodb table (copy pasted)

Table name services
Primary partition key serviceId (String)
Primary sort key userId (String)

#66

I found the problem!

The “services” table I created for the tutorial was in the eu region when it should have been in the us region. Coincidentally I already had a “services” table in the us-east-1 which had a “userid” field.

Sorry for wasting your time!
Cheers


#67

No worries. Thanks for reporting back.


#68

I am experiencing a similar error that @flocve encountered. I hope you can help

It responded with an error when I executed the following command
serverless invoke local --function create --path mocks/create-event.json

Serverless: INVOKING INVOKE
{ CredentialsError: Missing credentials in config
    at ClientRequest.<anonymous> (/Users/tuanle/workspace/labs/notes-app-api/node_modules/aws-sdk/lib/http/node.js:83:34)
    at Object.onceWrapper (events.js:313:30)
    at emitNone (events.js:106:13)
    at ClientRequest.emit (events.js:208:7)
    at Socket.emitTimeout (_http_client.js:706:34)
    at Object.onceWrapper (events.js:313:30)
    at emitNone (events.js:106:13)
    at Socket.emit (events.js:208:7)
    at Socket._onTimeout (net.js:410:8)
    at ontimeout (timers.js:498:11)
    at tryOnTimeout (timers.js:323:5)
    at Timer.listOnTimeout (timers.js:290:5)
  message: 'Missing credentials in config',
  code: 'CredentialsError',
  time: 2018-08-02T01:42:19.992Z,
  retryable: true,
  originalError: 
   { message: 'Could not load credentials from any providers',
     code: 'CredentialsError',
     time: 2018-08-02T01:42:19.992Z,
     retryable: true,
     originalError: 
      { message: 'Connection timed out after 1000ms',
        code: 'TimeoutError',
        time: 2018-08-02T01:42:19.992Z,
        retryable: true } } }
{
    "statusCode": 500,
    "headers": {
        "Access-Control-Allow-Origin": "*",
        "Access-Control-Allow-Credentials": true
    },
    "body": "{\"status\":false}"
}

~/.aws/config

[default]
region=us-west-2
source_profile=default
output=json

~/.aws/credentials

[default]
AWS_ACCESS_KEY_ID=XXXXXXXX
AWS_SECRET_ACCESS_KEY=XXXXXXXXX

output of env

...
AWS_CONFIG_FILE=/Users/tuanle/.aws/config
AWS_SHARED_CREDENTIALS_FILE=/Users/tuanle/.aws/credentials
...

** aws --version**

aws-cli/1.15.60 Python/3.7.0 Darwin/17.4.0 botocore/1.10.59

executing aws s3 ls returned S3 buckets fine

Note:

  • notes table is created in us-west-2 region (arn:aws:dynamodb:us-west-2:xxxxxx:table/notes)

Updated:
if I manually ran

export AWS_ACCESS_KEY_ID=xxx
export AWS_SECRET_ACCESS_KEY=xxx 

in my terminal, it works!

It looks like in my environment, AWS SDK does not read ~/.aws/config and ~/.aws/credentials files. Any solutions on how to fix this issue is much appreciated.


#69

Hmm that is weird. Are you on Windows btw?


#70

@jayair: No, I am using Mac terminal.


#71

Hello, I’m having an issue with the create function.

When I try to test the api by using the invoke command I get the following error:

Serverless Error ---------------------------------------
 
  Function "create" doesn't exist in this Service

I’ve copied the code over and checked to see if there were any discrepancies but couldn’t find anything. I’ve tried looking for similar errors in the forum but couldn’t see anything obvious.

Any help would be greatly appreciated!

Steve


#72

This is usually related to an indentation issue in your serverless.yml. Have you compared it to the one in the tutorial? Just make sure it is indented exactly the same way.


#73

Wow, didn’t realise indexing would have such an impact. Why is the .yml file so sensitive?!

I copied the .yml code over and then I also copied the refactored code because I thought I might as well skip ahead. Unfortunately I then get the following error. I know this is the same as someone else recently but the solution for them looked to be the serverless.yml file but I’ve already copied that and ensured it’s the same, so I’m at a loss to be honest.

{ ResourceNotFoundException: Requested resource not found
    at Request.extractError (/Users/stephenroberts/Documents/Serverless Stack/notes-app-api/node_modules/aws-sdk/lib/protocol/json.js:48:27)
    at Request.callListeners (/Users/stephenroberts/Documents/Serverless Stack/notes-app-api/node_modules/aws-sdk/lib/sequential_executor.js:105:20)
    at Request.emit (/Users/stephenroberts/Documents/Serverless Stack/notes-app-api/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
    at Request.emit (/Users/stephenroberts/Documents/Serverless Stack/notes-app-api/node_modules/aws-sdk/lib/request.js:683:14)
    at Request.transition (/Users/stephenroberts/Documents/Serverless Stack/notes-app-api/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/Users/stephenroberts/Documents/Serverless Stack/notes-app-api/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /Users/stephenroberts/Documents/Serverless Stack/notes-app-api/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/Users/stephenroberts/Documents/Serverless Stack/notes-app-api/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/Users/stephenroberts/Documents/Serverless Stack/notes-app-api/node_modules/aws-sdk/lib/request.js:685:12)
    at Request.callListeners (/Users/stephenroberts/Documents/Serverless Stack/notes-app-api/node_modules/aws-sdk/lib/sequential_executor.js:115:18)
    at Request.emit (/Users/stephenroberts/Documents/Serverless Stack/notes-app-api/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
    at Request.emit (/Users/stephenroberts/Documents/Serverless Stack/notes-app-api/node_modules/aws-sdk/lib/request.js:683:14)
    at Request.transition (/Users/stephenroberts/Documents/Serverless Stack/notes-app-api/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/Users/stephenroberts/Documents/Serverless Stack/notes-app-api/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /Users/stephenroberts/Documents/Serverless Stack/notes-app-api/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/Users/stephenroberts/Documents/Serverless Stack/notes-app-api/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/Users/stephenroberts/Documents/Serverless Stack/notes-app-api/node_modules/aws-sdk/lib/request.js:685:12)
    at Request.callListeners (/Users/stephenroberts/Documents/Serverless Stack/notes-app-api/node_modules/aws-sdk/lib/sequential_executor.js:115:18)
    at callNextListener (/Users/stephenroberts/Documents/Serverless Stack/notes-app-api/node_modules/aws-sdk/lib/sequential_executor.js:95:12)
    at IncomingMessage.onEnd (/Users/stephenroberts/Documents/Serverless Stack/notes-app-api/node_modules/aws-sdk/lib/event_listeners.js:294:13)
    at IncomingMessage.emit (events.js:187:15)
    at IncomingMessage.EventEmitter.emit (domain.js:442:20)
    at endReadableNT (_stream_readable.js:1081:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
  message: 'Requested resource not found',
  code: 'ResourceNotFoundException',
  time: 2018-08-08T17:59:28.813Z,
  requestId: 'E9J4SBA4UMFHLV29TPM35CCT9VVV4KQNSO5AEMVJF66Q9ASUAAJG',
  statusCode: 400,
  retryable: false,
  retryDelay: 3.1913294901572353 }
{
    "statusCode": 500,
    "headers": {
        "Access-Control-Allow-Origin": "*",
        "Access-Control-Allow-Credentials": true
    },
    "body": "{\"status\":false}"
}

#74

Yeah it is very annoying.

This ResourceNotFoundException issue is probably because it can’t find your DynamoDB table. Make sure it is named correctly and it exists in the right region.


#75

Omg it was because my sort ket was ‘notesId’ instead of ‘noteId’ :expressionless::expressionless::expressionless:

Thank you for all your help Jay, really appreciate it.


#76

Hello! I’m not sure if this is the best chapter for me to post this, but hopefully it’ll be useful enough!

mmits.
In this commit https://github.com/AnomalyInnovations/serverless-stack-demo-api/commit/4e6cd44a72ceb195cfebbc035ded75dd3bedd515 the TableName is changed.

I had built up my own api by following the walkthrough.
I was curious as to what would happen if I ran the following code:

_export async function main(event, context, callback) {_
_    const data = JSON.parse(event.body);_
_    console.log("initial test on process");_
_    console.log(process);_
_    console.log("initial test on process.env");_
_    console.log(process.env);_
_    console.log("now testing table name");_
_    console.log(process.env.tableName);_
_    console.log("end testing");_
_    const params = {_
_        **TableName: "notes",**_

I looked in my lambda logs from CloudWatch. For me, process.env.tableName wasn’t found! And I didn’t find much that looked very helpful in process.env.

Does anyone know why this works for the latest build, but not for my build which came from following the walkthrough?


#77

here’s the output from said code:

process {
title: '/var/lang/bin/node',
version: 'v8.10.0',
moduleLoadList:
[ 'Binding contextify',
'Binding natives',
'Binding config',
'NativeModule events',
'Binding async_wrap',
'Binding icu',
'NativeModule util',
'NativeModule internal/errors',
'NativeModule internal/encoding',
'NativeModule internal/util',
'Binding util',
'Binding constants',
'NativeModule internal/util/types',
'Binding buffer',
'NativeModule buffer',
'NativeModule internal/buffer',
'Binding uv',
'NativeModule internal/process',
'NativeModule internal/process/warning',
'NativeModule internal/process/next_tick',
'NativeModule internal/async_hooks',
'NativeModule internal/process/promises',
'NativeModule internal/process/stdio',
'Binding performance',
'NativeModule perf_hooks',
'NativeModule internal/linkedlist',
'NativeModule internal/trace_events_async_hooks',
'Binding trace_events',
'NativeModule async_hooks',
'NativeModule internal/inspector_async_hook',
'Binding inspector',
'NativeModule timers',
'Binding timer_wrap',
'NativeModule assert',
'NativeModule module',
'NativeModule internal/module',
'NativeModule internal/url',
'NativeModule internal/querystring',
'NativeModule querystring',
'Binding url',
'NativeModule vm',
'NativeModule fs',
'NativeModule path',
'Binding fs',
'NativeModule stream',
'NativeModule internal/streams/legacy',
'NativeModule _stream_readable',
'NativeModule internal/streams/BufferList',
'NativeModule internal/streams/destroy',
'NativeModule _stream_writable',
'NativeModule _stream_duplex',
'NativeModule _stream_transform',
'NativeModule _stream_passthrough',
'Binding fs_event_wrap',
'NativeModule internal/fs',
'NativeModule internal/loader/Loader',
'NativeModule internal/loader/ModuleWrap',
'Internal Binding module_wrap',
'NativeModule internal/loader/ModuleMap',
'NativeModule internal/loader/ModuleJob',
'NativeModule internal/safe_globals',
'NativeModule internal/loader/ModuleRequest',
'NativeModule url',
'NativeModule internal/loader/search',
'NativeModule console',
'Binding tty_wrap',
'NativeModule net',
'NativeModule internal/net',
'Binding cares_wrap',
'Binding tcp_wrap',
'Binding pipe_wrap',
'Binding stream_wrap',
'NativeModule dns',
'NativeModule repl',
'NativeModule readline',
'NativeModule string_decoder',
'NativeModule internal/readline',
'NativeModule domain',
'NativeModule crypto',
'Binding crypto',
'NativeModule internal/streams/lazy_transform',
'NativeModule os',
'NativeModule internal/os',
'Binding os' ],
versions:
{ http_parser: '2.7.0',
node: '8.10.0',
v8: '6.2.414.50',
uv: '1.19.1',
zlib: '1.2.11',
ares: '1.10.1-DEV',
modules: '57',
nghttp2: '1.25.0',
openssl: '1.0.2n',
icu: '60.1',
unicode: '10.0',
cldr: '32.0',
tz: '2017c' },
arch: 'x64',
platform: 'linux',
release:
{ name: 'node',
lts: 'Carbon',
sourceUrl: 'https://nodejs.org/download/release/v8.10.0/node-v8.10.0.tar.gz',
headersUrl: 'https://nodejs.org/download/release/v8.10.0/node-v8.10.0-headers.tar.gz' },
argv:
[ '/var/lang/bin/node',
'/var/runtime/node_modules/awslambda/index.js' ],
execArgv:
[ '--expose-gc',
'--max-semi-space-size=51',
'--max-old-space-size=922' ],
env:
{ PATH: '/var/lang/bin:/usr/local/bin:/usr/bin/:/bin',
LANG: 'en_US.UTF-8',
TZ: ':UTC',
LD_LIBRARY_PATH: '/var/lang/lib:/lib64:/usr/lib64:/var/runtime:/var/runtime/lib:/var/task:/var/task/lib',
LAMBDA_TASK_ROOT: '/var/task',
LAMBDA_RUNTIME_DIR: '/var/runtime',
AWS_REGION: 'us-east-1',
AWS_DEFAULT_REGION: 'us-east-1',
AWS_LAMBDA_LOG_GROUP_NAME: '/aws/lambda/notes-app-api-prod-update',
AWS_LAMBDA_LOG_STREAM_NAME: 'warghlblarghle',
AWS_LAMBDA_FUNCTION_NAME: 'notes-app-api-prod-update',
AWS_LAMBDA_FUNCTION_MEMORY_SIZE: '1024',
AWS_LAMBDA_FUNCTION_VERSION: '$LATEST',
_AWS_XRAY_DAEMON_ADDRESS: 'warghlblarghle',
_AWS_XRAY_DAEMON_PORT: 'warghlblarghle',
AWS_XRAY_DAEMON_ADDRESS: 'warghlblarghle',
AWS_XRAY_CONTEXT_MISSING: 'LOG_ERROR',
_X_AMZN_TRACE_ID: 'warghlblarghle',
AWS_EXECUTION_ENV: 'AWS_Lambda_nodejs8.10',
_HANDLER: 'update.main',
NODE_PATH: '/var/runtime:/var/task:/var/runtime/node_modules',
AWS_ACCESS_KEY_ID: 'warghlblarghle',
AWS_SECRET_ACCESS_KEY: 'warghlblarghle',
AWS_SESSION_TOKEN: 'warghlblarghle' },
pid: 1,
features:
{ debug: false,
uv: true,
ipv6: true,
tls_npn: true,
tls_alpn: true,
tls_sni: true,
tls_ocsp: true,
tls: true },
ppid: 0,
execPath: '/var/lang/bin/node',
debugPort: 9229,
_startProfilerIdleNotifier: [Function: _startProfilerIdleNotifier],
_stopProfilerIdleNotifier: [Function: _stopProfilerIdleNotifier],
_getActiveRequests: [Function: _getActiveRequests],
_getActiveHandles: [Function: _getActiveHandles],
reallyExit: [Function: reallyExit],
abort: [Function: abort],
chdir: [Function: chdir],
cwd: [Function: cwd],
umask: [Function: umask],
getuid: [Function: getuid],
geteuid: [Function: geteuid],
setuid: [Function: setuid],
seteuid: [Function: seteuid],
setgid: [Function: setgid],
setegid: [Function: setegid],
getgid: [Function: getgid],
getegid: [Function: getegid],
getgroups: [Function: getgroups],
setgroups: [Function: setgroups],
initgroups: [Function: initgroups],
_kill: [Function: _kill],
_debugProcess: [Function: _debugProcess],
_debugPause: [Function: _debugPause],
_debugEnd: [Function: _debugEnd],
hrtime: [Function: hrtime],
cpuUsage: [Function: cpuUsage],
dlopen: [Function: dlopen],
uptime: [Function: uptime],
memoryUsage: [Function: memoryUsage],
binding: [Function: binding],
_linkedBinding: [Function: _linkedBinding],
_events:
{ newListener: [Function],
removeListener: [Function],
warning: [Function],
uncaughtException: [Function],
beforeExit: [Function] },
_rawDebug: [Function],
_eventsCount: 5,
domain: [Getter/Setter],
_maxListeners: undefined,
_fatalException: [Function],
_exiting: false,
assert: [Function],
config:
{ target_defaults:
{ cflags: [],
default_configuration: 'Release',
defines: [],
include_dirs: [],
libraries: [] },
variables:
{ asan: 0,
coverage: false,
debug_devtools: 'node',
debug_http2: false,
debug_nghttp2: false,
force_dynamic_crt: 0,
gas_version: '2.25',
host_arch: 'x64',
icu_data_file: 'icudt60l.dat',
icu_data_in: '../../deps/icu-small/source/data/in/icudt60l.dat',
icu_endianness: 'l',
icu_gyp_path: 'tools/icu/icu-generic.gyp',
icu_locales: 'en,root',
icu_path: 'deps/icu-small',
icu_small: true,
icu_ver_major: '60',
llvm_version: 0,
node_byteorder: 'little',
node_enable_d8: false,
node_enable_v8_vtunejit: false,
node_install_npm: true,
node_module_version: 57,
node_no_browser_globals: false,
node_prefix: '/local/p4clients/pkgbuild-pUJwV/workspace/src/LambdaLangNodeJs-8-10/build/private/install',
node_release_urlbase: '',
node_shared: false,
node_shared_cares: false,
node_shared_http_parser: false,
node_shared_libuv: false,
node_shared_nghttp2: false,
node_shared_openssl: false,
node_shared_zlib: false,
node_tag: '',
node_use_bundled_v8: true,
node_use_dtrace: false,
node_use_etw: false,
node_use_lttng: false,
node_use_openssl: true,
node_use_perfctr: false,
node_use_v8_platform: true,
node_without_node_options: false,
openssl_fips: '',
openssl_no_asm: 0,
shlib_suffix: 'so.57',
target_arch: 'x64',
uv_parent_path: '/deps/uv/',
uv_use_dtrace: false,
v8_enable_gdbjit: 0,
v8_enable_i18n_support: 1,
v8_enable_inspector: 1,
v8_no_strict_aliasing: 1,
v8_optimized_debug: 0,
v8_promise_internal_field_count: 1,
v8_random_seed: 0,
v8_trace_maps: 0,
v8_use_snapshot: true,
want_separate_host_toolset: 0 } },
emitWarning: [Function],
nextTick: [Function: nextTick],
_tickCallback: [Function: _tickDomainCallback],
_tickDomainCallback: [Function: _tickDomainCallback],
stdout: [Getter],
stderr: [Getter],
stdin: [Getter],
openStdin: [Function],
exit: [Function],
kill: [Function],
_immediateCallback: [Function: processImmediate],
argv0: '/var/lang/bin/node',
mainModule:
Module {
id: '.',
exports: {},
parent: null,
filename: '/var/runtime/node_modules/awslambda/index.js',
loaded: true,
children: [ [Object], [Object] ],
paths:
[ '/var/runtime/node_modules/awslambda/node_modules',
'/var/runtime/node_modules',
'/var/node_modules',
'/node_modules' ] },
emit: [Function] }

#78

Hey John,

So it depends which step of the tutorial you are on. The process.env.tableName portion comes from the Part II of the tutorial where we use the generated table name based on the environment you are deploying to.

If you are roughly following along then in the first part of the tutorial, then it should look like this:


#79

Ah, I see!
Part 1 gave me a lot to play around in, so I wanted to stick around there for a bit. That being said, perhaps I’ll go to move on to part 2 though, and see what’s there:)

Thank you!


#80

serverless invoke local --function create --path mocks/create-event.json

I dont see anything showing up on my terminal when I ran this invoke this ?
Any ideas ?