While running terraform script, it shows the following error
Error: Error launching source instance: InvalidKeyPair.NotFound: The key pair 'oregonkeypair' does not exist
status code: 400, request id: 921dcb14-796f-4d80-9d41-295dd2fffde7
on instances.tf line 5, in resource "aws_instance" "rest":
5: resource "aws_instance" "rest" {
Error: Error launching source instance: InvalidKeyPair.NotFound: The key pair 'oregonkeypair' does not exist
status code: 400, request id: f35fc4f3-994c-4e32-9120-03ef02de952f
on instances.tf line 19, in resource "aws_instance" "connect":
19: resource "aws_instance" "connect" {
Error: Error launching source instance: InvalidKeyPair.NotFound: The key pair 'oregonkeypair' does not exist
status code: 400, request id: 5127a96f-e64b-4a34-bea8-cb848b8b82f8
on instances.tf line 33, in resource "aws_instance" "ksql":
33: resource "aws_instance" "ksql" {
Error: Error launching source instance: InvalidKeyPair.NotFound: The key pair 'oregonkeypair' does not exist
status code: 400, request id: 72dd21a3-62b6-4e65-bf17-c68dafd885fa
on instances.tf line 46, in resource "aws_instance" "control_center":
46: resource "aws_instance" "control_center" {
Error: Error launching source instance: InvalidKeyPair.NotFound: The key pair 'oregonkeypair' does not exist
status code: 400, request id: 06d12048-f2ee-44a9-9bc4-0b69619040c6
on instances.tf line 60, in resource "aws_instance" "schema":
60: resource "aws_instance" "schema" {
Error: Error launching source instance: InvalidKeyPair.NotFound: The key pair 'oregonkeypair' does not exist status code: 400, request id: 9c49141d-7b47-490f-96d8-364399567244
But the same key is in the same folder and also provided chmod 400 permission