I am not sure I follow the architecture you’re using. It sounds like you have an always-on machine that you can shell into, and in that machine, DYNAMIC_KEY is set as an env var correctly. In that machine you want to spawn a new machine using the API, but you want to pass DYNAMIC_KEY into the new machine. Does that sound right?
If that is correct, what sort of script are you using in the first machine? If this is Bash or some similar shell, then do your echo ${DYNAMIC_KEY} in the script to ensure it has inherited the key-value pair from the shell environment.
Hello @purplegrape! Thanks for your question, and thanks a lot @halfer for sharing your thoughts on this!
Are you perhaps looking for build secrets? These secrets would be available during build time of an app–right around the time you do a fly deploy. It’s possible that you’ve set your DYNAMIC_KEY as a Fly Secret–though these are available during runtime, they’re not up for grabs during build time.