Amazon EC2 bandwidth charges in case of unwanted incoming traffic(ddos/flood)?
Solution 1:
Basically, you can not. Whom do you charge for wasted fuel when you get stuck in a traffic jam?
This is part of your business risk. Don't want to defend - shut down your instances, no traffic then.
Regardless how bad you feel for it, Amazon still provides your service and you still use up amazon resources.
Solution 2:
$0.000 per GB - data transfer in per month
Amazon only charges you for OUTGOING traffic, so if you will not respond to ddos requests you will not notice any additional charges.
Solution 3:
There is a feature in AWS that lets you Create an Alarm for high bandwidth in or out.
This dialog is in Services / EC2 / Instances. From that page, where you see a list of your instances, there is a column Alarm Status, looking like this:
I set it for listening for network in over 1 MB in 5 mins. I really don't know what to expect, so I'll probably have to adjust this alarm if it goes off as a "false alarm" too often.
Once you have a condition you are confident in being just too much usage, you can simply Stop or Terminate the instance.