I need to get the instance by instance-id, is it possible to do it without requesting a list of all instances?
I've tried:
ec2_conn = boto.connect_ec2(aws_access_key_id=key, aws_secret_access_key=access)
c2.get_all_instances([instanceId])
It works, but is there some other way to get the instance?
The reason I'm asking is I received UnauthorizedOperation
for get_all_instances
request, so I would prefer to change the request, not the security settings.
Maybe boto
has evolved since the time the OP asked the question, but this deserves the up to date answer to be added here:
reservations = ec2conn.get_all_instances(instance_ids=['i-12345678'])
instance = reservations[0].instances[0]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With