manheim_c7n_tools.notifyonly module¶
- class manheim_c7n_tools.notifyonly.NotifyOnlyPolicy(policy: dict)[source]¶
Bases:
objectThis class converts a c7n policy to a “notify only” policy. See Notify-Only Option for Policies for details.
IMPORTANT: When making changes to this class, be SURE to update Notify-Only Option for Policies in the documentation.
- _fix_actions(original: List) List[source]¶
Given a list of actions from a policy, return a new list of notify-only actions.
notifyactions will be included unmodifiedmark/tagactions will be passed through_fix_tag_action()and the result includedmark-for-opactions will be passed through_fix_mark_for_op_action()and the result includedremove-tag/unmark/untagactions will be passed through_fix_untag_action()and the result includedall other actions will be REMOVED
- _fix_comment(comment: str) str[source]¶
Convert a policy comment/comments/description to a notify only version, by prefixing it with the string “NOTIFY ONLY: “.
- _fix_filters(filters: List) List[source]¶
Given a list of filters from a policy, update them for any tagging changes.
- _fix_mark_for_op_action(item: dict) dict[source]¶
Fix a
mark-for-opaction for notify-only operation.The string
notify-onlywill be appended to the tag name used.
- _fix_notify_action(item: dict) dict[source]¶
Fix a
notifyaction for notify-only operation.If the
violation_desckey is present, its value will be prefixed withNOTIFY ONLY: ``. If the ``action_desckey is present, its value will be prefixed with the stringin the future (currently notify-only).
- _fix_tag_action(item: dict) dict[source]¶
Fix a
tag/markaction for notify-only operation.The string
-notify-onlywill be appended to thetagitem,keyitem, and/or every item in thetagslist.If none of these values are set, the
tagitem will be set to the custodianDEFAULT_TAG, suffixed with-notify-only.
- _fix_tags(tags: List[str]) List[str][source]¶
Convert a policy tags list to a notify only version, by appending a
notify-onlytag to the list.
- _fix_untag_action(item: dict) dict[source]¶
Fix a
remove-tag/unmark/untagaction for notify-only operation.All tag names in the
tagslist will have-notify-onlyappended.