Support for AWS session tokens
In my organization, we have a number of AWS accounts that require temporary AWS session tokens in order to perform any action from the terminal, also known as security tokens in the dynamoDB boto modules. When trying to dump or load dynamoDB tables with this dynamodump tool, we were met with this message: {u'message': u'The security token included in the request is invalid.', u'__type': u'com.amazon.coral.service#UnrecognizedClientException'}
To rectify this, I added support from both the command line args and from boto3's Session library to include the security token with the dynamodbs connections, which default to None if not present (as was previous behavior).
This might need to be confirmed by someone else, but I at times had issues with the line boto.dynamodb2.connect_to_region(args.region, profile_name=args.profile) where I would get the above error message for accounts that don't require session tokens, even when I completely removed the security_token input. I changed that line to use the credentials pulled from ~/.aws/credentials for the input profile, which fixed my issue for accounts that both do or don't require the session token.
I named boto3 1.4.1 as a minimum requirement as it's the most recent revision to boto3's Session feature.
any update on this?
I used the code and it works perfectly. I am able to use session tokens and profiles stores in .aws/config. Not sure if this is all still alive, but so everyone else knows :)
@nbasu02 thanks for the PR and apologies it has taken this long to respond - if you would like to resolve the conflicts I'll be happy to merge this in
Edit: I've yet to verify but as boto2 has been deprecated, is this PR still be applicable?