COOK-3467 support IAM role

Patch for COOK-3467, this is an alternative to #45.