instituteofai / iai-aws-infra

Infrastructure setup for IAI Labs demos
1 stars 1 forks source link

Add public key to EC2 instance automatically #4

Open ravimashru opened 4 years ago

ravimashru commented 4 years ago

Whenever TF is run and the EC2 instance is replaced, it does not contain any public key of a key pair that can be used to connect to the instance.

We need to ensure that everytime an EC2 instance is created/replaced, there is a public key always added so that we don't have to manually add it before we can SSH into the instance.

As a start, take a look at this: https://www.terraform.io/docs/providers/aws/r/key_pair.html

ravimashru commented 3 years ago

Also useful: http://2ninjas1blog.com/terraform-assigning-an-aws-key-pair-to-your-ec2-instance-resource/