Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

Fixed undefined method 'role_name' when running iamip #451

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Avolynsk
Copy link

@Avolynsk Avolynsk commented Apr 4, 2019

This error appears because sometimes AWS can return to you a list of instance profiles including deleted ones (as I understood this).

So, if an instance profile is actually deleted - it can't be matched with any IAM role and we getting "undefined method 'role_name'" then.

My fix is checking if profile.roles list is empty. If not - well, this profile really exists and we can get an IAM role for it, so we should add it to .tf file.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.5%) to 99.494% when pulling ce754d0 on Avolynsk:fix-iamip-exception into 1ba96b9 on dtan4:master.

@coveralls
Copy link

coveralls commented Apr 4, 2019

Coverage Status

Coverage remained the same at 100.0% when pulling c13ad61 on Avolynsk:fix-iamip-exception into 50e09f9 on dtan4:master.

Copy link
Owner

@dtan4 dtan4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please merge the current master branch, then resolve conflicts 🙏

@Avolynsk
Copy link
Author

Please merge the current master branch, then resolve conflicts

done

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants