It's not a good practice to store credentials in terraform files and even worse when checking them in to a git repo. It would be nice if one could fetch the private key from AWS Secrets Manager instead. It would be a manual step to store the secret there, but it would be more secure.