epsagon / lambda-cost-calculator

Forecast Lambda functions costs 💰
https://epsagon.com/blog/how-much-does-aws-lambda-cost/
MIT License
105 stars 13 forks source link

The security token included in the request is invalid. #3

Closed gvasquez95 closed 4 years ago

gvasquez95 commented 4 years ago

Tried both passing id/secret as parameters, and with no params to use environment settings, both yield the same output:

N/A% (0 of 18) | | Elapsed Time: 0:00:00 ETA: --:--:--Traceback (most recent call last): File "lambda_cost_calculator.py", line 229, in <module> print_lambda_cost(arguments) File "lambda_cost_calculator.py", line 128, in print_lambda_cost response = lambda_client.list_functions() File "/Users/gonzalovasquez/Library/Python/3.7/lib/python/site-packages/botocore/client.py", line 357, in _api_call return self._make_api_call(operation_name, kwargs) File "/Users/gonzalovasquez/Library/Python/3.7/lib/python/site-packages/botocore/client.py", line 661, in _make_api_call raise error_class(parsed_response, operation_name) botocore.exceptions.ClientError: An error occurred (UnrecognizedClientException) when calling the ListFunctions operation: The security token included in the request is invalid.

Also tried both Python 2.7 (different path in exception) and 3.7, all in OSX

shanedroid commented 4 years ago

I hit this as well trying to run from MacOS:

~/dev/repos/lambda-cost-calculator$ sw_vers && python --version
ProductName:  Mac OS X
ProductVersion: 10.14.6
BuildVersion: 18G3020
Python 3.7.6

~/dev/repos/lambda-cost-calculator$ python lambda_cost_calculator.py --token-key-id <REDACTED> --token-secret <REDACTED>
N/A% (0 of 18) |                                                                                               | Elapsed Time: 0:00:00 ETA:  --:--:--Traceback (most recent call last):
  File "lambda_cost_calculator.py", line 229, in <module>
    print_lambda_cost(arguments)
  File "lambda_cost_calculator.py", line 128, in print_lambda_cost
    response = lambda_client.list_functions()
  File "/usr/local/lib/python3.7/site-packages/botocore/client.py", line 316, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/usr/local/lib/python3.7/site-packages/botocore/client.py", line 626, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (UnrecognizedClientException) when calling the ListFunctions operation: The security token included in the request is invalid.

Also tried several way to feed id/secret without success.

ranrib commented 4 years ago

Closing since the last PR should have solved it - if it still occurs, please re-open. Thanks!