Define ec2 before using it.