SQL Server licensing on AWS
-
Phase 0: Before you start
-
Phase 1: The foundation
-
Phase 2: Operations and security
-
Phase 3: SQL Server on AWS
-
Phase 4: Troubleshooting step by step
-
Phase 5: Final project and career
On most SQL Server workloads the licence costs more than the server it runs on. Getting SQL Server licensing on AWS right (License Included or bring your own, which edition, how many vCPUs) can cut a database bill in half without anyone changing a line of code.
You’ll price the same server with no SQL Server and then with Web, Standard and Enterprise, so you can see the licence part on its own. You’ll also find the right Windows+SQL images and check how Optimize CPU lowers the number of vCPUs you pay licences for on RDS and EC2, and then fix an image lookup that fails silently and a server that’s over-licensed.
| Time | You need | By the end you can |
|---|---|---|
| 40 minutes | You need Lesson 40 done, saat-vpc and your laptop signed in as saat-admin. It costs nothing, since we only use price lookups, describe calls and a dry run. Treat this lesson as general guidance and not licensing advice, and check your own agreements with Microsoft or a licensing specialist. | Explain License Included, BYOL with License Mobility, BYOM on RDS and Dedicated Hosts, and work out the licence share of an hourly price. Find Windows+SQL AMIs and use Optimize CPU to reduce the vCPUs you license. |
What it is, in one line
SQL Server licensing on AWS means choosing whether AWS includes the SQL Server licence in the hourly price or you bring licences you already own, and sizing vCPUs so you don’t pay for cores you don’t need.
In Simple Words
Renting a car with or without a driver
You can rent a car with a driver included, paying one price per hour with no paperwork. Or, if you already employ a driver, you rent only the car and bring your own driver along, which is License Included versus bring your own licence.
Now imagine the driver is paid per seat in the car, even the empty ones, so taking a seven-seater for two people wastes money. SQL Server is licensed per core, so a server with more vCPUs than the database needs ends up paying for empty seats.
Optimize CPU is like folding down the extra seats, where you keep the same boot space (memory) but have fewer seats to pay for.
Engineer's View
How SQL Server licensing works on AWS
License Included (LI): on RDS (all editions) and on EC2 Windows+SQL AMIs (Web, Standard, Enterprise), AWS charges for SQL Server per vCPU-hour as part of the price, and you don’t need a Microsoft agreement. Express and Developer editions carry no licence charge at all.
Bring your own licence: SQL Server licences with active Software Assurance can move to EC2 shared tenancy through License Mobility. On RDS, BYOM (bring your own media, license model bring-your-own-media) runs Standard and Enterprise 2019 to 2025 without the AWS SQL fee, using your own installation ISO, though you should check which Regions offer it. Windows Server licences, and SQL licences without mobility, need Dedicated Hosts and come with date and agreement conditions.
AWS License Manager keeps track of usage.
Since licensing follows vCPUs, Optimize CPU matters a lot. On EC2 you set CoreCount and ThreadsPerCore (and since October 2025, license-included instances are billed on the vCPUs you configure), and on RDS for SQL Server classes such as m7i, r7i, m8i and r8i support coreCount and threadsPerCore. Keep in mind that Standard edition uses at most 24 cores and 128 GB of memory on SQL Server 2019 and 2022, and SQL Server 2025 raises that to 32 cores and 256 GB.
How it works, step by step
You have four main ways to license:
1Start with License Included
For most new workloads this is the default. There’s nothing to track, and the hour you stop the server you stop paying.
2Bring licences you already own
If you have Software Assurance and spare licences, BYOL on EC2 or BYOM on RDS takes away the SQL charge, but you have to keep compliance records.
3Then right-size the vCPUs
Whichever model you pick, it’s the cores that drive the bill:
A memory-optimized class with half its cores switched off often runs a database just as fast, because plenty of databases are held back by memory and I/O and not CPU. Measure first (Lesson 51) and then trim.
✅ Checkpoint: You can explain License Included, License Mobility, BYOM and Dedicated Hosts, and why the vCPU count drives SQL Server licence cost.
Hands-on lab: price and size SQL Server licensing on AWS
Before you run any command, double-check it
Read every command twice before you press Enter. Check the target: the system or account, the IDs, the names and the sizes. These commands are for learning and were tested in our lab, not on your system. At work, run the read-only list commands first, follow your change process, make sure a backup exists, and ask a second person to check anything that changes or deletes data. You run them at your own risk.
Sign in and load the price helper from Lesson 40:
cd C:\aws-lab
aws login --profile saat-admin
$env:AWS_PROFILE = 'saat-admin'
$v = Get-Content C:\aws-lab\saat-vpc.json | ConvertFrom-Json
function Get-OnDemandPrice([string]$Service, [string[]]$Filters) {
$f = $Filters | ForEach-Object { $k, $val = $_ -split '=', 2; "Type=TERM_MATCH,Field=$k,Value=$val" }
$list = aws pricing get-products --region us-east-1 --service-code $Service --filters $f --max-items 1 --query PriceList --output json | ConvertFrom-Json
if (-not $list) { return $null }
$p = $list[0] | ConvertFrom-Json
$od = @($p.terms.OnDemand.PSObject.Properties.Value)[0]
[double](@($od.priceDimensions.PSObject.Properties.Value)[0].pricePerUnit.USD)
}1Find the licence share of an EC2 price
Paste this whole block. It prices one size with each SQL edition:
$common = @('regionCode=ap-south-1', 'instanceType=r6i.xlarge', 'operatingSystem=Windows', 'tenancy=Shared', 'capacitystatus=Used', 'licenseModel=No License required')
$base = Get-OnDemandPrice AmazonEC2 ($common + 'preInstalledSw=NA')
$prices = foreach ($sw in 'NA', 'SQL Web', 'SQL Std', 'SQL Ent') {
$p = Get-OnDemandPrice AmazonEC2 ($common + "preInstalledSw=$sw")
$label = if ($sw -eq 'NA') { 'Windows only' } else { "Windows + $sw" }
[pscustomobject]@{ Option = "EC2 r6i.xlarge $label"; USDPerHour = [math]::Round($p, 3); SqlLicencePerHour = [math]::Round($p - $base, 3) }
}
$prices | Format-Table -AutoSizeYou should see something like this (prices change over time):
Option USDPerHour SqlLicencePerHour
------ ---------- -----------------
EC2 r6i.xlarge Windows only 0.436 0
EC2 r6i.xlarge Windows + SQL Web 0.528 0.092
EC2 r6i.xlarge Windows + SQL Std 0.916 0.48
EC2 r6i.xlarge Windows + SQL Ent 1.936 1.5On 4 vCPUs, Standard roughly doubles the Windows price and Enterprise more than quadruples it. The licence part grows with each vCPU, so a server twice the size doubles that column as well, and if you run the same comparison for RDS you’ll see similar gaps between editions.
2Find the right Windows+SQL images
Paste this whole block. AWS publishes the license-included images as public parameters:
aws ssm get-parameters-by-path --path /aws/service/ami-windows-latest --query "Parameters[?contains(Name, 'Server-2022-English-Full-SQL_2022')].Name" --output textYou should see something like this:
/aws/service/ami-windows-latest/Windows_Server-2022-English-Full-SQL_2022_Enterprise
/aws/service/ami-windows-latest/Windows_Server-2022-English-Full-SQL_2022_Express
/aws/service/ami-windows-latest/Windows_Server-2022-English-Full-SQL_2022_Standard
/aws/service/ami-windows-latest/Windows_Server-2022-English-Full-SQL_2022_WebLaunching from one of these images is what makes an EC2 instance license-included for SQL Server, because the billing follows the image. For BYOL you’d start from a plain Windows image and install your own media.
3Check Optimize CPU options on RDS and EC2
Paste this whole block:
$v22 = aws rds describe-db-engine-versions --engine sqlserver-se --query "DBEngineVersions[?starts_with(EngineVersion, '16.00')] | [-1].EngineVersion" --output text
aws rds describe-orderable-db-instance-options --engine sqlserver-se --engine-version $v22 --db-instance-class db.r7i.4xlarge --query "OrderableDBInstanceOptions[0].AvailableProcessorFeatures[?Name=='coreCount'].AllowedValues" --output text
aws ec2 describe-instance-types --instance-types r7i.4xlarge --query "InstanceTypes[0].[VCpuInfo.DefaultVCpus,MemoryInfo.SizeInMiB,join(',', to_array(VCpuInfo.ValidCores[].to_string(@)))]" --output textYou should see something like this:
1,2,3,4,5,6,7,8
16 131072 1,2,3,4,5,6,7,8RDS and EC2 both let an r7i.4xlarge run with fewer cores and still keep its full 128 GiB of memory, so with 2 cores and 2 threads per core you license 4 vCPUs instead of 16.

4Write down the decision
For each database, note down the edition it really needs (are any Enterprise features in use?), the licence model, how many vCPUs it actually needs and whether Optimize CPU applies. Here’s a quick check for Enterprise-only features that you can run on a source server, saved for later:
@'
-- Edition-features.sql: Enterprise-only features each database uses
SELECT feature_name, feature_id FROM sys.dm_db_persisted_sku_features;
'@ | Set-Content C:\aws-lab\Edition-features.sql
Get-Content C:\aws-lab\Edition-features.sql | Select-Object -Last 1You should see this:
SELECT feature_name, feature_id FROM sys.dm_db_persisted_sku_features;Run it in each database (for example with sqlcmd -d DBNAME). If it returns no rows, nothing in that database ties it to Enterprise and Standard may well be enough.

✅ Checkpoint: You worked out the SQL licence share for each edition, found the license-included image names, saw the allowed core counts for Optimize CPU and saved Edition-features.sql.
Break It, Then Fix It
Here’s a lookup that fails without telling you, and a licence bill four times bigger than it needs to be.
1Break it: guess an image parameter name
Ask for the Standard image using a shortened name:
aws ssm get-parameters --names /aws/service/ami-windows-latest/Windows_Server-2022-English-Full-SQL_2022_Std --output jsonYou should see this:
{
"Parameters": [],
"InvalidParameters": [
"/aws/service/ami-windows-latest/Windows_Server-2022-English-Full-SQL_2022_Std"
]
}get-parameters doesn’t fail. It returns nothing and lists the name as invalid, and a script that then launches with an empty image ID breaks later with a confusing error, or worse, falls back to some old hard-coded image. Fix: get exact names with get-parameters-by-path (step 2) and make scripts stop whenever InvalidParameters isn’t empty:
$ami = aws ssm get-parameter --name /aws/service/ami-windows-latest/Windows_Server-2022-English-Full-SQL_2022_Standard --query Parameter.Value --output text
$amiYou should see something like this:
ami-0a1b2c3d4e5f601112Break it: license 16 vCPUs for a 4-vCPU workload
Say a memory-hungry database needs 128 GiB but only 4 vCPUs of CPU. Compare the full r7i.4xlarge price with Optimize CPU, using a dry run that creates nothing:
$full = Get-OnDemandPrice AmazonEC2 @('regionCode=ap-south-1', 'instanceType=r7i.4xlarge', 'operatingSystem=Windows', 'preInstalledSw=SQL Ent', 'tenancy=Shared', 'capacitystatus=Used', 'licenseModel=No License required')
"r7i.4xlarge Windows + SQL Ent, 16 vCPUs: {0:N2} USD/h, about {1:N0} USD/month" -f $full, ($full * 730)
aws ec2 run-instances --image-id $ami --instance-type r7i.4xlarge --subnet-id $v.PrivateA --security-group-ids $v.AppSg --cpu-options CoreCount=2,ThreadsPerCore=2 --dry-run 2>&1 | Select-Object -Last 1You should see something like this:
r7i.4xlarge Windows + SQL Ent, 16 vCPUs: 7.84 USD/h, about 5,723 USD/month
An error occurred (DryRunOperation) when calling the RunInstances operation: Request would have succeeded, but DryRun flag is set.
“DryRunOperation” means the request is valid and nothing was launched. Running that server with 4 vCPUs licensed rather than 16 cuts the SQL Enterprise part of the bill to a quarter and keeps all the memory. Fix: measure what CPU you need, then use Optimize CPU on RDS (--processor-features) or EC2 (--cpu-options), and question Enterprise if Edition-features.sql finds nothing.
Nothing was created in this lesson. Keep Edition-features.sql and Check-RdsReadiness.sql together for when you plan migrations.
✅ Checkpoint: You caught a silent InvalidParameters lookup and checked an Optimize CPU launch with a dry run that cuts licensed vCPUs from 16 to 4.
This happened at work
The audit after the lift-and-shift
A manufacturing company moved 14 SQL Server VMs to EC2 by copying their sizes across. The on-premises hosts had 16 cores, so every EC2 instance got 16 vCPUs on license-included SQL Enterprise images, and nobody checked which edition features the databases were using.
Six months on, finance wanted to know why the AWS bill was double what the business case said. Database Insights showed most servers averaging under 15 percent CPU, and when someone finally ran the edition check, only two databases used Enterprise-only features.
The team moved 12 servers to Standard, used Optimize CPU to cut vCPUs on the memory-heavy ones and shifted a few small databases to RDS. The SQL licence part of the bill dropped by about 60 percent and nobody complained about performance.
Common mistakes and troubleshooting
| Mistake | What happens | What to do |
|---|---|---|
| Copying on-premises core counts | Paying licences for idle cores | Measure CPU, then size; use Optimize CPU |
| Defaulting to Enterprise | Several times the Standard licence cost | Check sys.dm_db_persisted_sku_features first |
| BYOL without Software Assurance | Non-compliant licensing | Check License Mobility rights before moving |
| Guessing image parameter names | Empty lookups, wrong or no AMI | List names with get-parameters-by-path |
| Express for anything growing | 10 GB per database limit | Start with Standard if growth is expected |
| Forgetting Standard’s limits | Extra cores or memory unused | Standard uses up to 24 cores and 128 GB (32 cores and 256 GB on SQL Server 2025) |
Interview questions
Click a question to open it. Each one is phrased the way an interviewer would ask it, and underneath you’ll find why they ask it and one way you could answer in your own words.
Fresher level
1. Can you explain in simple words what License Included means for SQL Server on AWS?
Why they ask this: They want to know you understand the simplest licensing option, because licensing is a big slice of SQL Server cost and admins need the basics.
How you might answer: It means the SQL Server licence is built into the hourly price, on RDS or on EC2 Windows plus SQL images, and you don’t need any agreement with Microsoft.
When you stop the server, you stop paying for the licence as well.
2. Your company already owns SQL Server licences. Can you use them on EC2?
Why they ask this: They’re checking you know the rules for bringing your own licences, since getting it wrong can lead to an expensive audit finding.
How you might answer: Yes, in two main ways, always within Microsoft’s terms. If we have active Software Assurance, we can use License Mobility on shared tenancy.
For licences that don’t have mobility rights, we’d need Dedicated Hosts.
3. Which SQL Server editions don’t have a licence fee, and where can you use them?
Why they ask this: They want to see you know how to save money on non-production systems, because running a paid edition for dev and test is a common waste.
How you might answer: Express and Developer have no licence fee. Developer edition is only allowed for non-production, so it suits dev and test servers, but never production.
2–5 years experience
4. The team wants to double the vCPUs on a SQL Server instance. What would you tell them about the cost?
Why they ask this: They want to know you understand what drives SQL Server cost on AWS, since many people look at the instance price and miss the licence part.
How you might answer: SQL Server is licensed per core, so AWS charges the licence per vCPU and doubling the vCPUs doubles that part of the bill. Before agreeing I’d check whether they need more CPU or only more memory.
If it’s memory they need, Optimize CPU lets me cut the vCPU count and still keep the memory of a bigger instance.
5. How would you decide whether a database needs Enterprise edition or can run on Standard?
Why they ask this: They want to see you check the facts before paying for Enterprise, because the price gap between the two editions is large.
How you might answer: I’d start by checking which Enterprise-only features the database uses, with sys.dm_db_persisted_sku_features. Then I’d look at Standard’s hardware limits (24 cores and 128 GB on 2019 and 2022, 32 cores and 256 GB on 2025) and at the high availability needs.
From what I’ve seen, a lot of workloads fit Standard fine once you check.
6. What is BYOM on RDS for SQL Server, and when would you use it?
Why they ask this: They’re checking you know how to use your own licences on a managed service, which shows you know RDS options beyond the default.
How you might answer: BYOM stands for Bring Your Own Media. It lets us run Standard or Enterprise on RDS with our own licences through License Mobility, by uploading our installation media.
AWS then drops the SQL licence fee, so I’d use it when we already own licences with Software Assurance.
Senior level
7. Your company spends USD 80,000 a month on SQL Server licences on AWS. How would you bring that down?
Why they ask this: They want a structured cost plan backed by data, and whether you can find savings without breaking anything.
How you might answer: I’d begin with an inventory of editions and the features each database really uses, and move off Enterprise where it’s safe. Then I’d right-size vCPUs with Optimize CPU and Database Insights data, and consolidate the small databases.
Where we own licences with Software Assurance I’d look at BYOL or BYOM, and I’d move dev and test to Developer edition and stop non-production servers at night.
8. If your company brings its own SQL Server licences to AWS, how would you make sure you stay compliant?
Why they ask this: They want governance thinking, because licence audits can be expensive and they want to know you can prove what you’re running.
How you might answer: I’d use AWS License Manager with license configurations and rules attached to the AMIs or launch templates, so usage gets counted automatically, and manage any Dedicated Hosts we need through it as well.
I’d also tag servers by licence pool and run regular reports, so we always know where we stand.
Quick quiz
Q1. Why does vCPU count matter for SQL Server cost?
- It doesn’t
- SQL Server is licensed per core, charged per vCPU on AWS
- Only for Express
- Only on RDS
Show answer
B — More vCPUs means more licence charges.
Q2. Which edition has no licence fee and suits labs?
- Standard
- Enterprise
- Express
- Web
Show answer
C — Express (and Developer for non-production).
Q3. What did get-parameters return for the wrong name?
- An error
- An empty list plus InvalidParameters
- The latest AMI
- A default image
Show answer
B — Check InvalidParameters in scripts.
Q4. What does a DryRunOperation error mean?
- The request failed
- The request would have succeeded; nothing was created
- Missing permissions
- Wrong Region
Show answer
B — Dry runs validate without launching.
Q5. What does Optimize CPU keep while cutting vCPUs?
- Licences
- Memory, network and storage performance
- Nothing
- Only disk
Show answer
B — You keep memory and reduce licensed cores.
Quick recap
- License Included puts the SQL licence in the hourly price on RDS and EC2.
- BYOL needs Software Assurance (License Mobility) or Dedicated Hosts; RDS offers BYOM.
- SQL Server cost follows vCPUs; Optimize CPU cuts vCPUs and keeps memory.
- Check Enterprise-only features before paying for Enterprise.
- Find image names with get-parameters-by-path and validate launches with
--dry-run.
Next lesson
Lesson 42: Create RDS for SQL Server → You’ll build saat-sql on RDS, connect to it from your laptop through a secure tunnel, and set up parameter and option groups.
Further reading: SQL Server licensing on AWS
Want to go deeper into SQL Server licensing on AWS? Read Licensing Microsoft SQL Server on Amazon RDS and Optimize CPUs for RDS for SQL Server instances. You can also see the full plan for this course on the AWS Cloud Administration course page.
