why we need Security groups when we have key pair to access my AWS instance?
Key pair is used to encrypt and decrypt the data, whereas Security Groups (firewall) is used to ensure that all the traffic that flows at the instance level is only through accepted ports and protocols.