You can follow the below-mentioned steps to change the key pair for your EC2 instance.
Note: The following procedure is valid for EBS backed instances only.
step 1: Stop your EC2 instance
Step 2: Unmount and detach the EBS volume from your instance
Step 3: Attach this EBS volume to another newly instance with new key pair.
Step 4: Modify the authorised key file as shown below:
copy ~/.ssh/authorized_keys to /mnt/tmp/home/ubuntu/.ssh/authorized_keys
Step 5: Detach this volume and attache it back to the original instance
Step 6: Restart the original instance
Step 7: Connect and login to your original instance using the new key pair.