During a recent work on one of my projects, I came across a scenario where I needed to have a AWS Lambda function assume a role dynamically and get permissions conditionally. When we create an AWS Lambda function, we always associate a single role to the function. To achieve my need I had to come up with a solution where I could have the Lambda function assume a role dynamically and get permissions which is different than the associated role. I wanted to share my experience of this method and hopefully it will help someone who is looking for a similar solution.
In this post, I will show you how to have a Lambda function assume a role dynamically and give the functions permissions which are not present in the associated role.
Top comments (0)