Question: I have an EC2 instance which I started with a particular key pair. But now I want to disable the key pair that I have and use a different one. I just created a new keypair, but how do I assign it to the instance without having to terminate the instance and restart it?

Answer: 
Altering the related `authorized keys` file will be sufficient. You don't even have to restart the `sshd` daemon.

The `ssh-keygen` program will allow you to create a new key and will ask you what name to save the key under. Enter any name you choose. Copy the file with that name to your system as your private key. Copy the contents of file with the same name ending in `.pub` to your `authorized_keys` file. Remove any lines from that file that you don't want to be used anymore.

**Think twice, operate once**. Locking yourself out will require at least a reboot to fix.
You should copy the public key file onto the instance and add it to (or replace) the existing `authorized_keys` file. Or, better yet, have your configuration automation system do it for you.