Get parameter synchronously for v3 aws-sdk #4519
-
I am using aws-sdk/client-ssm library for v3 version of aws-sdk. I am calling function get parameter but it is calling asynchronously. Is there any synchronous way of getting parameter for new javascript v3 syntax and library because aws-sdk is going out of support in dec2023. And we are getting errors or warnings for this library. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi @anilgarg88, In both JS SDK v2, and v3 the only way to make service calls is asynchronously. You can Synchronous "looking" code by running operations with Async / Await however its not truly synchronous. If I can get more context about your use case I might be able to provide a solution for you. |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
Hi @anilgarg88,
Im not really familiar with
aws-param-store
. But using a 3rd party tool to manage AWS secrets is probably not the best solution.Are you sure about this?
From what I can see you are telling the SDK: "fetch me this secret so I can then use to call the SDK with" Which obviously will cause an error.
You need to run your lambda with your credentials already wired up to make calls to the SDK (those env variables need to be injected before the function fires) you can learn more about how to do that by follow…