gambit
gambit

Reputation: 35

SSH into EC2 Instance created by EBS

I am using python and Amazon EC2

I am trying to progrmamtically SSH into the instance created by the Elastic Beanstalk Worker. While using 'eb init' there is no option to specify the KeyPair to use for the instance and hence I am not able to SSH into it.

Reason for me to do this is that I want to check if the dependencies in requirements.txt are installed correctly in the instance. Is there any other way to check this other than SSHing into the instance and checking?

Upvotes: 1

Views: 740

Answers (2)

Wade Matveyenko
Wade Matveyenko

Reputation: 4420

According to the AWS ElasticBeanstalk CLI docs, you can pass in the key pair name in the init command. The command would be:

eb init MyApplication -k MyKeyPairName

or

eb init MyApplication --keyname MyKeyPairName

eb create also takes a similar argument.

Upvotes: 0

biobirdman
biobirdman

Reputation: 4120

Hi you have to declare the keypair to use on the web console.

Go to

elasticbeanstalk > your application > edit configuration > Instances > select keypair

Alternatively, this sounds like a hack but you can write a python script file that call for the modules that you installed and throws an error if the module is not found. The error is captured and you can view it in the web logs.

Upvotes: 1

Related Questions