Skip to content

BCMDataExports: COST_AND_USAGE_REPORT for previous period(s)?

0

Wondering if I can set up a CUR (2.0) to query past data. As far as I understand from the documentation [1], the export will be written to the S3 bucket from the creation date looking back until the beginning of the billing period (then updated until the end, then a new export is created).

Is there a way to create a report for a previous period / periods?

Example CFN:

  CURReportDefinition:
    DependsOn: S3ClientBucketAccessPolicy
    Type: AWS::BCMDataExports::Export
    Properties:
      Export:
        DataQuery:
          QueryStatement: "SELECT <columns> FROM COST_AND_USAGE_REPORT"
          TableConfigurations:
            COST_AND_USAGE_REPORT:
              INCLUDE_RESOURCES: "TRUE"
              INCLUDE_SPLIT_COST_ALLOCATION_DATA: "TRUE"
              TIME_GRANULARITY: "HOURLY"
        DestinationConfigurations:
          S3Destination:
            S3Bucket: !Ref S3ClientBucket
            S3Region: !Ref Region
            S3Prefix: ""
            S3OutputConfigurations:
              Compression: "PARQUET"
              Format: "PARQUET"
              OutputType: "CUSTOM"
              Overwrite: "CREATE_NEW_REPORT"
        Name: <export name>
        RefreshCadence:
          Frequency: "SYNCHRONOUS"

[1] https://docs.aws.amazon.com/cur/latest/userguide/what-is-cur.html

asked a year ago256 views
1 Answer
0

In your CloudFormation template, you have set the Overwrite property to CREATE_NEW_REPORT. This means that each time the report runs, it will create a new report instead of updating the existing one

EXPERT
answered a year ago
  • I am aware. That means I am getting new files, keeping the old ones. It doesn't affect how far back the report (or reports) looks.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.