使用 boto3/aws cli return 的 Lambda 服务配额没有结果

Lambda service quotas with boto3/aws cli return with no results

我正在尝试使用 Boto3 或 CLI 获取最新的 Lambda 并发执行配额,但两者 return 都是空的。我们已经将配额增加了几次,现在是 2500,但是在控制台中,它显示“应用的配额值”是“不可用”。关于如何获得当前值的任何想法?

$> aws service-quotas list-service-quotas --service-code "lambda"
{
    "Quotas": []
}

您可以使用 Lambda GetAccountSettings API via CLI:

获取 AWS Lambda 并发执行限制
aws lambda get-account-settings

输出:

{
    "AccountLimit": {
        "TotalCodeSize": 80530636800,
        "CodeSizeUnzipped": 262144000,
        "CodeSizeZipped": 52428800,
        "ConcurrentExecutions": 1000,
        "UnreservedConcurrentExecutions": 1000
    },
    "AccountUsage": {
        "TotalCodeSize": 10,
        "FunctionCount": 1
    }
}

如果您只需要并发执行限制,您可以使用 --query:

提取它
aws lambda get-account-settings --output text --query "AccountLimit.ConcurrentExecutions"

输出:

1000