Skip to content

IAmFrench/terraform-alicloud-billing-export

Repository files navigation

Alibaba Cloud Billing export Terraform Module

Terraform Module witch creates billing export on Alibaba Cloud.

This module will create an OSS bucket for billing data and will enable all billing exports supported by Alibaba Cloud.

Known limitations

  • It use the Alibaba Cloud CLI to subscribe to bills.
  • It need to run with the Alibaba Cloud CLI > v3.0.121 as the aliyun bssopenapi SubscribeBillToOSS command is not supported on older versions.
  • You will need to wait ~30s to view new bill folders in your OSS bucket.
  • You can only have one export per bill type, you may first need to run this next command aliyun bssopenapi UnsubscribeBillToOSS --region YOUR-REGION-HERE --SubscribeType BILL-TYPE-HERE.
  • MonthBill (Monthly bill in the PDF format) export is not working using the Alibaba Cloud CLI.

Note: On destroy, this module will unsubscribe to bill.

Requirements

Name Version
terraform >= 1.4.0
alicloud >= 1.201.2

Providers

Name Version
alicloud >= 1.201.2
terraform n/a

Modules

No modules.

Resources

Name Type
alicloud_oss_bucket.billing_export_bucket resource
terraform_data.subscribe_bill_to_oss resource

Inputs

Name Description Type Default Required
oss_billing_export_bucket_name Name used for the OSS billing bucket. string n/a yes
region The region used to launch this module resources. string n/a yes

Outputs

No outputs.