terraform-aws-modules / terraform-aws-ec2-instance

Terraform module to create AWS EC2 instance(s) resources 🇺🇦
https://registry.terraform.io/modules/terraform-aws-modules/ec2-instance/aws
Apache License 2.0
753 stars 1.86k forks source link

key_pair does not exists issue #329

Closed Dhina-test closed 1 year ago

Dhina-test commented 1 year ago

Hi I placed my key pair in currect directoy name as yeshwanth.pem image

and for your reference below is my ec2 module terraform code and i defined keypai in veriable section

image

image

but in terraform validate gots key pair not exist issue

image

can you help ?

antonbabenko commented 1 year ago

You need to create EC2 key pair in the AWS region you use. You can use this module, for example.

Then you will have to specify key_name argument pointing to the name of that key pair (not filename) in this ec2-instance module.

Please ask generic Terraform questions on discuss.hashicorp.com

github-actions[bot] commented 1 year ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.