Skip to content

Instantly share code, notes, and snippets.

@mfilej
Created April 4, 2024 09:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mfilej/3faa461247bbd8a1d41fd146f1004ce2 to your computer and use it in GitHub Desktop.
Save mfilej/3faa461247bbd8a1d41fd146f1004ce2 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -euo pipefail
secret=$(aws secretsmanager list-secrets | jq -r '.SecretList | .[].ARN' | fzf)
if [ -z "$secret" ]; then
exit
fi
json=$(aws secretsmanager get-secret-value --secret-id="$secret")
if [ "${1:-}" = "--json" ]; then
echo "$json"
else
echo "$json" | jq -r .SecretString
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment