You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Lamba runs but nothing is happening with the code, no errors are reported and nothing in the logs. I'm running the Lambda via the Test button in the web interface which should pass in a dummy event but I can't see where this code needs any of the environment vars it would get from running it in any other way and again its not complaining about anything so I think that should be ok?
What am I doing wrong?
var copy = require('copy-dynamodb-table').copy;
var globalAWSConfig = {
accessKeyId: 'MYKEY',
secretAccessKey: 'MYSECRET',
region: 'eu-west-1'
};
function copyTable( from, to ) {
console.info( "Copying table " + from + " to " + to );
copy({
config: globalAWSConfig,
source: {
tableName: from, // required
},
destination: {
tableName: to, // required
},
log: true, // default false
create : true // create destination table if not exist
},
function (err, result) {
if (err) {
console.log(err);
}
console.log("Result", result );
});
console.info( "Done?");
}
exports.handler = async (event) => {
console.info( event );
copyTable( "my-source-table-dev", "my-target-table-live" );
const response = {
statusCode: 200,
body: JSON.stringify('Hello from Lambda!'),
};
return response;
};
The text was updated successfully, but these errors were encountered:
I've setup a Lambda to run this but I must be doing something wrong. I've hardcoded the API keys and secret in to my code (taken from the AWS Console https://aws.amazon.com/blogs/security/how-to-find-update-access-keys-password-mfa-aws-management-console/).
The Lamba runs but nothing is happening with the code, no errors are reported and nothing in the logs. I'm running the Lambda via the Test button in the web interface which should pass in a dummy event but I can't see where this code needs any of the environment vars it would get from running it in any other way and again its not complaining about anything so I think that should be ok?
What am I doing wrong?
The text was updated successfully, but these errors were encountered: