4 ms·
https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2Instance.html https://docs.aws.amazon.com/powershell/latest/reference/item... # this would
by justsomehnguy 5y ago
https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2Instance.html https://docs.aws.amazon.com/powershell/latest/reference/item...
# this would wipe all EC2 instances, assuming you are authenticated and there is nothing else need to get a list of them
Get-EC2Instance | Remove-EC2Instance -Force
If there is a way to enumerate objects without explicitly specifying some properties then PS makes it very easy to pipe that output to remove or disable cmdlets.
I never worked with AWS but if I needed to write such killer script I would kill instances (as in above example), remove all S3 objects (quite similar, Get-S3Object | Remove-S3Object) and finally wipe out all IAM roles and users (similar Get/Remove-IAMGroup, ..IAMUser etc). And thesubscription/account things, as @jiggawatts says, I'm just not familiar with the AWS lingo. And secrets/creds, of course.
By the time a human starts to investigate why the monitoring gone mad (assuming it wasn't hosted with all other infra on same account, lol) there would be nothing to do, too many thing are gone already, too many things are on the way to be purged and even if they could be restored there would be too many things to tie it again to something resembling a functioning system.
- stavros 5y agoOh huh, for some reason that didn't even come to mind. Good thing all our infrastructure is applied by CI and our local tokens are read-only!
- jiggawatts 5y agoDo you gave S3 buckets? They’re just as easy to bulk-delete, and then they’re… gone.
- chikipowpow 5y ago