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

Implement notify-only support #59

Closed jantman closed 3 years ago

jantman commented 3 years ago

Description

This PR implements notify_only support for policies, which can also be used in defaults.yml to put an entire account into notify-only mode. This is controlled by a notify_only boolean top-level policy key, which policygen then handles and strips out when generating the final custodian YAML files.

The current functionality of notify-only is as follows:

Testing Done

  1. Complete unit test coverage.
  2. Ran a dry-run internally on one of our accounts. Ping me on Slack, or see the card for this, for a link to the diff.
codecov-io commented 3 years ago

Codecov Report

Merging #59 (073983a) into master (52847cd) will increase coverage by 2.67%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #59      +/-   ##
==========================================
+ Coverage   57.98%   60.65%   +2.67%     
==========================================
  Files           8        9       +1     
  Lines        1397     1492      +95     
  Branches      264      294      +30     
==========================================
+ Hits          810      905      +95     
  Misses        586      586              
  Partials        1        1              
Impacted Files Coverage Δ
manheim_c7n_tools/notifyonly.py 100.00% <100.00%> (ø)
manheim_c7n_tools/policygen.py 99.76% <100.00%> (+<0.01%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 52847cd...073983a. Read the comment docs.