How to run AWS CLI commands with whzbox exec¶
Use whzbox exec aws when you want to run a process with the cached sandbox environment injected.
Prerequisites¶
- An unexpired cached AWS sandbox
- The
whzboxbinary on yourPATH - The AWS CLI installed if you are running AWS CLI examples
Steps¶
1. Run a direct argv command¶
This runs the child process without going through a shell.
2. Run a shell string¶
With -s, whzbox runs /bin/sh -c <command>.
3. Open an interactive subshell¶
With no command arguments, whzbox launches $SHELL or /bin/sh if $SHELL is unset.
Verification¶
To inspect the injected environment directly, run:
You should see:
AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYAWS_REGIONAWS_DEFAULT_REGION
Troubleshooting¶
Problem: whzbox exec says there is no active sandbox¶
exec only reads the local sandbox cache. Create a sandbox first:
Problem: -s rejects the command line¶
--shell takes exactly one command argument. Wrap the whole shell command in one quoted string.