Is there any way through which I can connect to all ec2-instances one by one through Python script to extract some server information from there. Please note that all ec2-instances lies behind a bastion host. Using shell script I can do that but how about python. Is there any specific library?
2
-
More information might be helpful, like whats the end result? You want to run commands on these servers? Why not use ansible? – Levi Jun 2 '18 at 23:20
-
@Levi I need to extract some information from database.yml files residing in each ec2 instances – Prashast Jun 4 '18 at 18:57
Add a comment
|
You can benefit from EC2 inventory script provided by Ansible - click
It will allow you to to connect to all ec2-instances, one by one (in serial: 1
mode)