Hi@akhtar,
You can use the bellow given command to create a key.
$ aws ec2 create-key-pair --key-name mykey --query 'KeyMaterial' --output text > Mykey.pem
To make .pem file readable.
$ chmod 400 Mykey.pem
Hope this will help you.
For more, check out this AWS training today!