Have to test lambda several times before it works

Multi tool use
up vote
1
down vote
favorite
I have a lambda function that I am playing around with. It inserts very basic information into a DynamoDB table. Here is the code:
'use strict';
const alexaSkillKit = require('alexa-skill-kit');
const AWS = require('aws-sdk');
function binDaySkill(event, context, callback) {
alexaSkillKit(event, context, (message) => {
let params = {
Item: {
user_id: '123',
some_data: 'some data here'
},
TableName: 'my_table'
};
let documentClient = new AWS.DynamoDB.DocumentClient();
documentClient.put(params, function (err, data) {
if (err) {
callback("Error", err);
} else {
callback(null, data);
}
});
});
}
The issue I am having is that it only sometimes saves the data in the DB. I have to click test 5-10 times before it does anything.
Can anyone help with what might be causing this?
node.js lambda amazon-dynamodb
add a comment |
up vote
1
down vote
favorite
I have a lambda function that I am playing around with. It inserts very basic information into a DynamoDB table. Here is the code:
'use strict';
const alexaSkillKit = require('alexa-skill-kit');
const AWS = require('aws-sdk');
function binDaySkill(event, context, callback) {
alexaSkillKit(event, context, (message) => {
let params = {
Item: {
user_id: '123',
some_data: 'some data here'
},
TableName: 'my_table'
};
let documentClient = new AWS.DynamoDB.DocumentClient();
documentClient.put(params, function (err, data) {
if (err) {
callback("Error", err);
} else {
callback(null, data);
}
});
});
}
The issue I am having is that it only sometimes saves the data in the DB. I have to click test 5-10 times before it does anything.
Can anyone help with what might be causing this?
node.js lambda amazon-dynamodb
have you checked CloudWatch for possible errors?
– SET
5 hours ago
Can you please share your test event payload data. Are you using hard-coded value for user_id & some_data (user_id:'123', some_data: 'some data here') in your snippet ?
– Ashok JayaPrakash
5 hours ago
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have a lambda function that I am playing around with. It inserts very basic information into a DynamoDB table. Here is the code:
'use strict';
const alexaSkillKit = require('alexa-skill-kit');
const AWS = require('aws-sdk');
function binDaySkill(event, context, callback) {
alexaSkillKit(event, context, (message) => {
let params = {
Item: {
user_id: '123',
some_data: 'some data here'
},
TableName: 'my_table'
};
let documentClient = new AWS.DynamoDB.DocumentClient();
documentClient.put(params, function (err, data) {
if (err) {
callback("Error", err);
} else {
callback(null, data);
}
});
});
}
The issue I am having is that it only sometimes saves the data in the DB. I have to click test 5-10 times before it does anything.
Can anyone help with what might be causing this?
node.js lambda amazon-dynamodb
I have a lambda function that I am playing around with. It inserts very basic information into a DynamoDB table. Here is the code:
'use strict';
const alexaSkillKit = require('alexa-skill-kit');
const AWS = require('aws-sdk');
function binDaySkill(event, context, callback) {
alexaSkillKit(event, context, (message) => {
let params = {
Item: {
user_id: '123',
some_data: 'some data here'
},
TableName: 'my_table'
};
let documentClient = new AWS.DynamoDB.DocumentClient();
documentClient.put(params, function (err, data) {
if (err) {
callback("Error", err);
} else {
callback(null, data);
}
});
});
}
The issue I am having is that it only sometimes saves the data in the DB. I have to click test 5-10 times before it does anything.
Can anyone help with what might be causing this?
node.js lambda amazon-dynamodb
node.js lambda amazon-dynamodb
asked 5 hours ago


Wildcard27
753928
753928
have you checked CloudWatch for possible errors?
– SET
5 hours ago
Can you please share your test event payload data. Are you using hard-coded value for user_id & some_data (user_id:'123', some_data: 'some data here') in your snippet ?
– Ashok JayaPrakash
5 hours ago
add a comment |
have you checked CloudWatch for possible errors?
– SET
5 hours ago
Can you please share your test event payload data. Are you using hard-coded value for user_id & some_data (user_id:'123', some_data: 'some data here') in your snippet ?
– Ashok JayaPrakash
5 hours ago
have you checked CloudWatch for possible errors?
– SET
5 hours ago
have you checked CloudWatch for possible errors?
– SET
5 hours ago
Can you please share your test event payload data. Are you using hard-coded value for user_id & some_data (user_id:'123', some_data: 'some data here') in your snippet ?
– Ashok JayaPrakash
5 hours ago
Can you please share your test event payload data. Are you using hard-coded value for user_id & some_data (user_id:'123', some_data: 'some data here') in your snippet ?
– Ashok JayaPrakash
5 hours ago
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53204442%2fhave-to-test-lambda-several-times-before-it-works%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
DojEMTXCa8 IiOxTDhPBAiDzKvOFd1iXkS,dGsD6BXc7TD,Zo
have you checked CloudWatch for possible errors?
– SET
5 hours ago
Can you please share your test event payload data. Are you using hard-coded value for user_id & some_data (user_id:'123', some_data: 'some data here') in your snippet ?
– Ashok JayaPrakash
5 hours ago