I've tried this many times over the last couple of weeks. I created a default VPC (virtual private cloud). I edited the default security group (firewall) to allow all inbound and outbound traffic to/from anywhere.
I created EC2 instances running Debian or Ubuntu, connected to my default VPC, using my default security group. I can't connect to them. PuTTY says "Network error: Connection timed out". I noticed today that if I attempt to connect immediately after creating or rebooting the instance, I can successfully connect for a minute or so, then PuTTY stops responding and eventually says that the connection was aborted due to a network failure. After that point, I can't connect anymore. When I try to connect from the browser, in the AWS management console, I get: "There was a problem setting up the instance connection".
The same kind of problem happens with Windows instances. Again, they're connected to my default VPC, using my default security group. If I attempt it immediately after creating or rebooting, I can connect to the instance using Windows's Remote Desktop Connection program. However, after running for a minute, I get disconnected; from that point on, trying to connect results in the error: "Remote Desktop can't connect to the remote computer" (remote computer is turned off, not available on the network, or has remote access disabled).
Neither can I connect to MS SQL or MySQL RDS databases. They are also using my default VPC and security group, so they should be wide open, but I can't reach them.
I can successfully connect to Linux and Windows virtual machines on Lightsail and Azure, so there doesn't seem to be anything wrong on my computer that would prevent outgoing connections. I can also connect to EC2 instances that my employer created from my work computer, but neither my home nor work computer can connect to EC2 instances that I created. Since I can connect to the EC2 instances briefly after rebooting them, that tells me that my VPC's security group is configured correctly to allow access. I can't see that I've done anything wrong, but I can't connect. Have I overlooked something, or could there be something wrong in AWS?
Another interesting thing to note is that if I add a superfluous character to the name of the computer I'm trying to connect to, my computer can tell instantly that the computer I'm trying to reach doesn't exist, but when I try to correct to the correct name, it takes a whole minute to time out. That tells me that, somehow, my computer can tell the instance exists; it just can't get SSH or RDP to work.