Created
April 4, 2024 09:54
-
-
Save mfilej/3faa461247bbd8a1d41fd146f1004ce2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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