Add ec2 param to get_target_from_rule

get_target_from_rule seems to have been extracted from main without sufficient
parameters.