On the EC2 instances interface, select the instance you just created and click Connect
Run the command sudo -su ec2-user
to switch from user to ec2-user, and have root administrative rights for the instance
Then run the command ping 8.8.8.8
(IP address of Google’s DNS server) to test whether our instance can connect to the outside internet through igw or not