From 256a27e7e9393c4d514cd047c976509275244339 Mon Sep 17 00:00:00 2001 From: richard-hansen Date: Thu, 26 May 2022 16:55:55 -0400 Subject: [PATCH] First attempt --- templates/policy_template.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/templates/policy_template.py b/templates/policy_template.py index 6c695bd..77892e0 100644 --- a/templates/policy_template.py +++ b/templates/policy_template.py @@ -101,6 +101,11 @@ def custodian_deleter_lambda(config: Mapping, resource: str) -> Mapping: }] } + # Allow deletion of ami snapshots + if resource == "aws.ebs-snapshot": + dict['filters'].append({"type": "skip-ami-snapshots", "value": False}) + + if resource == "s3": dict["actions"][0]["remove-contents"] = True