Updated on 2024-11-14 GMT+08:00

Exporting Cost Details to OBS

Cost Center provides you with cost and usage details with cost allocation identifiers. You can create OBS export tasks to periodically export the details files to OBS buckets.

Important Notes

You can create up to 10 export tasks.

If you are using an enterprise master account, the cost details you export will include your own cost data and the cost data of your member accounts associated for unified accounting management.

  1. The current month's costs are only estimates. Before your bill is generated, export the latest cost details to view the exact amounts. After your bill is generated on the 4th day of the following month, view the exact amounts in the bill.
  2. For the meanings of fields in the exported files, see Export to OBS - Fields for Amortized Costs and Export to OBS - Fields for Original Costs.

Prerequisites

An OBS bucket is available.

If you are an IAM user, ensure that your administrator has granted you the OBS bucket permissions to:

  • Obtain the bucket ACL information.
  • Obtain the bucket policy configuration.
  • Configure a bucket policy.
  • Delete a bucket policy.
  • List all buckets.

Creating an OBS Export Task

  1. Log in to Cost Center.
  2. Choose Cost Insights > Cost Details Export.
  3. On the Export to OBS page, click Create Export Task.
  4. Configure the OBS export task information and click Save.

    Category

    Field

    Description

    Example

    Task name

    Task Name

    Enter a unique name for each task.

    test

    OBS bucket settings

    Bucket Name

    Select an OBS bucket to store the cost details file from the drop-down list box.

    cost-alpha-test

    Bucket Directory Prefix

    Enter the level-1 directory for storing cost details files.

    cost

    Export content

    Cost Type

    Select original costs or amortized costs from the drop-down list.

    Amortized costs

    Granularity

    Determine at which granularity you want to summarize cost details. Currently, only Daily is supported.

    Daily

    Start Billing Cycle

    Specify the billing cycle from which you want to start exporting the cost details files to OBS.

    The default billing cycle is the current month. If you select a start billing cycle, Cost Center will push the cost details from that billing cycle to the current month to your OBS bucket.

    For the data scope allowed for historical billing cycles, see Data Scope.

    Current billing cycle

    Customize Columns

    The default value is Yes.

    Yes: Include Resource Tag (also referred to as Cost Tag) and Cost Category as fixed columns. Their values are presented by key-value pairs.

    No: Include each key of a cost tag or cost category as a separated column. The change of any key will change the file columns.

    Yes

    File Settings

    Storage Method

    Select the method for storing the exported cost details file. There are two methods:

    • Creating a new file: When a daily cost details file is pushed to OBS, a new folder named after the current calendar date will be created. All the folders are saved by date in the billing cycle directory.
      • The file storage directory will be in the format of {Bucket directory prefix}/{Task name}/{Billing cycle}/{File push time}/{File name}, for example, cost/test/202310/20231016T092614Z/amortized_cost_202310_000001.zip.
    • Overwriting existing files: When a daily cost details file is pushed to OBS, it will overwrite the existing file for the same billing cycle to ensure that only the latest cost detail file will be retained in the billing cycle directory. The file storage directory will be in the format of {Bucket directory prefix}/{Task name}/{Billing cycle}/{File name}, for example, cost/test/202310/amortized_cost_202310_000001.zip.

    Creating a new file

    Update Method

    Currently, only Auto update is supported. Cost Center pushes cost details files to the OBS bucket every day as specified. If the cost data in a historical billing cycle has changed, Cost Center will push all of the latest cost data to the directory for that billing cycle.

    Auto update

Viewing an OBS Export Task

  1. Log in to Cost Center.
  2. Choose Cost Insights > Cost Details Export.
  3. On the Export to OBS page, view the list of OBS export tasks.

    Field

    Description

    OBS Bucket

    OBS bucket used to store the cost details file.

    Bucket Directory Prefix

    Level-1 directory for storing the cost details file.

    Granularity

    Granularity at which you want to summarize cost details. Currently, only Daily is supported.

    Created

    Time when the OBS export task was created.

    Updated

    Last time when the cost details file was exported to the OBS bucket.

    OBS export tasks are executed once a day. If the time for Updated is 24 hours ago, the OBS export task failed to be executed.

    Bucket Directory Example

    Path for obtaining the cost details file from the OBS bucket.

    • If the message shown in the following figure is displayed, the OBS export task failed to be executed. In this case, access the OBS console to check whether the bucket is invalid or whether the bucket policy has been changed. If the bucket is valid and the bucket policy remains unchanged, check whether the bucket is encrypted using server-side encryption. Currently, files cannot be exported to OBS buckets encrypted using server-side encryption.

Obtaining Cost Details

After an OBS export task is created, it is executed once a day. Cost Center pushes the cost details file to the following path in the OBS bucket:

  • Storage Method set to Overwriting existing files: {Bucket directory prefix}/{Task name}/{Billing cycle}/{File name}

    Example: If the task name is test, the bucket directory prefix is cost, and the billing cycle is 202310, then the path for the exported file will be cost/test/202310/amortized_cost_202310_000001.zip.

  • Storage Method set to Creating a new file: {Bucket directory prefix}/{Task name}/{Billing cycle}/{File push time}/{File name}

    Example: If the task name is test, the bucket directory prefix is cost, and the billing cycle is 202310, then the path will be cost/test/202310/20231016T093940Z/original_cost_202310_000001.zip if you export the file on October 16, 2023.

You can directly download the file from the file path or use an API or SDK to obtain the cost details file from the OBS bucket.