I am trying to List all available savings plan in my account using
var savingsPlans = new AWS.SavingsPlans();
const listResponse: AWS.SavingsPlans.DescribeSavingsPlansResponse = await savingsPlans.describeSavingsPlans({nextToken: token}).promise();
But getting following error. Please help.
"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"
},
}
'''
CodePudding user response:
According to the docs, the endpoint url is:
savingsplans.amazonaws.com
You can manually specify correct endpoint:
var savingsPlans = new AWS.SavingsPlans({endpoint: 'https://savingsplans.amazonaws.com'});