I have ec2 instance with public subnet and vpc associate with it.and igw attach to the vpc
I did enable auto assign ip
Also I have security group with following inbound rules
the route table look like
OpenSSH_8.1p1, OpenSSL 1.1.1d 10 Sep 2019
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: resolving "ec2-XX-XXX.ap-southeast-2.compute.amazonaws.com" port 22
debug2: ssh_connect_direct
debug1: Connecting to ec2-XX-XXX.ap-southeast-2.compute.amazonaws.com [XX.XX] port 22.
debug1: connect to address ec2-XX-XXX port 22: Connection timed out
ssh: connect to host ec2-XX-XXX.ap-southeast-2.compute.amazonaws.com port 22: Connection timed out