`generate_lambda_session_name` can return a session name >64 chars
lorengordon opened this issue · 4 comments
lorengordon commented
Just ran into this issue... if the function name is sufficiently long, the session name returned by generate_lambda_session_name
will fail...
An error occurred (ValidationError) when calling the AssumeRole operation: 1 validation error detected: Value 'new-account-trust-policy-nnnnnnnnnnn.mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm' at 'roleSessionName' failed to satisfy constraint: Member must have length less than or equal to 64
benkehoe commented
Do you think it should be the function name or the identifier that should be truncated? My gut says identifier, there's more uniqueness in it than the function name
lorengordon commented
I think I agree... Use only the first 64 chars and whatever snippet of the identifier makes it, hopefully will be unique enough to trace it down...
benkehoe commented
Try version 1.7. I tried to make it smart, so the format is always kept, rather than just truncating it plainly. See the readme.
lorengordon commented
Works like a champ, thanks!