Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

120
Views
AWS monthly billing service charges nodejs

I am trying to get the monthly billing data for an AWS production account through a nodejs script.

const getbillingReport = () => {


        getcreds({ accountId: '1234554321', region:'us-east-1'})
        .then(accCreds => {
        costexplorer = new AWS.CostExplorer(accCreds);

        var params = {
        Metrics: [ 
        'BlendedCost',
        ],
        TimePeriod: { 
            End:'2022-02-28',
            Start: '2022-02-01',
        },
        Granularity: 'MONTHLY',
        
        };

        costexplorer.getCostAndUsage(params, function(err, data) {
            if (err) console.log(err, err.stack);
            else     console.log(JSON.stringify(data));    


        })
    });

The amount that I get by running the query is different from the actual Amazon Web Services, Service Charges that I see when I navigate to the Billing Dashboard --> Bills and choose a month(February 2022). Could someone guide me on the changes I should make on the query to get the exact amount that I see in the billing dashboard

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The aws documentation states that the End in TimePeriod is exclusive in nature. So I had to modify the params list to be March 1st so that the billing information for 28 Feb is also included. i.e. TimePeriod: { End:'2022-03-01', Start: '2022-02-01', },

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!