Quick answer: It depends almost entirely on how big your egress bill is. In the worked model below, a system costing $2,915 per month on AWS drops to $215 per month on Cloudflare, saving about $2,700 per month, or roughly $85,500 over three years before migration labour. But if your egress is measured in tens of gigabytes per month, the migration will never pay for itself. Pricing as of July 2026.
You cannot answer this question by comparing unit prices. You have to model the whole system monthly, add the one-off engineering cost of moving, add the period where you run both stacks in parallel, and add the cost of getting your data out of AWS.
This article builds a 36-month model from a realistic system using official Cloudflare and AWS pricing as of July 2026. Where a figure is genuinely unknowable, such as your engineering cost, we leave it as a variable and show break-even across a range instead of inventing a number.
The reference system
Assume a mid-sized Thai SaaS or content-heavy e-commerce business running on AWS with this shape:
- API on Lambda: 50 million requests per month, 250 ms wall-clock, 10 ms of actual CPU, 256 MB memory, x86, us-east-1
- Files on S3: 8 TB stored, 30 TB/month egress, 150 million GET requests, 5 million PUT requests
Other components, such as an RDS database, are deliberately left out of the model, because in most cases they will stay on AWS. We come back to that below.
Current AWS cost, per month
| Line item | Calculation | Per month |
|---|---|---|
| Lambda: requests | (50M minus 1M free) / 1M times $0.20 | $9.80 |
| Lambda: compute | 50M times 0.25 s times 0.25 GB = 3,125,000 GB-s, minus 400,000 free = 2,725,000 times $0.0000166667 | $45.42 |
| S3: storage | 8,000 GB times $0.023 | $184.00 |
| S3: GET | 150M times $0.0000004 | $60.00 |
| S3: PUT | 5M times $0.000005 | $25.00 |
| S3: egress | 9,900 GB at $0.09 plus 20,000 GB at $0.085 | $2,591.00 |
| Total | $2,915.22 |
That is $34,982.64 a year. Note where the money goes: 89 percent of the bill is S3 egress. All the compute together costs $55.22 a month. Any conversation about optimising Lambda here is a rounding error.
Cloudflare cost, per month
| Line item | Calculation | Per month |
|---|---|---|
| Workers: subscription | Workers Paid | $5.00 |
| Workers: requests | (50M minus 10M included) / 1M times $0.30 | $12.00 |
| Workers: CPU | (50M times 10 ms minus 30M included) = 470M CPU-ms / 1M times $0.02 | $9.40 |
| R2: storage | (8,000 minus 10 free) times $0.015 | $119.85 |
| R2: Class B | (150M minus 10M free) times $0.36/M | $50.40 |
| R2: Class A | (5M minus 1M free) times $4.50/M | $18.00 |
| R2: egress | Not charged | $0.00 |
| Total | $214.65 |
That is $2,575.80 a year. The monthly difference is $2,915.22 minus $214.65, which is $2,700.57. That single figure drives the entire model.
The three-year model
Assume months 1 to 4 are build and dual-run: you keep paying AWS in full while Cloudflare costs perhaps $50 a month in development and partial traffic. Full cutover happens in month 5.
| Line item | Calculation | 3-year total |
|---|---|---|
| Stay on AWS, do nothing | $2,915.22 times 36 months | $104,948 |
| Migrate to Cloudflare | ||
| Months 1 to 4 (build plus dual-run) | ($2,915.22 plus $50) times 4 | $11,861 |
| Months 5 to 36 (after cutover) | $214.65 times 32 | $6,869 |
| One-off egress of 8 TB out of S3 | (8,000 minus 100 free) times $0.09 | $711 |
| Migration engineering | Variable X | X |
| Total migration path | $19,441 plus X | |
| Net 3-year saving | $85,507 minus X | |
A detail worth knowing: AWS states on its pricing pages that it offers eligible customers free data transfer out to the internet when they move all of their data off AWS, or all of their data off a particular AWS service. So that $711 line could legitimately be $0 if AWS approves it. Contact AWS Support before you start moving anything.
Break-even depends on your migration cost
After cutover you save $2,700.57 a month. The amount you need to recover is X, plus the $711 of egress, plus roughly $200 of extra dual-run spend.
| Migration engineering (X) | Payback after cutover | Break-even month | Net 3-year saving |
|---|---|---|---|
| $10,000 | 4.0 months | Around month 9 | $75,507 |
| $30,000 | 11.4 months | Around month 16 | $55,507 |
| $60,000 | 22.6 months | Around month 27 | $25,507 |
Even at $60,000 of engineering, the project is still in the black within the third year. That is entirely a function of the egress line disappearing from the bill.
The case where migrating does not pay
Now change the system to an internal B2B application: 5 million requests per month, 500 GB of files stored, 200 GB of egress per month.
On AWS: Lambda costs $0.80 (the compute sits entirely inside the free tier). S3 costs $25.00 (storage $11.50, GET $2.00, PUT $2.50, and egress of 100 billable GB at $0.09 = $9.00). Total: $25.80 per month.
On Cloudflare: Workers costs $5.40 and R2 costs $7.35. Total: $12.75 per month. The saving is $13.05 a month, or about $470 across three years.
No migration project costs less than $470. If your system looks like this, migrating has to be justified on something other than cost, such as latency, developer experience, or getting off a stack nobody on your team enjoys operating.
When AWS is the right answer
When your egress is small. The entire model above is driven by egress. Below roughly 1 TB a month, the numbers collapse and migrating is a waste of money.
When you run RDS, Aurora, or any large relational database. Cloudflare D1 is capped at 10 GB per database and that limit cannot be raised. D1 is designed for many small databases, such as one per tenant, not for a single large one. If your data lives in RDS, it is probably staying in RDS, which means you will have cross-cloud traffic to manage.
When you have data residency requirements. AWS made the Asia Pacific (Thailand) Region, ap-southeast-7, generally available on 7 January 2025 with three Availability Zones. If regulation or a customer contract requires the data to stay physically in Thailand, that ends the cost discussion.
When you have a committed spend agreement with AWS. Discounts on remaining committed spend change the numbers you see in this article, and dropping usage may cost you a discount tier.
When your team knows AWS well. The cost of retraining, rewriting infrastructure-as-code, and throwing away runbooks is real. It does not appear on any spreadsheet, but you will pay it.
Hidden costs to check before you model anything
The model above only counts Lambda and S3. A real AWS bill usually also contains NAT Gateway, CloudWatch Logs, inter-AZ data transfer, and Application Load Balancer charges. All of these depend on your usage, so pull them from your actual invoice rather than estimating.
Most of these disappear or shrink on Cloudflare, which usually means the real saving is larger than the model here shows. But we will not put a number on something we cannot verify.
If you are working out which workloads should move and which should stay put, we set out the criteria in when you should not use Cloudflare Workers.
In summary
Whether migrating to Cloudflare is worth it comes down to one variable: your monthly egress charge. Open your most recent AWS invoice, find the Data Transfer line, and you will have most of the answer before you read another word.
Cipher designs and builds systems on the Cloudflare Developer Platform for businesses in Thailand, and can put a cost model together for your specific stack before you commit to anything.
Frequently Asked Questions
How long does an AWS to Cloudflare migration take to pay back
It depends on your migration engineering cost. In the model in this article, which saves $2,700 per month, an engineering cost of $10,000 pays back in about 4 months after cutover, while $60,000 takes around 23 months. Your real figure depends mostly on how large your egress volume is.
Do I have to pay egress to get my data out of AWS
Normally yes; 8 TB of data would cost roughly $711 as a one-off. However AWS states on its pricing pages that it offers eligible customers free data transfer out to the internet when they move all of their data off AWS, or all of their data off a particular AWS service. Contact AWS Support before you start the migration.
Can we move our RDS database to D1
Probably not. Cloudflare D1 is capped at 10 GB per database and the limit cannot be raised. It is designed for many small databases, such as one per tenant, rather than for a single large relational database. In many cases the right answer is to leave the database on AWS.
What if our egress is very low, should we still migrate
Usually not. An internal B2B system with 200 GB of egress per month saves only around $13 a month, or roughly $470 over three years, which will not cover any migration effort. Migrate only if there is a benefit other than cost that justifies it.
What hidden AWS costs do people forget
Beyond Lambda and S3, a real AWS bill usually also includes NAT Gateway, CloudWatch Logs, inter-Availability-Zone data transfer, and Application Load Balancer charges. These all depend on usage, so pull the real figures from your own invoice rather than estimating them.

