enable IAM role use

This should work with IAM instance profiles.

Also, lines 73 and 74 were accessing objects from the aws dict without it having been created.