Remove a key pair from the account.
Section: AMIs and Key Pairs
Delete a key pair
bash
bash
aws ec2 delete-key-pair --key-name my-keyExplanation
Does not delete any local private key file you may have saved separately.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing AMIs and Key Pairs