"Error: Error launching source instance: InvalidKeyPair.NotFound: The key pair 'terraform-aws' does not exist status code: 400, request id: 3c4d487a-f051-45f2-bb90-3020c0798c7a
on main.tf line 7, in resource "aws_instance" "dev": 7: resource "aws_instance" "dev" {"
# Configure the AWS Provider
provider "aws" {
version = "~> 2.0"
region = "sa-east-1"
}
resource "aws_instance" "dev" {
count = 2
ami = "ami-0619116924c87f2f8"
instance_type = "t2.micro"
# each region must have its own key pairs
key_name = "terraform-aws"
#public_key = "file("${$${HOME}/.ssh/terraform-aws.pub}")"
tags = {
Name = "dev${count.index}"
}
}