.pem file after creating key pair

I have been learning how to use Terraform with AWS, I have been able to create an ec2, security group, and add it to a key pair. I am also able to run commands within my instance as well. I have now been able to create a key pair as well, but how can I get the .pem file after I create it?

@Emarburg How did u create a key pair?? In terraform when you create a key pair you need to pass public key, which you’ll already have and that will be your pem.
Terraform doesn’t give you key, you’ll be passing in resource block of aws_key_pair.