Skip to content

Instantly share code, notes, and snippets.

@jayers99
Last active February 14, 2019 05:22
Show Gist options
  • Save jayers99/ff5fc5c49623a8ed802f4ce9c7c44959 to your computer and use it in GitHub Desktop.
Save jayers99/ff5fc5c49623a8ed802f4ce9c7c44959 to your computer and use it in GitHub Desktop.
scan terraform files to find duplicate policy names
grep -ir --no-filename --include \*.tf --exclude-dir=.terraform --exclude-dir=.git -P 'name\s+=\s+\"\$\{var\.\w+\}[\w\-]*\-policy"' | sed 's/\s*name\s*=\s*//' | sort | uniq -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment