Skip to content

Instantly share code, notes, and snippets.

@micimize
Created April 8, 2020 15:41
Show Gist options
  • Save micimize/d310d0458b58951efb3cdedcf690b39d to your computer and use it in GitHub Desktop.
Save micimize/d310d0458b58951efb3cdedcf690b39d to your computer and use it in GitHub Desktop.
snipped I might later use as part of an idempotent google cloud deployment script
description=$(gcloud sql instances describe $DB 2>&1)
if [ $? -ne 0 ]
then
if [[ $description == *HTTPError* ]]
then
gcloud sql instances create $ \
--database-version=POSTGRES_12 \
--cpu=1 --memory=614MB \
--region=us-central1
fi
else
echo "Error, could not describe db: \n$description"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment