ekristen / azure-nuke

Remove all resources from an Azure Tenant and it's Subscriptions.
https://ekristen.github.io/azure-nuke/
MIT License
32 stars 8 forks source link

feat: add ManagedCluster to the managed resources #83

Open FlorentClarret opened 1 month ago

FlorentClarret commented 1 month ago

Closes https://github.com/ekristen/azure-nuke/issues/82

I'm not sure if there are some unit tests I can add, let me know if that's the case.

I tested it with my Azure account (I removed some of the info):

../azure-nuke/bin/azure-nuke run --config clean.yaml --force --prompt-delay 3 --no-dry-run
> azure-nuke - 1.0.0-dev - dirty
Do you really want to nuke the tenant and subscriptions with the ID SUBSCRIPTION_ID?
Waiting 3s before continuing.
westus2 - ManagedCluster - testnuke - [ID: "", Name: "testnuke", Region: "westus2", ResourceGroup: "group", SubscriptionID: "SUBSCRIPTION_ID", tag:XXXX] - would remove
Scan complete: 1 total, 1 nukeable, 0 filtered.

Do you really want to nuke the tenant and subscriptions with the ID SUBSCRIPTION_ID?
Waiting 3s before continuing.
westus2 - ManagedCluster - testnuke - [ID: "", Name: "testnuke", Region: "westus2", ResourceGroup: "group", SubscriptionID: "SUBSCRIPTION_ID", tag:XXXX] - triggered remove

Removal requested: 1 waiting, 0 failed, 0 skipped, 0 finished

westus2 - ManagedCluster - testnuke - [ID: "", Name: "testnuke", Region: "westus2", ResourceGroup: "group", SubscriptionID: "SUBSCRIPTION_ID", tag:XXXX] - waiting

...

westus2 - ManagedCluster - testnuke - [ID: "", Name: "testnuke", Region: "westus2", ResourceGroup: "group", SubscriptionID: "SUBSCRIPTION_ID", tag:XXXX] - removed

Removal requested: 0 waiting, 0 failed, 0 skipped, 1 finished

Nuke complete: 0 failed, 0 skipped, 1 finished.

It took 4 minutes 11 here.

Side note: I wanted to map g.SystemData.CreatedAt to the struct but it appears to be nil on my test

ekristen commented 1 month ago

Thanks for this. I need to look into this a bit more. Primary issue being is this the right resource name or should it be AKSCluster as generally folks know it as AKS.

FlorentClarret commented 1 month ago

Thanks for this. I need to look into this a bit more. Primary issue being is this the right resource name or should it be AKSCluster as generally folks know it as AKS.

I wast tempted to use AKSCluster as it's also how I usually call it but I went with ManagedCluster because that's what we have in their SDK. AKSCluster might be more userfriendly