How to clean up infrastructure set by custodian policy

520 views
Skip to first unread message

Neel Desai

unread,
May 23, 2019, 4:55:48 PM5/23/19
to cloud-custodian
Hello,

Is there a way to delete/remove infrastructure set by custodian in AWS? Like single command/click to delete all the resources get created by cloudformation/terraform.


Thank you
Neel Desai

Kapil Thangavelu

unread,
May 23, 2019, 11:01:22 PM5/23/19
to Neel Desai, cloud-custodian
 

We distribute a script in tools/ops/mugc.py that will garbage collect resources from custodian that are no longer referenced by a set of policy files.


--
You received this message because you are subscribed to the Google Groups "cloud-custodian" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cloud-custodi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloud-custodian/7cb5143c-4f9a-48dc-b709-352d46cd63d2%40googlegroups.com.
Message has been deleted

Neel Desai

unread,
May 29, 2019, 9:11:34 AM5/29/19
to cloud-custodian
Thank you for your answer.Yes it is working fine for my other custodian policies that I have running in my AWS account except one new policy that I have deployed sometime back for testing.

Not working example -

python ~/cloud-custodian/tools/ops/mugc.py -c ec2_tags_compliance.yml -r us-east-1 --prefix custodian-ndesai-ec2-tag-compliance-unmark --dryrun -v

2019-05-29 07:51:20,276: custodian.cache:DEBUG Disabling cache


Working example:

python ~/cloud-custodian/tools/ops/mugc.py -c ec2_tags_compliance.yml -r us-east-1 --prefix custodian-high-risk --dryrun -v

2019-05-29 07:54:17,998: custodian.cache:DEBUG Disabling cache

2019-05-29 07:54:18,624: mugc:INFO Region:us-east-1 Removing custodian-high-risk-security-groups-remediate

2019-05-29 07:54:18,624: mugc:INFO Dryrun skipping removal

Curious to know how disabling/enabling cache plays a role in cloud custodian policy?

Also one more thing that confusing me is, what I was expecting is by passing -c list of config_files in command, will only check for resources that are getting created from passed config file but in --dryrrun, it returns all the lambda functions that have custodian prefix.

On Thursday, May 23, 2019 at 10:01:22 PM UTC-5, Kapil Thangavelu wrote:
 

We distribute a script in tools/ops/mugc.py that will garbage collect resources from custodian that are no longer referenced by a set of policy files.

On Thu, May 23, 2019 at 3:55 PM Neel Desai <neelde...@gmail.com> wrote:
Hello,

Is there a way to delete/remove infrastructure set by custodian in AWS? Like single command/click to delete all the resources get created by cloudformation/terraform.


Thank you
Neel Desai

--
You received this message because you are subscribed to the Google Groups "cloud-custodian" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cloud-c...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages