DEV Community

Discussion on: How to use secrets manager in AWS Lambda( Node JS )

Collapse
 
carlosdiazs profile image
carlosdiazs

Hello Avinash,

I am trying to test your code from Lambda test tab and I'm getting undefined as result on console.log(apiValue);

Maybe you could help me.

Thank you!

Collapse
 
nivohayon profile image
Niv Ohayon

You probably copy pasted the code snippet.
your config object should be something like this:
const config = {
region: region,
credentials: {
accessKeyId: process.env.ACCESS_KEY_ID,
secretAccessKey: process.env.SECRET_ACCESS_KEY,
},
}

Collapse
 
movingelectrons profile image
Jerome Stonebridge

?Really? We have to use a secret to get access to the secrets manager? Does that not nullify the entire point of using the secrets manager in the first place??...

Collapse
 
avinashdalvi_ profile image
Avinash Dalvi • Edited

Drop message on twitter handle @avinashdalvi_ will checkout code.