AWS Lambda boto3 Version - User.Tags missing

January 21, 2019

Wasted a day chasing down this issue, turns out to be a simple cause. Writing it up here to hopefully save others a few hours…

So you want to retrieve an IAM user’s tags inside a Lambda function. Perhaps in a Lambda triggered from a CodeCommit push, that posts a notification to Slack or Microsoft Teams - and the Tag has the user’s full name and email address you want to use in the notification.

Take the Lambda, turn it into a command-line python script by removing the lambda_handler method, and run locally. You get Found user email tag jsmith@example.com.

So it works locally but does not work inside Lambda.

Surely retrieving Tags on a User has been around forever. So I thrash around for a few hours, thinking I am not calling the method correctly, passing the wrong inputs, not handling the output correctly… nothing works. Then I figure I will just double-check the version of boto3 running everywhere.

Boom!
, User.Tags is not shown in the response. Version 1.9.42 running in Lambda was released November 9, 2018 and does not return User.Tags.

Presumably AWS will upgrade the Lambda version shortly. Thankfully, I can wait. This blog post has some helpful info if you can’t wait and want to run Lambda with your own version of boto3 (or if you use Javascript Lambda see this post).