我试图在使用boto
和lambda
时使用cost explorer获取前一天的成本。但我得到了错误
" "errorMessage": "An error occurred (ValidationException) when calling the GetCostAndUsage operation: " and the error type is "ClientError".
我已将区域指定为us-east-1
。我的政策是
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ce:*"
],
"Resource": [
"*"
]
}
]
}
我的代码在下面
^{pr2}$
我认为你有两个问题:
get_cost_and_usage()
调用的强制Metrics
关键字。在将您的
^{pr2}$get_cost_and_usage()
调用改为如下所示应该可以:相关问题 更多 >
编程相关推荐