interface = boto.ec2.networkinterface.NetworkInterfaceSpecification(subnet_id
    ='subnet-11d02d71', groups=['sg-0365c56d'], associate_public_ip_address
    =True)
interfaces = boto.ec2.networkinterface.NetworkInterfaceCollection(interface)
reservation = ec2.run_instances(image_id='ami-a1074dc8', instance_type=
    't1.micro', network_interfaces=interfaces, key_name='keyPairName')
instance = reservation.instances[0]
instance.update()
while instance.state == 'pending':
    print(instance, instance.state)
time.sleep(5)
instance.update()
instance.add_tag('Name', 'some name')
print('done', instance)
How to auto assign public ip to EC2 instance with boto