Hi, I'm trying to store environment variables in t...
# help
b
Hi, I'm trying to store environment variables in the SSM Parameter store, as suggested on the sst website. Interesting problem, I've set up a function to read parameters from the paremeter store and return an object with key:value pairs rather than the list of more complex objects AWS returns. Anyway, when I run this function from a lambda it works fine, but when I run it from index.ts to pull in vars I need to initiate the stack, it runs fine, but all of my variables come back in the 'InvalidParameters' part of the response, even though they do exist. I thought it might be a permissions issue, but this is different from the behavior I was seeing before I granted permission, it doesn't error out just returns as invalid.
Doh! Never mind, turns out I wasn't setting the region when I called new AWS.SSM(), so it was trying to grab from the wrong parameter store!
t
btw we generally don't recommend loading SSM in this way and instead loading at runtime in the lambda
we're building some libraries to make this simple
this approach works fine but you kind of lose the purpose of storing stuff in SSM since this will show up as plaintext in several places - basically the equivalent of hardcoding it in code