def connect_to_ec2(region, access_key_id, secret_access_key):
conn = boto.ec2.connect_to_region(region,<EOL>aws_access_key_id=access_key_id,<EOL>aws_secret_access_key=secret_access_key)<EOL>if conn:<EOL><INDENT>return conn<EOL><DEDENT>else:<EOL><INDENT>return False<EOL><DEDENT>
returns a connection object to AWS EC2