Hey everyone, I have little trouble setting up con...
# typescript
Hey everyone, I have little trouble setting up config secrets. I'm getting
Secret outputs cannot be captured by a closure.
error. AFAIK, closure here means the code that gets serialized into Lambda? How am I supposed to access config secrets?
Instead of using the stack config secret directly inside your Lambda, you should create an AWS Secrets Manager resource and put the secret in there. Then, in your Lambda you can use the AWS SDK object to construct a Secrets Manager client in order to retrieve the secret. You could also store the secret in AWS Systems Manager (SSM). There is a price difference between the two. You may also want to review if the config property in question really needs to be a secret before you do the additional work.
👍 1
Thanks 🙂