I want to start a EC2 instance from java code and execute python code on that EC2 instance.
- Create a custom AMI with python console application
- launch EC2 instance using AMI from java application
- launch multiple instances of python program with different command line arguments from java code.
I have done some analysis where I can create AMI with python code and launch EC2 instance, but I am looking for a way to launch multiple instances of python program with command line arguments.
Basically I want to build a scalable system which will start EC2 instance and launch multiple python processes as per requirement and will remove EC2 instance as work is done.
UPDATE: Although accepted answer is correct there is another way to execute scripts remotely using ssh tunneling using JSCH java library , here is the Gist for sample code
This can be used for communication with non AWS machine with SSH service on.
