How to bill by each client

So, I have build a solution on AWS. Hosted on EC2. Storing data via DynamoDB + RDS. Some processing with lamda functions. And AWS API GW in front. Now my customers can use the solution via web interface or directly calling APIs.

The solution is used by self-serve developers, so can range between 100-1000 coming each month. They register an account which is free, and have to only pay by the usage (amount of data stored, and time of lamda functions to process). What is the best way for me to have the AWS bill that I get, to split it to each customer based on their monthly usage? Assuming maybe +10% margin on top. Is there a good product, framework, tool to do this? Or do I have to label each customer and go into each logs, tables, function invocation etc. and process the monthly usage per label? Hopefully something easier exists?

Tag your resources by user, Use the cost manager, split costs by tag and generate your billing with it

Have a look at API keys and usage plans

Not sure if this works for you

https://aws.amazon.com/about-aws/whats-new/2021/05/aws-application-cost-profiler/

If I understand correctly, all users share the same resources. They draw from them with usage that varies user to user. I don’t believe anything AWS offers will work to divide your bill. Since they are not AWS accounts, and the share resources ( my interpretation ), I think the only way to track this is by building some sort of mechanism that tracks when a specific user uses a resource and how much, etc. basically everything you want to bill.

If I’m wrong, and each user gets their own resource, I’m not sure how that would scale. But if that’s it, tags will work.

How will op leverage organizations in this case if the resources are shared?

Perhaps that can be changed? Architecturally speaking, would want to share as little as possible IMO (ie: one lambda/rds per user?).

why are you only charging what aws charged you? You should be charging your customers what its value is to them not what it costs to run. IMO come up with your own billing system. Charge per invocation or charge a subscription.

You should be billing based on value not your costs. If your value is lower than your costs then you don’t have a business but a hobby project. You need to figure out what each API call or some unit is worth and then bill based off that using your own billing system

Isn’t this a good use case for aws organization, though? Each client has its own account, but resources are shared.

Billing is broken up per client, but as whole economies of scale are still achieved.

Edit: if concern is about how to tie a customer of their product to account in aws, I believe account creation and provisioning can be automated.

It depends if this is multi-tenant or single tenant.

In a single tenant deployment you would just separate clients by AWS account.
For a multi-tenant solution you would use Cognito with API keys and Usage Plans. Monitor usage and bill based on that.