Follow the steps to generate private-key and certificate for your AWS account.
Generating Your Aws Private Key & Certificate File
You have two choices:
1.You can export these keys (make sure it is in your bashrc file) and execute the EC2 commands
export EC2_PRIVATE_KEY=$HOME/<where your private key is>/pk-XXXXXXXXXXXXXXXXXXXXXXXXXXXX.pem
export EC2_CERT=$HOME/<where your certificate is>/cert-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.pem
ec2-describe-images ami-12345abc
2.Give the path of private key & certificate file when you execute AWS in CLI
ec2-describe-images \
-C <path-to-certificate-file>/cert-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.pem \
-K <path-to-private-key>/pk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.pem ami-12345abc
I would suggest to choose option 2, since it always make me remember those important files.