无法访问的主机:`savingsplans.eu-west-1.amazonaws.com'。此服务可能在“eu-west-1”区域不可用

Inaccessible host: `savingsplans.eu-west-1.amazonaws.com'. This service may not be available in the `eu-west-1' region

我正在尝试使用

列出我帐户中所有可用的储蓄计划
var savingsPlans = new AWS.SavingsPlans();
const listResponse: AWS.SavingsPlans.DescribeSavingsPlansResponse = await savingsPlans.describeSavingsPlans({nextToken: token}).promise();

但是出现以下错误。请帮忙。

 "error": {
        "message": "Inaccessible host: `savingsplans.eu-west-1.amazonaws.com'. This service may not be available in the `eu-west-1' region.",
        "code": "UnknownEndpoint",
        "region": "eu-west-1",
        "hostname": "savingsplans.eu-west-1.amazonaws.com",
        "retryable": true,
        "originalError": {
            "message": "getaddrinfo ENOTFOUND savingsplans.eu-west-1.amazonaws.com",
            "errno": "ENOTFOUND",
            "code": "NetworkingError",
            "syscall": "getaddrinfo",
            "hostname": "savingsplans.eu-west-1.amazonaws.com",
            "region": "eu-west-1",
            "retryable": true,
            "time": "2022-03-03T05:32:05.683Z"
        },
}
'''

根据the docs,端点url是:

savingsplans.amazonaws.com

您可以manually specify更正端点:

var savingsPlans = new AWS.SavingsPlans({endpoint: 'https://savingsplans.amazonaws.com'});