How to have AWS Lambda assume a role dynamically and get permissions on the fly

Amlan Chakladar
7 min readMay 2, 2024

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…

--

--

Amlan Chakladar

Cloud architect and DevOps engineer. Love to code and develop new stuff. A nerd by nature.