1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "records": [
12 {
13 "bill/BillingPeriodStartDate": "2026-10-01T00:00:00Z",
14 "lineItem/LineItemType": "Usage",
15 "lineItem/UsageAccountId": "111111111111",
16 "lineItem/ProductCode": "AmazonEC2",
17 "lineItem/UnblendedCost": "80.00",
18 "lineItem/ResourceId": "i-example-prod",
19 "lineItem/CurrencyCode": "USD",
20 "resourceTags/user:CostCenter": "Platform"
21 },
22 {
23 "bill/BillingPeriodStartDate": "2026-10-01T00:00:00Z",
24 "lineItem/LineItemType": "Usage",
25 "lineItem/UsageAccountId": "111111111111",
26 "lineItem/ProductCode": "AmazonEC2",
27 "lineItem/UnblendedCost": "20.00",
28 "lineItem/ResourceId": "i-example-review",
29 "lineItem/CurrencyCode": "USD",
30 "resourceTags/user:CostCenter": ""
31 },
32 {
33 "bill/BillingPeriodStartDate": "2026-10-01T00:00:00Z",
34 "lineItem/LineItemType": "Usage",
35 "lineItem/UsageAccountId": "111111111111",
36 "lineItem/ProductCode": "AmazonEC2",
37 "lineItem/UnblendedCost": "10.00",
38 "lineItem/ResourceId": "",
39 "lineItem/CurrencyCode": "USD",
40 "resourceTags/user:CostCenter": ""
41 },
42 {
43 "bill/BillingPeriodStartDate": "2026-10-01T00:00:00Z",
44 "lineItem/LineItemType": "Usage",
45 "lineItem/UsageAccountId": "222222222222",
46 "lineItem/ProductCode": "AmazonS3",
47 "lineItem/UnblendedCost": "5.00",
48 "lineItem/ResourceId": "bucket-example",
49 "lineItem/CurrencyCode": "USD",
50 "resourceTags/user:CostCenter": ""
51 },
52 {
53 "bill/BillingPeriodStartDate": "2026-10-01T00:00:00Z",
54 "lineItem/LineItemType": "Usage",
55 "lineItem/UsageAccountId": "222222222222",
56 "lineItem/ProductCode": "AmazonS3",
57 "lineItem/UnblendedCost": "1.00",
58 "lineItem/ResourceId": "bucket-tagged",
59 "lineItem/CurrencyCode": "USD",
60 "resourceTags/user:CostCenter": "Data"
61 },
62 {
63 "bill/BillingPeriodStartDate": "2026-10-01T00:00:00Z",
64 "lineItem/LineItemType": "SavingsPlanCoveredUsage",
65 "lineItem/UsageAccountId": "111111111111",
66 "lineItem/ProductCode": "AmazonEC2",
67 "lineItem/UnblendedCost": "40.00",
68 "lineItem/ResourceId": "i-sp-covered",
69 "lineItem/CurrencyCode": "USD",
70 "resourceTags/user:CostCenter": ""
71 },
72 {
73 "bill/BillingPeriodStartDate": "2026-10-01T00:00:00Z",
74 "lineItem/LineItemType": "Usage",
75 "lineItem/UsageAccountId": "333333333333",
76 "lineItem/ProductCode": "AmazonRDS",
77 "lineItem/UnblendedCost": "2.00",
78 "lineItem/ResourceId": "db-tagged",
79 "lineItem/CurrencyCode": "USD",
80 "resourceTags/user:CostCenter": "Team"
81 },
82 {
83 "bill/BillingPeriodStartDate": "2026-10-01T00:00:00Z",
84 "lineItem/LineItemType": "Usage",
85 "lineItem/UsageAccountId": "111111111111",
86 "lineItem/ProductCode": "AmazonEC2",
87 "lineItem/UnblendedCost": "0.00",
88 "lineItem/ResourceId": "i-zero",
89 "lineItem/CurrencyCode": "USD",
90 "resourceTags/user:CostCenter": ""
91 }
92 ],
93 "tagKey": "CostCenter",
94 "billingMonth": "2026-10"
95};
96
97
98const run = await client.actor("natstandridge/aws-cur-tag-coverage-audit").call(input);
99
100
101console.log('Results from dataset');
102console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
103const { items } = await client.dataset(run.defaultDatasetId).listItems();
104items.forEach((item) => {
105 console.dir(item);
106});
107
108