99designs / aws-vault

A vault for securely storing and accessing AWS credentials in development environments
MIT License
8.53k stars 822 forks source link

Support for noninteractive use (disable prompting) #1169

Closed quodlibetor closed 1 year ago

quodlibetor commented 1 year ago

I would like to use a script that I've written for interactive use in a noninteractive context, where I would prefer aws-vault exec to bail with an error message if I haven't got the key store unlocked, instead of hanging forever. Is there existing functionality that would allow that, or would you be interested in a PR implementing something like --prompt=exit?

mtibben commented 1 year ago

You could specify --mfa-token=000000 for a fast failure?

quodlibetor commented 1 year ago

That doesn't work for SSO at least:

$ aws-vault exec myprofile --mfa-token=000000000 -- echo foo
Opening the SSO authorization page in your default browser (use Ctrl-C to abort)
https://device.sso.us-west-2.amazonaws.com/?user_code=CODE
github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.