def up_ec2(region,<EOL>access_key_id,<EOL>secret_access_key,<EOL>instance_id,<EOL>username):
conn = connect_to_ec2(region, access_key_id, secret_access_key)<EOL>instance = conn.start_instances(instance_ids=instance_id)[<NUM_LIT:0>]<EOL>while instance.state != "<STR_LIT>":<EOL><INDENT>log_yellow("<STR_LIT>" % instance.state)<EOL>sleep(<NUM_LIT:10>)<EOL>instance.update()<EOL><DEDENT>data = get_ec2_info(instance_id=instance_id,<EOL>region=region,<EOL>access_key_id=access_key_id,<EOL>secret_access_key=secret_access_key,<EOL>username=username)<EOL>wait_for_ssh(data['<STR_LIT>'])<EOL>save_ec2_state_locally(instance_id=instance_id,<EOL>region=region,<EOL>username=username,<EOL>access_key_id=access_key_id,<EOL>secret_access_key=secret_access_key)<EOL>env.hosts = data['<STR_LIT>']<EOL>print_ec2_info(region,<EOL>instance_id,<EOL>access_key_id,<EOL>secret_access_key,<EOL>username)<EOL>
boots an existing ec2_instance