-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sam local start-api fails with "The security token included in the request is invalid" #3875
Comments
Thanks for raising this issue, but I wasn't able to re-produce with your example template. When I ran the When you run
If your local user permissions should stay as it is, then I would recommend using SAM Accelerate feature, which gives ability to develop your serverless application in the cloud. https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/accelerate.html |
Thank you for this! I haven't tried that; I'll give it a try here shortly. This brings up another related question. You'll see in the template that the lambda function obtains its IAM permissions from the I ask because we have a lot of cases when the credentials used for development differ significantly from the ones the function will run in the cloud. I'd expect that the |
Thanks for your feedback. That is the reason why we have implemented Accelerate features. It is not possible to test all the aspects of serverless functions on your local machine. As you mentioned, we can't assume the role that is used in the template with For that reason I would highly recommend giving Accelerate a try. If you have any questions or concern please feel free to comment under this issue #3264 or create a new one. I will keep this one until I got your feedback to see if there are any issues with emulation image that we have. |
Thanks for this! I was able to get the sample to work using my local credentials. Closing. |
Description:
I have a small API which uses a KMS key to encrypt and decrypt strings. The API works exactly as expected when deployed to AWS, but fails when run locally with "The security token included in the request is invalid".
There are several bugs that have variations on this theme, but all of them are at least six months old. I'm opening this one to address it in newer versions of SAM / the nodejs Docker image.
Steps to reproduce:
encryption-test.zip
fileand
The first one (the one that points to AWS) will succeed, but the second one will fail.
Observed result:
Expected result:
Making the
curl
call againstsam local start-api
should work the same as against API Gateway.Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
: SAM CLI, version 1.46.0I'm running nodejs 14.x with image
samcli/lambda:nodejs14.x-x86_64-f88a901bbe51b578e9260ae49
.Add --debug flag to command you are running
The text was updated successfully, but these errors were encountered: