This page describes how to configure Amazon billing data for resellers. For standard accounts see Display Amazon billing data for standard accounts
Create a Cost and Usage Report in AWS
Create an S3 bucket, for example, "costandusagebillingreport"
- Within the bucket, create a folder where AWS will store your reports. Give it the name of your report, for example "costandusagebillingreport"
Note the billing bucket name, for example, "costandusagebillingreport"
- Create a new user, such as "programmaticbilling" and assign the AmazonS3ReadOnlyAccess policy
- Activate IAM user access to billing information. See https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/control-access-billing.html
Go to Billing → Billing preferences
Open the Detailed Billing Reports [Legacy] section
Select the option to Turn on the legacy Detailed Billing Reports feature to receive ongoing reports of your AWS charges
Click Configure and enter your S3 bucket
- Select all of the available reports including
- Monthly report
- Detailed billing report
- Cost allocation report
- Detailed billing report with resources and tags
Click Save preferences
Go to Cost & Usage Reports
Enter the Report name then click Next
- Click Configure and select the S3 bucket. Click Next, then select I have configured that this policy is correct.
- For the report prefix, by default, Amazon will put the reports in a folder with the name format "/report-name/date-range/". You should enter this as the report prefix in Abiquo. Click Next
- Review your configuration and check that the following parameters are set: bucket name + the path (folder/subfolder) + Time detail: Hourly + GZIP or ZIP format
Install and configure billing packages
You will need a server with MariaDB running with access to the Abiquo API, Abiquo database, and public cloud providers.
- Install the "abiquo-billing-ec2" billing package.
Create the local billing databases and import schemas
mysql -e "create database ec2_billing"
mysql -h -p -u ec2_billing < /opt/abiquo-billing-ec2/lib/app/schema.sql
Grant privileges to a user for the local billing databases
To configure, edit the config.yml file. By default for AWS, this is file is located at /opt/abiquo-billing-ec2/config/config.yml and the following example file shows the values that you must replace.
The billing database is the one you created in the above steps, so it can be hosted on localhost
"seed" is the name of a custom seed that encrypts the Abiquo database. Copy the custom seed into the same directory as the config.yml file for each provider
- On the Abiquo database, grant select privileges from this host to the abiquo_database user that will run the billing scripts
- In Abiquo, check that the Abiquo API user has the Manage bills privilege
- Assign Abiquo users the privileges to Display hybrid dashboard tab, View bills, and optionally to Display VM cost view widget (hybrid tab)
Configure Amazon Reseller accounts
If you have reseller tenants using reseller accounts, do the following steps:
Create a reseller billing configuration file at the following location:
To identify each reseller entry, create a unique random string to use as a tenant key, for example, "4a7a3850". Enter the name of the billing bucket you created in Amazon and the reseller credentials
- In Abiquo, edit the reseller enterprise and create the following enterprise properties
- "billing_bucket" with the value of "reseller" and the tenant in the format "reseller_[UUID_key_from_reseller.yml_file]". So from the above example, for the tenant with ID 4a7a385, this would be reseller_4a7a3850.
- In Abiquo, edit the enterprises of the customers of the reseller and create the following property. You can also set the default value in the reseller.
- "amazon_price_factor" with the value of the markup or discount applied by the partner to the end user. The default value is 1.