def get_ec2_info(instance_id,<EOL>region,<EOL>access_key_id,<EOL>secret_access_key,<EOL>username):
conn = connect_to_ec2(region, access_key_id, secret_access_key)<EOL>instance = conn.get_only_instances(<EOL>filters={'<STR_LIT>': instance_id}<EOL>)[<NUM_LIT:0>]<EOL>data = {}<EOL>data['<STR_LIT>'] = instance.public_dns_name<EOL>data['<STR_LIT:id>'] = instance.id<EOL>data['<STR_LIT>'] = instance.instance_type<EOL>data['<STR_LIT>'] = instance.ip_address<EOL>data['<STR_LIT>'] = instance.architecture<EOL>data['<STR_LIT:state>'] = instance.state<EOL>data['<STR_LIT>'] = region<EOL>data['<STR_LIT>'] = '<STR_LIT>'<EOL>data['<STR_LIT:username>'] = username<EOL>if username is not None:<EOL><INDENT>wait_for_ssh(data['<STR_LIT>'])<EOL>with settings(host_string=username + '<STR_LIT:@>' + data['<STR_LIT>']):<EOL><INDENT>data['<STR_LIT>'] = linux_distribution(username,<EOL>data['<STR_LIT>'])<EOL>data['<STR_LIT>'] = os_release(username,<EOL>data['<STR_LIT>'])<EOL><DEDENT><DEDENT>try:<EOL><INDENT>volume = conn.get_all_volumes(<EOL>filters={'<STR_LIT>': instance.id})[<NUM_LIT:0>].id<EOL>data['<STR_LIT>'] = volume<EOL><DEDENT>except:<EOL><INDENT>data['<STR_LIT>'] = '<STR_LIT>'<EOL><DEDENT>return data<EOL>
queries EC2 for details about a particular instance_id