About this task
A key pair consists of a public key and a private key. The public key encrypts data, such as login credentials, and the private key decrypts it. You provide the key pair when creating a CloudFormation stack and use it to access Amazon Machine Instances through SSH.
For more information, see the following website: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html