Amazon EC2: How to make SSH remember the server key

I connect to my amazon EC2 Ubuntu 18.04 snapshot using SSH. Whenever I enter the SSH command, she asks me if I have to trust the key. And I answer Yes. Next time he will ask me again.

ssh -i "my_key.pem" ubuntu@mydomain.myregion.amazonaws.com The
authenticity of the host & mydomain.myregion.amazonaws.com (xx.xx.xx.xx) & # 39;
can not be established. The fingerprint of the ECDSA key is SHA256:[some string].
Are you sure you want to continue logging in (yes / no)?

I've checked the /home/.ssh/known_hosts.txt file. It repeatedly saves the file each time. Please note that I have already missed with this file. Then, I uninstalled and reinstalled the SSH using the following commands:

sudo apt-get purge openssh-server.
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get install openssh-server 

How can I do SSH remember the key to my server and stop repeatedly to write the key in the known_hosts.txt like this will make the file extremely huge.