I have CloudFormation stack, which is frequently updated by a script (changing source AMIs for launch configuration). I would love to have it deployed by the same script, executed by non-privileged user/instance role. Currently all updates are made by admin user, with a lot more privileges than needed.
My initial approach was by try and fail, see in logs what permission is missing and adding it one by one. Takes a lot of time and far from productive.
I am thinking that there should be a way to generate list of permissions based on CloudFormation template, plus permissions to update the stack itself.
My second thought is to process CloudTrail logs of successful deployment to extract actions and resources from there.
May be there is already a way to do it and I'm re:Inveting the wheel ?