{"action":"closed","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/2429","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/2429/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/2429/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/2429/events","html_url":"https://github.com/hashicorp/terraform/issues/2429","id":90298570,"number":2429,"title":"AWS key pair not found issue while creating new instance","user":{"login":"ranjitshinde91","id":5425895,"avatar_url":"https://avatars.githubusercontent.com/u/5425895?v=3","gravatar_id":"","url":"https://api.github.com/users/ranjitshinde91","html_url":"https://github.com/ranjitshinde91","followers_url":"https://api.github.com/users/ranjitshinde91/followers","following_url":"https://api.github.com/users/ranjitshinde91/following{/other_user}","gists_url":"https://api.github.com/users/ranjitshinde91/gists{/gist_id}","starred_url":"https://api.github.com/users/ranjitshinde91/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ranjitshinde91/subscriptions","organizations_url":"https://api.github.com/users/ranjitshinde91/orgs","repos_url":"https://api.github.com/users/ranjitshinde91/repos","events_url":"https://api.github.com/users/ranjitshinde91/events{/privacy}","received_events_url":"https://api.github.com/users/ranjitshinde91/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-23T06:10:31Z","updated_at":"2015-06-23T09:02:53Z","closed_at":"2015-06-23T09:02:53Z","body":"I am trying to create new instance in aws.\r\nMy template file is like below:\r\n\r\nresource \"aws_instance\" \"myInstance\" {\r\n    ami = \"${lookup(var.amis, \"myInstance\")}\"\r\n    instance_type = \"m3.medium\"\r\n    key_name = \"my-key-pair\"\r\n    subnet_id=\"${aws_subnet.PublicSubnet1.id}\"\r\n    source_dest_check = \"false\"\r\n    security_groups = [\"${aws_security_group.myInstance.id}\"]\r\n    \r\n    tags {\r\n        Name = \"myInstance\"\r\n    }\r\n}\r\n\r\n\r\nHowever after terraform apply it shows error like:\r\nError launching source instance: Invalid key pair:not found\r\nI have cross checked key name by logging to aws console also.\r\n\r\nI thing this issue is random bacause same template file works fine for my other aws account."}}