wallix / awless

A Mighty CLI for AWS
http://awless.io/
Apache License 2.0
4.98k stars 263 forks source link

Feature Request : delete --cascade (for vpcs) #132

Open edi9999 opened 7 years ago

edi9999 commented 7 years ago

Hello,

I have been using awless and it works well for me.

I am now trying to remove some VPCs that are idling around without being used. I have the vpc id.

When deleting my VPC, I get following errror :

                    delete vpc: DependencyViolation: The vpc 'vpc-ewfewfewf' has dependencies and cannot be deleted.
                    status code: 400, request id: ****-***-***-***

I have indeed subnets, and route tables that are linked to it.

I would like to propose to add the --cascade flag to remove all linked dependencies as well. Without the --force flag, I think it should ask confirmation for each deletion.

simcap commented 7 years ago

@edi9999 great suggestion, and one we want to complete! We have been focusing on other matter recently but the foundation of awless have been built for that kind of scenario.

Since after a sync we have all the information, we can definitely help the user in removing intelligently and safely part of its cloud resources (as it can be really annoying using the AWS web console/CLI)

As you probably know already, creating infrastructure through an awless template we can easily revert the template and everything is taken care of. But this does not account for created/added resources not part of a template, or existing infrastructure not created through awless.

We like this idea of --cascade and asking for confirmation.

Basically, what we want to do is when deleting a resource using the CLI through awless delete myresource we will inspect the dependencies and display the full template of deletion for confirmation so it can get confirmed only once.

That is something we will implement (leveraging our internal resource graphs more in the process). We do not have a date yet but it might be in the coming weeks.

freshyogurt commented 6 years ago

+1

jpluscplusm commented 6 years ago

I'd installed awless to poke around and see if it had this kind of functionality and I'm a bit sorry it hasn't! This would be a fantastically useful feature :-)