rebuy-de / aws-nuke

Nuke a whole AWS account and delete all its resources.
MIT License
5.74k stars 718 forks source link

MediaLive resources are not detected and nuked #446

Open powelli opened 4 years ago

powelli commented 4 years ago

Steps to reproduce

  1. Create a MediaLive Channel, MediaLive Input & MediaLive Input Security Group in your AWS account
  2. Run aws-nuke and review the dry-run output for any MediaLive resources

Expected result

Actual result

Additional details

account-blacklist:

accounts: "": {}

- Docker run command:

docker run \ --rm -it \ -v /path/to/nuke-config.yml:/home/aws-nuke/config.yml \ -v /path/to/.aws:/home/aws-nuke/.aws \ quay.io/rebuy/aws-nuke:v2.13.0 \ --profile \ --config /home/aws-nuke/config.yml

deekayw0n commented 2 years ago

Just a note on this rather evolving issue, it seems that aws-nuke (version v2.19.0.2.gf8495e4) does iterate through these resources and attempts to destroy them; however there seems to be an order of operations problem causing ConflictException errors

Based on my CloudTrail, from DeleteChannel: Cannot delete a channel that has not been stopped yet. Please stop the channel and try again.

From DeleteInput: Input #### is busy, it cannot be deleted

I think aws-nuke would just need to call the StopChannel method for any returned MediaLive channels, and then DeleteChannel after return. Similar pattern compounding operations can be found in EC2 Instances where aws-nuke first disables protection before termination.

Looks like @tomvachon is just the talented individual to potentially help us make this minor change, if we can convince Tom to revisit his MediaLive resource addition change (99c450d) from many moons ago.

My golang is a bit weak otherwise I'd experiment with this one a bit more. Big thanks if Tom or another fearless soul can take this tweak on.