-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aws.ecs | deregister container instances and delete clusters #5326
base: main
Are you sure you want to change the base?
Conversation
I'll add one more test to delete ecs cluster with |
tests/data/placebo/test_delete_cluster/ecs.DeregisterContainerInstance_1.json
Outdated
Show resolved
Hide resolved
tests/data/placebo/test_deregister_container_instances/ecs.DeregisterContainerInstance_1.json
Outdated
Show resolved
Hide resolved
thanks @kapilt , I have addressed all findings as per your suggestion |
Had to add one more test to keep the codecov up!! |
thanks, looks good, one thing that came up in wrt to eks delete is actually deleting the underlying compute instances/asg. any thoughts on that? I'm not really clear on the use case here so would appreciate if thats something you feel is also of interest (also making an assumption this is something your planning on using?). |
Thanks for pointing it out! Yes, this is something we would be using! I'll add the deletion of underlying instances as part of cluster cleaning process in this Pr! |
@kapilt I was thinking of adding the deletion of underlying instance as a part of
Let me know if this sounds good to you? Thanks!! |
sounds good |
While implementing I realized that it might be better a better approach to keep the instance deletion action as part of the cluster cleanup because there might be other things like ASGs etc as part of underlying instance. Already made the code changes last night. If you feel it would be better to stick with the first approach, more than happy to make the changes. Thank you! |
i'm more concerned with that these are asg instances, and this will just cause churn instead of providing value. if the ecs cluster per its capacity provider is managing the asg that seems safe to delete. if for whatever reason the asg is spanning clusters.. that would be problematic, distinction here is wholly owned asg for the cluster vs one thats shared, not that would be a good idea, but part of custodian is saving people from making accidentally making bad choices that make things worse, when its non obvious that is the outcome. |
Understood! I have added code to delete ecs managed asgs if any on cluster deletion with |
Has there been any movement on this? My company has been waiting for this functionality to manage sandbox and non-production cluster sprawl. |
We'd still love to have this functionality! |
Giving this a bi-monthly bump |
Hi all, Any, updates? I think this functional would really helpful for cleaning policies. Thanks |
Hey, apologies on this one. I'll get back to it this week |
Hi, |
Closes #5039
This PR adds two actions for ecs-clusters:
deregister-container-instances: lets you deregister container instances.
force
option can be used as per boto docs: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ecs.html#ECS.Client.deregister_container_instancedelete: lets you delete ecs cluster.
force: true
, deregisters container instances followed by cluster deletion. https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ecs.html#ECS.Client.delete_clusterThis also cleans up any ecs managed capacity provider(asgs)