假设我有组织并且我想根据帐户明智地获得成本。我怎么才能得到它?
我正在使用aws-sdk
nodejs。如何列出所有帐户并明智地获取成本帐户?
我为此使用 AWS lambda。任何帮助将不胜感激。
我正在尝试在下面使用单个帐户但我无法设置维度,并且我对在线资源无能为力
var params = {
Granularity: DAILY | MONTHLY | HOURLY, /* required */
Metric: BLENDED_COST | UNBLENDED_COST | AMORTIZED_COST | NET_UNBLENDED_COST | NET_AMORTIZED_COST | USAGE_QUANTITY | NORMALIZED_USAGE_AMOUNT, /* required */
TimePeriod: { /* required */
End: 'STRING_VALUE', /* required */
Start: 'STRING_VALUE' /* required */
},
Filter: { /* Expression */
And: [
/* recursive Expression */,
/* more items */
],
CostCategories: {
Key: 'STRING_VALUE',
MatchOptions: [
EQUALS | ABSENT | STARTS_WITH | ENDS_WITH | CONTAINS | CASE_SENSITIVE | CASE_INSENSITIVE,
/* more items */
],
Values: [
'STRING_VALUE',
/* more items */
]
},
Dimensions: {
Key: AZ | INSTANCE_TYPE | LINKED_ACCOUNT | LINKED_ACCOUNT_NAME | OPERATION | PURCHASE_TYPE | REGION | SERVICE | SERVICE_CODE | USAGE_TYPE | USAGE_TYPE_GROUP | RECORD_TYPE | OPERATING_SYSTEM | TENANCY | SCOPE | PLATFORM | SUBSCRIPTION_ID | LEGAL_ENTITY_NAME | DEPLOYMENT_OPTION | DATABASE_ENGINE | CACHE_ENGINE | INSTANCE_TYPE_FAMILY | BILLING_ENTITY | RESERVATION_ID | RESOURCE_ID | RIGHTSIZING_TYPE | SAVINGS_PLANS_TYPE | SAVINGS_PLAN_ARN | PAYMENT_OPTION | AGREEMENT_END_DATE_TIME_AFTER | AGREEMENT_END_DATE_TIME_BEFORE,
MatchOptions: [
EQUALS | ABSENT | STARTS_WITH | ENDS_WITH | CONTAINS | CASE_SENSITIVE | CASE_INSENSITIVE,
/* more items */
],
Values: [
'STRING_VALUE',
/* more items */
]
},
Not: /* recursive Expression */,
Or: [
/* recursive Expression */,
/* more items */
],
Tags: {
Key: 'STRING_VALUE',
MatchOptions: [
EQUALS | ABSENT | STARTS_WITH | ENDS_WITH | CONTAINS | CASE_SENSITIVE | CASE_INSENSITIVE,
/* more items */
],
Values: [
'STRING_VALUE',
/* more items */
]
}
},
PredictionIntervalLevel: 'NUMBER_VALUE'
};
costexplorer.getCostForecast(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});