Last active
October 29, 2021 23:05
-
-
Save ianmaddox/8da26b08a05d9552842c2b594b6a2432 to your computer and use it in GitHub Desktop.
GCP Secret Manager getsecret.sh
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 | |
PROJECTID=sm-demo-330516 | |
if [ -z "$1" ]; then | |
echo "Usage:" | |
echo " $0 SECRET_NAME" | |
exit | |
fi | |
SEC="$(hostname)-$1" | |
gcloud beta secrets versions access latest --project=$PROJECTID --secret=$SEC | xargs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment