When you start to mess about and experiment with AWS you will end up with lot of erroneous entries. One of these entries can be around the security groups, this is particularly the case when creating RDS instances in a VPC as it does create security groups to match.
When you delete the RDS instance it does leave the security groups behind, you should clean these up to keep everything tidy.
You may get this dreaded error then
resource sg-fb9b8997 has a dependent object
Obviously your sg-xxxxxx will be different, I can guarantee you will hunt through your other security groups to see if the dependent object exists, but the chances are it won’t. You will the curse and swear, and then use your friend Google to find the answer, hopefully this is how you found me!!!! 🙂
The answer you will find is the security group is attached to the EC2 Network Interfaces, not sure how, why they get attached but they do, so navigate to the EC2 console and click Network Interfaces at the bottom.
You will be be presented with the Network Interface screen
Pick the network interface that you want to change, click more and then security groups, you can then pick the groups to dissociate with interface.
Once you have done this, you will be able delete the security groups. Unless there is another hidden area. Comments on this one please