elhaz exec¶
Synopsis¶
elhaz exec [OPTIONS] -- COMMAND [ARGS]...
Description¶
Execute a one-off command with AWS credentials injected as environment variables. The following variables are set for the child process:
AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYAWS_SESSION_TOKEN
If no active session exists for the named config, elhaz adds it to the daemon automatically before running the command.
The -- separator is required to distinguish elhaz options from the
command being executed.
Options¶
--name,-nNAMEConfig name. If omitted, an interactive selection prompt is shown.
--helpShow help message and exit.
Examples¶
Run an AWS CLI command:
elhaz exec -n prod -- aws s3 ls
Copy a file from S3:
elhaz exec -n prod -- aws s3 cp s3://my-bucket/file.txt .
Run any arbitrary command with credentials in scope:
elhaz exec -n prod -- python my_script.py
See also
elhaz shell — for running multiple commands in a persistent credential environment.