COOK-3467 update to PR #45

If :iam_role is not set, query instance metadata to get the IAM role assigned to the instance.

This is an amendment of pull-request #45.