Fetch running instance environment

Is there a way I could fetch an instance’s environment state in one command? For example, see which environment variables it has set(Just a list not the actual values).

A simple way would be to fetch the output of this shell command env | cut -f1 -d=

Perhaps you meant from outside the instance. Indeed I was wanting the same thing today.

Yeah I meant from outside. I have an app that is not reflecting a configuration flag I set in [env] section. So I wanted to see what the apps is seeing.

This command also works with the latest CLI:

fly ssh console -C "env"

These commands can’t use pipes or anything, so I’ve been wrapping what I need (like a production app console) in scripts in myapp/bin

Does the process for turning an image into a firecracker instance add anything? Cause otherwise this wouldn’t work for me seeing us I’m running a scratch image.

Ah, I don’t think it adds anything. But any other minimal image should support the env command if you’re just trying to debug the inclusion of env vars.

I was just thinking yesterday of adding a command to fetch all env vars + secrets (without the values, we don’t even have access to that from our API) and display them.

I might just do that Today!

1 Like