Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

ValidationException when calling the GetCostAndUsage operation #27

Open
yogi29 opened this issue Sep 3, 2020 · 2 comments
Open

ValidationException when calling the GetCostAndUsage operation #27

yogi29 opened this issue Sep 3, 2020 · 2 comments

Comments

@yogi29
Copy link

yogi29 commented Sep 3, 2020

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
Copy link

Hello @yogi29 ,

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

Br,

@nduong9
Copy link

nduong9 commented Apr 28, 2022

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,

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants