manheim / manheim-c7n-tools

Manheim's Cloud Custodian (c7n) wrapper package, policy generator, runner, and supporting tools.
https://manheim-c7n-tools.readthedocs.io/
Apache License 2.0
45 stars 25 forks source link

Policygen warning for missing mode items #22

Closed jantman closed 4 years ago

jantman commented 4 years ago

See #21 for background... right now, policygen leaves the mode section alone (except for tags) if it has a type other than periodic. If required configuration items are missing, this results in policygen successfully generating the configs, but then custodian itself (specifically in mu.py) fails with an AssertionError because of the missing configuration items.

Add some logic to policygen to fail with a helpful error if required configuration is missing from the specified mode.

jantman commented 4 years ago

c7n.mu doesn't expose any easy way to determine which configuration items are needed; in fact, the error that caused #21 comes from an assert in the Lambda creation code. Closing this, as there's no easy/reliable way to enforce it.