Skip to content

How to validate policies within a directory? #8548

Answered by ajkerrigan
princeanire asked this question in General
Discussion options

You must be logged in to vote

Yeah @benipeled 's answer is a good one. You can also use something like xargs in helpful ways. To validate all YAML files in a given policy directory for instance:

find /path/to/my/policies -iname "*.y*ml" | xargs custodian validate

Or maybe if you're in a git repository of policies and want to validate only policies that differ from what's on main:

git diff --name-only main.. | xargs custodian validate

That said, thanks for asking this question! I occasionally still use this simpler command:

custodian validate /path/to/my/policies/*.y*ml

Which works fine if all of your policies are valid, but it can report errors multiple times in a way that is misleading. But that feels like a bug we s…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@princeanire
Comment options

@ajkerrigan
Comment options

Answer selected by princeanire
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants