Every Blesta service lives through the same handful of events: it's activated, it renews, it may be suspended for an unpaid invoice, and one day it's cancelled. When the service is a shared hosting account, those events cost you nothing extra. When it's something running in your AWS account, each one changes your AWS bill, and Blesta can't see that bill.
Building the package is the easy part. The work is making each Blesta event do the right thing at AWS, so the meter starts when the client pays and stops when they leave.
What Blesta can sell on AWS
Thirteen AWS services work well as Blesta packages. Grouped by the job they do for the client:
Servers
- Lightsail: a VPS with a fixed monthly plan that includes a data transfer allowance. The easiest AWS product to price.
- EC2: a choice of instance types and images, Windows included, for clients who want more control.
Relational databases (Amazon RDS)
- MySQL, MariaDB, PostgreSQL, Oracle and SQL Server. MySQL and PostgreSQL can also run on Lightsail's flat-priced databases, which suit entry-level plans.
- Oracle and SQL Server are licence-included at AWS, so nobody buys a separate licence. The licence is built into AWS's hourly rate, so price those packages higher.
Other databases
- DocumentDB (document database), Neptune (graph database) and ElastiCache (in-memory cache).
- All three are reachable only from inside your AWS network (the VPC), with no public address. They suit clients whose application servers already run in AWS. Put that on the order form, or clients will order one and find they can't connect from their office.
Storage, DNS and messaging
- S3: object storage for backups, media and static files.
- Route 53: DNS hosting, for any client with a domain.
- SNS: SMS. This one is for you rather than for sale: it texts clients about invoices, services and ticket replies.
The setup every AWS package shares
One module row per product line, each with its own IAM user. In Blesta, AWS credentials are stored on the module under Settings → Company → Modules → Manage, as a module row (an "account"), and the package then chooses which row to use. Don't paste your root keys there. Create a dedicated IAM user for each product line, with only the permissions that product needs. The SMS gateway, for example, needs only sns:Publish to send. If a key leaks, you revoke one user and every other product line keeps working.
Generate package options from AWS rather than typing them. Region, plan, operating system, extra storage, a static IP and the number of snapshots a client may keep all belong in package options under Packages → Configurable Options. Lists typed by hand go out of date, because AWS adds regions and retires plans and images. Not every plan, instance class or engine exists in every region either, and ElastiCache needs a default VPC in the region you sell from. Build the options from what AWS offers per region, then set your prices for each term.
Check that paid orders really provision. Blesta builds paid orders through its Provision Paid Pending Services automation task. If a package has Hold paid pending services for manual activation ticked, paid orders wait for a member of staff, and when staff activate a service by hand, Use module must be selected, or nothing is created at AWS. Keep the cron running often (Settings → Company → Automation), because the steps after "create" happen in the background.
Put the client's controls on the service tabs. A module can add tabs to the client's service page for power, connection details, firewall rules, snapshots and usage graphs. The client never needs an AWS login.
Follow one service through its life
Suspension: stopped is not the same as free
- Lightsail: AWS bills instances and managed databases until they're deleted, including while they're stopped.
- EC2: a stopped instance stops charging for compute. EBS volumes and Elastic IP addresses keep charging whatever state the instance is in.
- RDS, DocumentDB and Neptune: stopping them saves the instance hours, but storage and backups are still billed. AWS also starts a stopped database again by itself after seven days, so it doesn't miss maintenance. A database you stopped for an unpaid invoice is back on full charge a week later.
- ElastiCache: a cache has no stopped state, and a reboot doesn't reduce the bill.
Suspending for non-payment is still right: it keeps the client's data while they sort out the invoice. But treat it as a short state, and cancel services that stay unpaid rather than leaving them suspended for months.
Cancellation: one service, many AWS resources
When a client cancels, Blesta cancels the service, and if Use module is ticked, the module is asked to remove it. What "remove" covers is what matters:
- an EC2 server brings an Elastic IP, a security group, a key pair, extra volumes and backups;
- a Lightsail server can have snapshots, an extra disk and a static IP, and AWS charges for a static IP that stays unattached for more than an hour;
- a database has snapshots and firewall rules.
If you delete only the main resource, the rest keeps billing with nobody paying for it. Cancellations made without Use module leave everything running, so check them.
Decide in advance what happens to client data at cancellation. Deleting a client's last backup at once is harsh; keeping it indefinitely costs you. A retention window is a fair middle ground.
Snapshots: billed for as long as they exist
AWS charges for snapshot storage until the snapshot is deleted. If clients can take snapshots, limit how many they keep, or sell extra snapshot slots as a package option.
Sell fixed allowances and keep an eye on usage
Three of these products cost you more as the client uses them more. Sell each as a fixed allowance with a clear upgrade path, and your margin stays predictable:
- Lightsail: outbound data transfer beyond the plan's allowance is charged to you by AWS. Build transfer into the plan price, and watch heavy users.
- S3: sell storage in quota tiers, one package option per tier, and measure usage so you know when a client has outgrown their tier.
- SMS: AWS charges per message part, and a long or non-Latin message is split into several parts. Count the parts before you send a campaign.
The other leak is drift. A client upgrades and the renewal price isn't revisited, AWS changes a rate, or a resource from an old order is still running. None of this appears in Blesta. Once a month, compare the AWS bill with what each Blesta service actually brings in.
The module we built for this
We make a Blesta module for each of the thirteen: PD AWS Lightsail, PD AWS EC2, PD AWS MySQL, MariaDB, PostgreSQL, Oracle and SQL Server, PD AWS DocumentDB, Neptune and ElastiCache, PD AWS S3, PD AWS Route 53 DNS and PD AWS SNS. Each one ties Blesta's events to AWS:
- Lightsail and EC2 generate package options from your live AWS catalogue in one click, and a daily check flags any plan, instance type or image that AWS has retired.
- Cancelling an EC2 service releases its Elastic IP and removes its security group, key pair, extra disks and backups. DocumentDB and Neptune remove the cluster, its firewall and its snapshots.
- S3 gives each order its own bucket and an IAM key limited to that client's buckets. It measures usage daily against the client's quota and emails at 80% and 100%. After cancellation it keeps the data for a retention window you choose, and deletes it only once you approve.
- Route 53 lets you set zone allowances per Blesta package. SNS queues texts on Blesta's cron, with quiet hours and client opt-out.
PD Cloud Cost & Margin reads your AWS bill, matches each charge to the Blesta service that should be paying for it, and lists the resources billing with no service attached. Everything installs and updates from the PD Modules panel inside Blesta, and an update that fails rolls itself back.
The PD AWS Lightsail page for Blesta is the natural first stop. Later posts in this series cover each product in depth. Questions about running AWS products from Blesta are welcome in the comments.
PD Modules is made by Projektif Digital Ltd, the team behind PD Hosting.
Top comments (0)