1👍
✅
Your code on your EB instance uses instance role to provide it with AWS credentials. When you do this, x-amz-security-token
is used which is a regular part of AWS credentails when you use IAM roles.
In contrast, when you run it locally, you use IAM user for AWS credentials. In that case, token is not used.
Source:stackexchange.com