Amazon Lightsail is the easiest part of AWS to resell. Each plan is a bundle: vCPU, memory, an SSD and a data-transfer allowance, at a predictable monthly AWS cost. That maps neatly onto a WHMCS product with a monthly price, which is why it's a good first AWS product for a hosting company.
The predictability ends at the plan, though. Stopped servers, snapshots, spare static IPs and extra disks all bill on their own, and none of them appears on the WHMCS invoice unless you put it there. Here's how to build the product, and where the money leaks.
How the pieces fit
- Your AWS account owns every Lightsail instance. AWS bills you.
- WHMCS owns the customer: the product, the invoice and the service.
- A provisioning module turns WHMCS events (create, suspend, unsuspend, upgrade, terminate) into Lightsail API calls.
The customer never needs an AWS login.
Step 1: an IAM user that can only touch Lightsail
Don't hand WHMCS your root key. Create a dedicated IAM user with a policy that allows only the Lightsail actions you need: reading plans (bundles), images (blueprints) and regions; creating, starting, stopping, rebooting and deleting instances; firewall ports; static IPs; snapshots; key pairs; and block storage disks if you'll sell extra storage. Create an access key for it with the "application running outside AWS" use case, and keep the secret safe, because AWS shows it only once.
Most Lightsail actions don't support resource-level restrictions, so the policy ends up with "Resource": "*". That makes a separate user, ideally in a separate AWS account for resold servers, more important rather than less.
In WHMCS, the natural place for that key is a server record under System Settings → Servers. WHMCS stores the password field encrypted, and a second AWS account is simply a second server.
Step 2: choose regions deliberately
Lightsail runs in a fixed list of AWS regions, and the plans aren't identical everywhere. AWS notes that plans in some regions have different specifications, and the data-transfer allowance is different in Mumbai and Sydney. Pick a default region close to most of your customers, and if you offer several regions, check every plan you sell in each of them rather than assuming they match.
Step 3: build the product
Create a product in its own product group, and set the type to Other Products/Services. A Lightsail VPS has no control panel for WHMCS's server-type products to log in to, so the generic type fits.
On Module Settings, two things matter more than they look:
- Automatically setup the product should usually be When the first payment is received. WHMCS leaves it off by default. With it off, an order completes, the service is marked Active, and nothing is ever created at AWS. There's no error anywhere.
- The defaults: platform (Linux/Unix or Windows), region, availability zone, plan and image. Lightsail prices Linux and Windows plans separately, so keep them in separate products.
If you want customers to choose their region, plan or operating system at checkout, use configurable options. Don't type the lists in by hand. AWS adds images and retires plans, and a hand-made list goes stale quietly. Build the options from the live Lightsail catalogue, then hide whatever you don't want to sell.
Extras sell well as configurable options too: extra storage, a static IP, automatic snapshots and snapshot slots. Each costs you money at AWS, so each should cost the customer something.
Step 4: upgrades are a rebuild, not a resize
Customers will ask for a bigger server. Lightsail has no in-place resize for instances. The supported path, according to AWS, is to snapshot the instance and launch a larger one from the snapshot. Snapshots can't create a smaller plan, so downgrades aren't possible this way.
That has knock-on effects for WHMCS's Upgrade/Downgrade setup:
- Only offer upgrade paths to a larger plan on the same operating system and in the same region.
- Without a static IP, the new server gets a new public address. Tell customers before they upgrade, or sell static IPs with the plan.
- An extra block storage disk can't be grown. Moving it across as it is works; promising more disk space by upgrading it doesn't.
Step 5: what the customer needs in the client area
A VPS customer needs a short list of things:
- power: start, stop and reboot;
- connection details: IP addresses, SSH user and a downloadable key (RDP details on Windows);
- a firewall they can open and close ports on;
- snapshots they can take, restore and delete;
- usage graphs, so "my server is slow" comes with numbers;
- an activity log, so you both know what happened and when.
A browser terminal is worth adding. A customer who has locked themselves out with a firewall change, or who is on a laptop without an SSH client, can still get in.
Decide per product which of these customers get; a managed VPS might keep the firewall for your team.
Where the Lightsail bill hides
Stopped isn't free. AWS bills Lightsail instances while they're running or stopped, and charges stop only when the instance is deleted. Stopping a server on suspension is the right reaction to a late payment, because the data survives. But a suspended service that's never paid is costing you every hour. Set WHMCS's termination days so that unpaid services are actually terminated.
Snapshots bill for as long as they exist. Every manual and automatic snapshot carries a storage charge per gigabyte-month. Automatic snapshots keep the latest seven and are deleted with the instance. Manual snapshots are different: AWS keeps them after the instance is deleted, so they can outlive the customer. Cap snapshot slots, and check what's left after a termination.
Static IPs cost nothing while attached. AWS charges for a static IP left unattached for more than an hour. A terminated service whose static IP isn't released keeps billing you.
Extra disks bill on their own. A block storage disk is charged separately from the plan, attached or not.
The data-transfer allowance has two sides. Every plan includes a transfer allowance, and traffic both in and out of the instance counts toward it. If it's exceeded, AWS charges for the excess outbound traffic to the internet. One busy customer can turn a profitable plan into a loss. Build a margin into the plan price, or record usage in WHMCS so you can act.
Your price list drifts. A plan's AWS price covers the instance only, not the extras above. Compare your AWS bill with what each WHMCS service pays at least monthly.
Suspension and termination
Keep the mapping simple: suspend stops the instance, unsuspend starts it, and terminate deletes it along with whatever was created for it. Run termination from WHMCS rather than the AWS console, so the service record and the AWS account never disagree. And keep an eye on the WHMCS cron: it's what suspends and terminates overdue services, so if it stops, unpaid servers keep running at your expense.
The module we built for this
PD AWS Lightsail is our WHMCS module for this job. It generates configurable options from your live Lightsail catalogue: region, plan, operating system, extra storage, static IP, automatic daily snapshots and snapshot slots. It provisions on payment. Suspension stops the server, unsuspension starts it and termination deletes it, releasing its static IP. Plan upgrades go through WHMCS's Upgrade/Downgrade as a data-preserving resize (snapshot, larger server, swap), keeping the zone, firewall rules, SSH key and static IP. Customers get power, connection details, a firewall, snapshots, usage graphs, an activity log and, if you switch it on, a browser console.
Price Analysis shows AWS's price for each plan next to a suggested price at your target margin. A daily check flags any plan or image AWS has retired from your options, and one click of Sync hides it without touching existing services. Bandwidth metering is optional per product: it records each server's transfer in and out against the plan's allowance, so WHMCS can show usage and suspend services that exceed it. It installs and updates from the PD Modules panel inside WHMCS, and an update that fails rolls itself back.
See the PD AWS Lightsail module page for requirements and screenshots.
This post is part of a series on reselling AWS from WHMCS; start with the overview.
Questions about selling Lightsail from WHMCS are welcome in the comments.
PD Modules is made by Projektif Digital Ltd, the team behind PD Hosting.
Top comments (0)