Skip to content

Instantly share code, notes, and snippets.

@toshke
Created February 21, 2020 05:37
Show Gist options
  • Save toshke/ee2458e1d14871289b636a300e8aae7f to your computer and use it in GitHub Desktop.
Save toshke/ee2458e1d14871289b636a300e8aae7f to your computer and use it in GitHub Desktop.
Validate all cloudformation templates
#!/usr/bin/env bash
for f in *.yaml; do
printf "Check ${f}..."
aws cloudformation validate-template --template-body "file://${f}" > /dev/null 2>&1
if [ "$?" != "0" ]; then
echo "\n${f} failed, run following for details"
echo " aws cloudformation validate-template --template-body file://${f}\n\n"
exit 1
fi
printf " [OK]\n"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment