terraforming
terraforming copied to clipboard
Fixed undefined method 'role_name' when running iamip
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.
Coverage decreased (-0.5%) to 99.494% when pulling ce754d06cf3d228c4adb52a57ce087da7590bf65 on Avolynsk:fix-iamip-exception into 1ba96b958123087dc1454e284ce34cc9c00b69a0 on dtan4:master.
Coverage remained the same at 100.0% when pulling c13ad6189f5bdb6d6692cc66d69467662581bcb1 on Avolynsk:fix-iamip-exception into 50e09f973ec01ccb0751741eed4d78acb1c3cdb3 on dtan4:master.
Please merge the current master branch, then resolve conflicts
done