ssh operation timed out on ec2 instance
Solution 1:
Normally, to solve ssh connection issues in aws you can check the following things:
Check if your instance is up.
Allow 22 port in security group: check if the security group you have edited is assigned to instance. Also, only for test allow 0.0.0.0/0 (all ips) to 22 port.
Check if your AMI has ubuntu user, you can try with user admin too.
Check if the ip of the instance is public.
If all of this is correct, the problem probabilly will be in the pair public-private key. Look up with pair you use when you launch the instance and your default key is the rigth key.