I always get this error on my terraform. How do I fix this?
aws_key_pair.kyc_app_public_key: Error import KeyPair: InvalidKey.Format: Key is not in valid OpenSSH public key format
I already generated the ssh with this command ssh-keygen -t rsa -N "" -b 2048 -C "assignment"
Here is my configuration script on terraform
resource "aws_key_pair" "kyc_app_public_key" {
key_name = "assignment"
public_key ="//~/.ssh/id_rsa.pub"
}
Run Code Online (Sandbox Code Playgroud)