- Configure billing in cloud providers as required
- AWS EC2 - https://aws.amazon.com/blogs/aws/new-programmatic-access-to-aws-billing-data/
Create an S3 bucket and assign the following policy to make it writable by AWS programmatic billing.
The "Resource" attribute will need the bucket name at the end. For the example, we have used "programmaticbilling".Expand Code Block { "Version": "2008-10-17", "Id": "Policy1335892530063", "Statement": [ { "Sid": "Stmt1335892150622", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::386209384616:root" }, "Action": [ "s3:GetBucketAcl", "s3:GetBucketPolicy" ], "Resource": "arn:aws:s3:::programmaticbilling" }, { "Sid": "Stmt1335892526596", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::386209384616:root" }, "Action": "s3:PutObject", "Resource": "arn:aws:s3:::programmaticbilling/*" } ] }
- Go to Billing preferences and assign the bucket name you have configuredname of your bucket for programmatic billing
- Create a new programmaticbilling user for programmatic billing (any the user name is not important) and add the AmazonS3ReadOnlyAccess policy
- Azure ARM
- Grant access to billing records to the app role created in Azure
- Obtain the OfferDurableID from the offer agreement for your enterprise by going to your subscription → Administer. Also, you should check the Currency, Locale and RegionInfo.
- AWS EC2 - https://aws.amazon.com/blogs/aws/new-programmatic-access-to-aws-billing-data/
- In Abiquo, configure Enterprise properties with the name of billing properties
- AWS EC2
- "billing_bucket" property, with a value of the name of the billing bucket you created in the previous step 1
- Azure ARM requires
- OfferDurableID
- Currency, the default is "USD"
- Locale, the default is "en-US"
- RegionInfo, the default is "US"
- AWS EC2
- On a server with MariaDB installed and with access to Abiquo Server, Abiquo database and public cloud providers, install the new billing packages
- abiquo-billing-arm
- abiquo-billing-ec2
- Configure billing packages
- AWS: Edit /opt/abiquo-billing-ec2/config/config.yml
- Abiquo database connection: user must be granted select from this host
- ec2-billing database: can be hosted on localhost
- Abiquo API: user must have Manage bills privilege
- AWS: Edit /opt/abiquo-billing-ec2/config/config.yml
Edit the configuration files in config/config.yml
Create the local billing databases and import schemas
AWS:
Code Block mysql -e "create database ec2_billing" mysql -h -p -u ec2_billing < /opt/abiquo-billing-ec2/lib/app/schema.sql
Azure:
Code Block mysql -e "create database arm_billing" mysql -h -p -u arm_billing < /opt/abiquo-billing-arm/lib/app/schema.sql
- Grant permissions on the local billing databases to the user configured in each config.yml
- If the Abiquo database is encrypted with a custom seed, copy that seed with each config.yml
- Assign Abiquo user privileges to Display hybrid dashboard tab, View bills, and optionally to Display VM cost view widget (hybrid tab)
...