Your problem is that you are setting the endpoint to the EC2 endpoint not the Amazon ElastiCache endpoint. The corrected code snippet is:
elasticache.setEndpoint("elasticache.us-west-1.amazonaws.com");
You can find a complete list of endpoints in this document