I get: The security token included in the request is invalid
Where do I get a session token? The current documentation is confusing. On the one hand it says:
If you make a request using AWS::DynamoDB with long-term credentials a request is made to Amazon STS for temporary session credentials. These will be cached in the process and re-used.
and next it says:
Amazon DynamoDB requires that all requests are made with short-term credentials (e.g. requires a session token).
so exactly where does the session_token come from if I don't provide it? And if the call provides it, why would it be invalid?
requires 'aws-sdk'
cred = {:access_key_id => 'xxxx',
:secret_access_key => 'yyyy'}
#:session_token => ''}
ddb = AWS::DynamoDB.new(cred)
items = {...}
ddb.batch_write do |batch|
batch.put('my_mappings', items)
end