Is it Possible to Create a Datastore with Environment Variable Names to Simplify Scripts Across Different Systems?

This topic was automatically generated from Slack. You can find the original thread here.

Hey There All,

Wondering if it is possible to create a datastore with environment variable names, and then call the datastore for particular values (which are the environment variable names), and then use them to call the environment variables?

I have alot of different systems, and would like to reduce the scripts to fire them, by given it a key to get the details from the datastore, and direct it to the environment variables (if that makes sense)

You should definitely be able to do something like that (IIUC).

The data store is basically a key-value store. Keys are strings, and values can be pretty much “anything” (including the name of another key, ad infinitum).

As a dummy example, you could have a key key1, which contains the value key2, and a key key2, which contains the value key3, and so on.

And then you can use any of these keys/values to retrieve env vars as usual (something like process.env[key]), or vice versa.

awesome, I was thinking of effectively catching a Post or such and then based on the message setting a variable, pulling that from the datastore (as its the key), then using values in the datastore to get enviro variables, instead of having to hard code the variables in.

just needed to bounce the idea of someone :slightly_smiling_face: thanks for your thoughts, pretty much my thinking :slightly_smiling_face: