3

I don't know much about routing and subnets and vpc's, I never had to use those with my old AWS account. In my new AWS account, I started a new Amazon Linux AMI instance (ami-043a5034). The security group it is attached to includes allowing port 22. The VPC settings are all default, which I thought meant it is supposed to work like the 'legacy' style EC2 config without VPCs. I'm using knife-ec2 gem version 0.8.0. My knife creation command is something like this (with region and other settings specified by knife.rb)

knife ec2 server create -r 'role[webserver]' -I 'ami-043a5034' -E development -G 'web-security-group' -N 'webserver1'

I've also tried

knife ec2 server create -r 'role[webserver]' -I 'ami-043a5034' -E development -g 'sg-abcdef12' -N 'webserver1' --associate-public-ip --subnet subnet-abcdef12 --server-connect-attribute public_ip_address

Both with and without the server-connect-attribute parameter

Once it has created the instance, it is stuck at 'Waiting for sshd' (with no periods). I'm able to SSH into the new instance from the terminal, as well as the Java tool Amazon provides, so I know it is publicly available, but I'm not sure how to get knife/chef to connect properly to finish bootstrapping the new instance. Where do I start? Do I need an Elastic IP, or can I get away with using whatever public IP it is assigned?

  • Default security group is not allowing SSH traffic? – carter May 29 '14 at 18:25
  • "The security group it is attached to includes allowing port 22", and "I'm able to SSH into the new instance from the terminal" – Reese May 29 '14 at 19:11
1

I needed to add two more options.

-i ~/.ssh/key.pem

and

--ssh-user ec2-user

I assumed these were already working, since I was able to knife ec2 server list, and because I specified knife[:aws_ssh_key_id] in knife.rb, but that key id is referring specifically to the keypair name on AWS, you still need to connect to your newly created instance with that key on your own computer.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.