카테고리 없음

Terraform aws ec2 invalidkeypair.notfound: the key pair does not exist

nauco 2021. 10. 29. 14:59
728x90
반응형
╷
│ Error: Error launching source instance: InvalidKeyPair.NotFound: The key pair 'bastion-key' does not exist
│       status code: 400, request id: 718af0d0-7c29-46e1-97be-66654c52cfbd
│
│   with aws_instance.bastion-instance-2a,
│   on bastion.tf line 5, in resource "aws_instance" "bastion-instance-2a":
│    5: resource "aws_instance" "bastion-instance-2a" {
│
╵


│ Error: Error launching source instance: InvalidKeyPair.NotFound: The key pair 'bastion-key' does not exist
│       status code: 400, request id: 718af0d0-7c29-46e1-97be-66654c52cfbd

│   with aws_instance.bastion-instance-2a,
│   on bastion.tf line 5, in resource "aws_instance" "bastion-instance-2a":
│    5: resource "aws_instance" "bastion-instance-2a" {

aws ec2 provisioning failed, even i created key pair in aws ec2 console.

Cause: I created a key pair in a different region than the one I want to create ec2 for.