Q: How to disable UFW ubuntu externally? i am using amazon EC2, i enabled UFW in my server and without adding any other rule i logged out. now since there was no rule specified, i am not able to login to ssh and because of it even my website is down. can someone help me in how to disable ufw now?

A: You can't disable the firewall remotely. Disabling a firewall remotely (without using ssh to get into the console) defeats the purpose of the firewall! 
I'm afraid you are going to have to use Amazon's EC2 control panel to get into it. I'm not familiar enough with EC2 to guide you exactly how to do it, but I'm sure they have some kind of recovery process or console connection to it.
If you give me a little bit, I can try logging into my EC2 and see how to do it.

A: Without any changes, you have enabled the rule
iptables -P DROP

or
iptables -P REJECT

but that makes no difference.
Without physical access or access without using the network  you have no chance. The kernel blocks each network traffic. Your firewall does exactly what you'd expect. The protection of your system according to your rules. If you still should have access to your system now, you would have a gigantic security hole found.
Ask the Amazon customer help service or reinstall the system and be in mind:
Check the rules before logout. That's the most important rule when you enable a firewall.
