Fix aws-sdk require problems.

related: LOGSTASH-1718 

This includes new tests which cover the problems described in LOGSTASH-1718