Visual studio code 通过SAM在本地调用Lambda函数时获取ExpiredToken

Visual studio code 通过SAM在本地调用Lambda函数时获取ExpiredToken,visual-studio-code,aws-lambda,aws-toolkit,Visual Studio Code,Aws Lambda,Aws Toolkit,我有一个用Python编写并使用sam cli部署的Lambda函数。但是,当我在Visual Studio代码中本地调用函数时,会收到以下错误消息: Mounting /tmp/aws-toolkit-vscode/vsctkW5t3nV/output/AWSFindUnusedElbv2Function as /var/task:ro,delegated inside runtime container START RequestId: 64ed3ebe-132c-13d2-7170-3cb

我有一个用Python编写并使用sam cli部署的Lambda函数。但是,当我在Visual Studio代码中本地调用函数时,会收到以下错误消息:

Mounting /tmp/aws-toolkit-vscode/vsctkW5t3nV/output/AWSFindUnusedElbv2Function as /var/task:ro,delegated inside runtime container
START RequestId: 64ed3ebe-132c-13d2-7170-3cb7a5afe4ee Version: $LATEST
[DEBUG] 2020-10-23T06:07:19.64Z 64ed3ebe-132c-13d2-7170-3cb7a5afe4ee    Getting the list of load balancers from ap-southeast-1
[ERROR] ClientError: An error occurred (ExpiredToken) when calling the DescribeLoadBalancers operation: The security token included in the request is expired
Traceback (most recent call last):
  File "/var/task/app.py", line 132, in handler
    elb_response = elb_client.describe_load_balancers()
  File "/var/task/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/var/task/botocore/client.py", line 676, in _make_api_call
    raise error_class(parsed_response, operation_name)
但是,如果我只是从shell提示符(不是在VisualStudio代码中)调用它,就不会出现此错误。我对shell和visualstudio代码使用相同的配置文件