packet_write_wait: Broken Pipe error on MacOS Sierra SSH to Amazon EC2
This means that there is a huge packet loss for a long time or route change between you and AWS (not necessarily your provider, it might be your router or intermediate provider too), so even tcp keepalives are left unanswered. Inspect your traffic, every sent and received packet on both sides with wireshark/tshark in background. If you'll see that data is not delivered or there is a TCP retransmission - this is where the problem belongs to.