Vault Agent with AWS | Vault - HashiCorp Learn


fails the first time through with the following error:
aws_instance.vault-server[0]: Creating…

Error: Error launching source instance: InvalidKeyPair.NotFound: The key pair ‘MyKeyPair’ does not exist
status code: 400, request id: 7cd9e192-3cd2-4384-93ec-e5c656567044

even if I create an a keypair via aws cli

aws ec2 create-key-pair --key-name MyKeyPair --query ‘KeyMaterial’ --output text > MyKeyPair.pem
and supply MyKeyPair to the key_name variable in terraform.tfvars

Eventually it succeeded but I don’t think I changed anything…