aws-samples / aws-cost-explorer-report

Python SAM Lambda module for generating an Excel cost report with graphs, including month on month cost changes. Uses the AWS Cost Explorer API for data.
MIT No Attribution
432 stars 166 forks source link

ValidationException when calling the GetCostAndUsage operation #27

Open yogi29 opened 4 years ago

yogi29 commented 4 years ago

Hi Team

I am getting below Validation exception error while running this lambda function (Python 3.6 runtime). Please advise how can fix the same?

Function logs: START RequestId: d2bbaa3a-3be2-4be6-9f32-db63a5c0b5ea Version: $LATEST An error occurred (ValidationException) when calling the GetCostAndUsage operation: And expression must have at least 2 operands: ClientError Traceback (most recent call last): File "/var/task/lambda_function.py", line 428, in main_handler costexplorer.addReport(Name="Total", GroupBy=[],Style='Total',IncSupport=True) File "/var/task/lambda_function.py", line 305, in addReport Filter=Filter File "/var/runtime/botocore/client.py", line 316, in _api_call return self._make_api_call(operation_name, kwargs) File "/var/runtime/botocore/client.py", line 635, in _make_api_call raise error_class(parsed_response, operation_name) botocore.exceptions.ClientError: An error occurred (ValidationException) when calling the GetCostAndUsage operation: And expression must have at least 2 operands

Regards

ankitosh commented 3 years ago

Hello @yogi29 ,

I am also facing same issue. Could you please let me know if you have found solution to this.

Br,

nduong9 commented 2 years ago

I am facing the same issue. any idea? will we get that error due to " organizations:ListAccounts" permission? incase I don't have organizations:ListAccounts permission (due to my organization policy) is there anyway to make the report working? Br,