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.