You first need to get the reservation
object when you run your instance and from the reservation you can get the instance object. Once you get instance object you can query it but just calling its attributes. The conn.run_instances
method returns its current reservation so you can just do as follows:
#!/usr/bin/python
###Import the following arguments for the script
from sys import argv
script, base_ami, package = argv
print "Just launching a copy of", base_ami,"..."
import boto.ec2
conn = boto.ec2.connect_to_region("us-east-1",
aws_access_key_id='<key>',
aws_secret_access_key='<secret>')
reservation = conn.run_instances('ami-df091bb6')
myinstance = reservation.instances[0]
# The get the instance id
myid = instance.id