2

Here is my code

var dynamodb = new AWS.DynamoDB();
dynamodb.batchGetItem(params, function(err, data) {
    if (err) console.log(err, err.stack); // an error occurred
    else console.log(data); // successful response
});

and I got this error

{
    message: 'Could not load credentials from any providers',
    errno: 'ETIMEDOUT',
    code: 'CredentialsError',
    syscall: 'connect',
    address: 'x.x.x.x',
    port: 80,
    time: 2019-03-13T07:59:34.279Z,
    originalError: {
        errno: 'ETIMEDOUT',
        code: 'ETIMEDOUT',
        syscall: 'connect',
        address: 'x.x.x.x',
        port: 80,
        message: 'connect ETIMEDOUT x.x.x.x:80'
    }
}

I am new to AWS. I thought calling DynamoDB with Lambda do not need access and secret key. Is that correct? I also grant full DynamoDB access permission role. What causes this problem?

1 Answer 1

2

I've faced the same problem here. The reason is your Lambda function seems inside a VPC and the DynamoDB isn't. Try removing the VPC in Network part of the settings and it should be solved.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.