Use pattern matching instead of hard coded versions of ec2 tools.