Commitments and rightsizing: Savings Plans, Reserved Instances, Compute Optimizer and Trusted Advisor
Cut a steady cloud bill safely: rightsize first, then size a Savings Plans commitment from your own usage data, understand Reserved Instances, and use Compute Optimizer and Trusted Advisor findings as a governed backlog.
Assumes: .NET 10 LTS · AWS SDK for .NET v4 (AWSSDK.ComputeOptimizer 4.x) · AWS CLI v2 · CDK v2 (Amazon.CDK.Lib 2.277.0) · Terraform AWS provider v6 · Region us-east-1. Verified against official sources on 2026-11-18.
Learning objectives
By the end of this lesson you can:
- Explain how a Savings Plan works (an hourly dollar commitment), how it differs from a Reserved Instance, and which type fits which workload.
- Size a commitment from hourly usage so that it is covered almost all of the time, and calculate the saving and the downside if usage falls.
- Explain why rightsizing comes before buying commitments.
- Enable AWS Compute Optimizer for an organisation and read its EC2, Lambda and ECS-on-Fargate recommendations.
- Use Trusted Advisor and Cost Optimization Hub as inputs to a cost backlog with owners.
- Set a governance rule for who may buy commitments in a bank and what evidence is needed.
Prerequisites
- FinOps foundations for amortized versus unblended cost and budgets.
- Cost and Usage Reports for the line-item data that shows coverage and utilisation.
- Pricing models, which introduces On-Demand, Savings Plans, Reserved Instances and Spot. This lesson goes deeper on commitments and avoids repeating prices from there.
- Tools: AWS CLI v2 with
learn-sandbox(and the management account for organisation-wide settings), .NET 10 SDK.
Why this matters in banking
Banking workloads are often steady. A payments platform processes transactions every hour of every day, with a daily shape but a high floor. Steady is exactly what commitment discounts reward: you promise AWS a baseline of usage and pay a lower rate for it. A bank that runs entirely On-Demand is leaving a large saving on the table. A bank that commits badly, for example by buying a three-year plan for instances it will migrate to containers next year, wastes money in a different and more painful way, because the commitment cannot be cancelled.
There is also an order of operations. Many estates are 30 to 50 percent oversized: instances chosen at launch with a safety margin nobody revisited. Buy a commitment on top of an oversized fleet and you have locked in the waste at a discount. So: delete idle things, rightsize what remains, then commit to the new baseline. This lesson follows that order, and treats commitments as a financial decision that needs a named approver, not a button an engineer presses.
The idea in plain language
A Savings Plan is a deal: "I will spend at least X dollars per hour on eligible usage for one or three years. In return, that usage is billed at a lower rate." You pay the committed amount every hour whether you use it or not. Usage beyond it is charged On-Demand.
A Reserved Instance (RI) is an older, narrower deal: "I will run this specific kind of instance (or database) for one or three years." It is a commitment to a resource shape rather than to a dollar amount per hour.
Rightsizing is choosing the smallest resource that comfortably does the job: a smaller instance, a lower Lambda memory setting, a smaller Fargate task, a different storage tier.
Analogy: a Savings Plan is a monthly gym membership priced by how many sessions you promise to attend: cheaper per visit if you do go every week, wasted if you stop. An RI is booking a specific locker for a year. Rightsizing is checking that you needed a family suite and not a single room before signing the lease.
The four Savings Plans types
From the AWS documentation (maximum discounts are headline figures, actual savings depend on usage and rates):
| Type | What it applies to | Flexibility | Headline maximum |
|---|---|---|---|
| Compute Savings Plans | EC2 (any family, size, OS, tenancy or Region), Fargate and Lambda | Highest: you can move from c5 to m5, change Region or move from EC2 to Fargate | up to 66% |
| EC2 Instance Savings Plans | One EC2 instance family in one Region (for example m5 in Virginia), any size, OS and tenancy within it | Medium | up to 72% |
| Database Savings Plans | Aurora, RDS, DynamoDB, ElastiCache, DocumentDB, Timestream, Neptune, Keyspaces, DMS and OpenSearch Service (latest generation provisioned instances, and serverless) | High across engines and Regions | up to 35% |
| SageMaker AI Savings Plans | SageMaker AI instance usage | High across families and Regions | up to 64% |
Terms: 1 year (365 days) or 3 years (1,095 days). Payment options: All upfront, Partial upfront or No upfront. The commitment cannot be changed after purchase. You can buy more plans later as usage grows. Some charges are not discounted: for example, the Dedicated Instance per-Region fee. EKS control-plane charges are not covered, but the EC2 instances in an EKS cluster are.
Database Savings Plans are newer
Database Savings Plans were announced in late 2025 (see the pricing models lesson's reading list). Check exactly which engines and instance generations qualify before you plan around them. ⚠ VERIFY the covered list, the headline discount and Regional availability.
Reserved Instances in one table
| Aspect | Savings Plan | Reserved Instance |
|---|---|---|
| Commitment | Dollars per hour | A specific resource shape (family, size or normalised units, platform, Region or AZ) |
| Flexibility | High for Compute | Standard RIs lower, Convertible RIs can be exchanged for equal-or-greater value ⚠ VERIFY exchange rules |
| Capacity reservation | Not by itself | A zonal RI reserves capacity in an Availability Zone |
| Services | EC2, Fargate, Lambda (Compute), plus family-specific plans | EC2, RDS, ElastiCache, OpenSearch, Redshift and others |
| Resale | Cannot be resold | Standard EC2 RIs can be sold on the RI Marketplace ⚠ VERIFY current eligibility |
| Today's default advice | Prefer for compute | Still relevant for some databases and capacity reservation |
Capacity reservation is a separate concern from price. If you need guaranteed capacity in a particular zone for a critical service, use an On-Demand Capacity Reservation or a zonal RI deliberately, and treat the price discount as a bonus.
What problem the AWS service solves
| Tool | Problem it solves | Honest limits |
|---|---|---|
| Savings Plans recommendations (Cost Explorer) | Suggests a commitment from your past usage | Looks backwards (7, 30 or 60 days, ⚠ VERIFY options); it does not know about migrations, launches or planned decommissioning |
| Savings Plans utilisation and coverage reports | Utilisation: how much of your commitment was used. Coverage: how much of your eligible usage the plan covered | Reports are by plan and by time; they lag like other billing data |
| AWS Compute Optimizer | Rightsizing and idle-resource findings for EC2, Auto Scaling groups, EBS, Lambda, ECS on Fargate, RDS and Aurora, NAT gateways, DynamoDB, ElastiCache and more | Needs opt-in; needs enough metric history; default lookback is 14 days, with a paid enhanced mode up to 93 days; memory metrics for EC2 need the CloudWatch agent or an external source for best results |
| Cost Optimization Hub | One place that consolidates recommendations (rightsizing, idle, commitments) across accounts with estimated savings | It is a summary of other tools' findings. Check each before you act ⚠ VERIFY current sources and pricing |
| Trusted Advisor | Checks for cost, security, fault tolerance, performance and service limits | The full set of checks needs a Business, Enterprise On-Ramp or Enterprise support plan ⚠ VERIFY; findings are generic and need human judgement |
None of these tools makes the decision. They give you findings. A person who understands the workload decides whether a "smaller instance" is safe at month end, or whether the idle server is the DR standby.
Microsoft / Azure comparison
| You know (Microsoft/Azure) | AWS equivalent | What's different |
|---|---|---|
| Azure Reservations | Reserved Instances; Savings Plans | AWS Savings Plans are hourly-dollar commitments, similar in spirit to Azure Savings Plan for compute |
| Azure Savings Plan for compute | Compute Savings Plans | Very similar. AWS also has family-specific EC2 Instance Savings Plans and Database Savings Plans |
| Azure Hybrid Benefit | Bring your own licence, License Included | Windows Server and SQL Server licensing choices affect price; see the migration module |
| Azure Advisor (cost) | Compute Optimizer, Cost Optimization Hub, Trusted Advisor | Several tools rather than one blade; Trusted Advisor depth depends on support plan |
| Azure Spot VMs | EC2 Spot Instances | Interruption notice is 2 minutes on AWS ⚠ VERIFY; same idea: fault-tolerant work only |
| Reservation scope: shared vs single subscription | Discount sharing across linked accounts in the organisation | Sharing is on by default and can be turned off per account in billing preferences ⚠ VERIFY wording |
| VM size recommendations from Advisor | Compute Optimizer rightsizing with performance-risk scores | Each recommendation shows predicted utilisation and a risk rating |
Architecture
Security-boundary view: commitments are financial instruments. Purchase rights (savingsplans:CreateSavingsPlan, ce:* recommendation actions, EC2 RI purchase) belong to a small role in the management account. Engineers in workload accounts can read recommendations for their own account but cannot buy. An SCP can deny purchase actions for everyone but that role. Add a change record to every purchase.
Step-by-step implementation
Remove idle first
List unattached EBS volumes, stopped instances that have been stopped for weeks, idle load balancers, unused NAT gateways and old snapshots. Deleting beats discounting.
Enable Compute Optimizer for the organisation
Opt in from the management account including member accounts. Give it at least 14 days, ideally longer with enhanced metrics for your largest resources. For EC2, install the CloudWatch agent for memory metrics, or Compute Optimizer will judge on CPU and network only.
Triage recommendations as a backlog
Export recommendations, filter to findings such as over-provisioned, keep those with low performance risk and meaningful savings, and create a ticket per resource with its owner. For production, apply through the normal change process and test the smaller size first.
Measure the stable baseline
After the changes settle, take hourly eligible spend (at On-Demand-equivalent rates) for the last 30 to 60 days. Look at the low points, not the average. The minimum or a low percentile is the floor you will use every hour.
Size the commitment conservatively
Commit to a figure at or below the floor, for example the 5th to 10th percentile of hourly usage, covering part of the floor first. Many organisations aim for 70 to 80 percent coverage of eligible steady usage, rising over time. ⚠ VERIFY your firm's target coverage and utilisation policy.
Choose type, term and payment
Compute Savings Plans if you may change instance families, Region, or move toward Fargate and Lambda. EC2 Instance Savings Plans only for a settled family with a stable roadmap. One year unless there is strong confidence for three. No upfront or partial upfront according to Finance's cost of capital.
Approve, buy and monitor
Get a named approver. Buy in the management account so the discount can be shared. Create Savings Plans utilisation and coverage budgets (alert when utilisation falls under, say, 95 percent). Stagger purchases through the year to avoid a cliff of expiries.
AWS Console instructions
- Compute Optimizer: Console → AWS Compute Optimizer → Get started / Opt in (management account: choose Include all member accounts ⚠ VERIFY wording). The dashboard shows findings by resource type. Recommendations lists EC2 instances and the options per instance. Settings → Recommendation preferences sets enhanced infrastructure metrics.
- Savings Plans recommendations: Console → Billing and Cost Management → Savings Plans → Recommendations. Choose the plan type, term, payment option and lookback period, then read the recommended hourly commitment and the estimated savings. Purchase Savings Plans opens a cart; review and submit.
- Utilisation and coverage: Billing and Cost Management → Savings Plans → Utilization report / Coverage report.
- Cost Optimization Hub: Console → Billing and Cost Management → Cost Optimization Hub, enable it in the management account for all accounts. ⚠ VERIFY.
- Trusted Advisor: Console → Trusted Advisor → Cost optimization. A subset of checks is available on the basic support plan.
- Discount sharing: Billing and Cost Management → Billing preferences → Reserved Instance and Savings Plans discount sharing (management account). ⚠ VERIFY wording.
AWS CLI
# 1) Enable Compute Optimizer for the account, including member accounts (management account).
aws compute-optimizer update-enrollment-status --status Active --include-member-accounts \
--profile learn-mgmt --region us-east-1
# 2) EC2 recommendations: instance, finding, and the best option's saving.
aws compute-optimizer get-ec2-instance-recommendations \
--query 'instanceRecommendations[].{arn:instanceArn,finding:finding,current:currentInstanceType,best:recommendationOptions[0].instanceType,risk:recommendationOptions[0].performanceRisk,saving:recommendationOptions[0].savingsOpportunity.estimatedMonthlySavings.value}' \
--output table --profile learn-sandbox --region us-east-1
# 3) Lambda memory recommendations and ECS-on-Fargate recommendations.
aws compute-optimizer get-lambda-function-recommendations --profile learn-sandbox --region us-east-1
aws compute-optimizer get-ecs-service-recommendations --profile learn-sandbox --region us-east-1
# 4) Export all EC2 recommendations to S3 for a spreadsheet or Athena (bucket needs the right policy ⚠ VERIFY).
aws compute-optimizer export-ec2-instance-recommendations \
--s3-destination-config bucket=hl-finops-reports,keyPrefix=compute-optimizer/ \
--include-member-accounts --profile learn-mgmt --region us-east-1
# 5) Savings Plans recommendation (Cost Explorer API, management account).
aws ce get-savings-plans-purchase-recommendation \
--savings-plans-type COMPUTE_SP --term-in-years ONE_YEAR --payment-option NO_UPFRONT \
--lookback-period-in-days THIRTY_DAYS \
--profile learn-mgmt --region us-east-1
# 6) How well are existing plans used and how much usage do they cover? (last 30 days)
aws ce get-savings-plans-utilization \
--time-period Start=2026-10-19,End=2026-11-18 --profile learn-mgmt --region us-east-1
aws ce get-savings-plans-coverage \
--time-period Start=2026-10-19,End=2026-11-18 --granularity MONTHLY \
--profile learn-mgmt --region us-east-1
# 7) Trusted Advisor (needs a support plan that includes the API ⚠ VERIFY; the API endpoint is in us-east-1).
aws support describe-trusted-advisor-checks --language en \
--query 'checks[?category==`cost_optimizing`].[id,name]' --output table \
--profile learn-mgmt --region us-east-1
# 8) Quick idle-resource sweep: unattached EBS volumes.
aws ec2 describe-volumes --filters Name=status,Values=available \
--query 'Volumes[].[VolumeId,Size,CreateTime]' --output table \
--profile learn-sandbox --region us-east-1Option names for the recommendation calls (--lookback-period-in-days, term and payment strings) follow the Cost Explorer API. ⚠ VERIFY with aws ce get-savings-plans-purchase-recommendation help. Never buy from the CLI as a learning step: aws savingsplans create-savings-plan creates a real, non-cancellable commitment (there is a short return window for some purchases, see the documentation ⚠ VERIFY). This lesson never asks you to buy.
Infrastructure as Code
Commitments are deliberately not managed as code in this lesson: a Savings Plan cannot be deleted by cdk destroy, so putting it in a stack is a trap. What you do manage as code is the safety net: a utilisation budget that alerts when a plan is underused, and an SCP that stops anyone except the FinOps role buying commitments. L1 constructs. ⚠ VERIFY property names.
using System.Collections.Generic;
using Amazon.CDK;
using Amazon.CDK.AWS.Budgets;
using Amazon.CDK.AWS.Organizations;
using Constructs;
namespace Harbourline.Governance.Infra;
public sealed class CommitmentGuardrailsStack : Stack
{
public CommitmentGuardrailsStack(
Construct scope, string id, string workloadsOuId, string finopsRoleArn, string finopsEmail,
IStackProps? props = null) : base(scope, id, props)
{
Amazon.CDK.Tags.Of(this).Add("Project", "cea-lab");
Amazon.CDK.Tags.Of(this).Add("Lab", "m15-l11");
Amazon.CDK.Tags.Of(this).Add("Environment", "learn");
// --- SCP: only the FinOps role may buy commitments ----------------------------------------
var scp = new Dictionary<string, object>
{
["Version"] = "2012-10-17",
["Statement"] = new object[]
{
new Dictionary<string, object>
{
["Sid"] = "DenyCommitmentPurchaseExceptFinOps",
["Effect"] = "Deny",
["Action"] = new[]
{
"savingsplans:CreateSavingsPlan",
"ec2:PurchaseReservedInstancesOffering",
"rds:PurchaseReservedDBInstancesOffering",
"elasticache:PurchaseReservedCacheNodesOffering",
},
["Resource"] = "*",
["Condition"] = new Dictionary<string, object>
{
["ArnNotLike"] = new Dictionary<string, object>
{
["aws:PrincipalArn"] = new[] { finopsRoleArn },
},
},
},
},
};
new CfnPolicy(this, "CommitmentPurchaseScp", new CfnPolicyProps
{
Name = "hl-deny-commitment-purchase",
Description = "Only the FinOps role buys commitments. Test in Sandbox first.",
Type = "SERVICE_CONTROL_POLICY",
Content = scp,
TargetIds = new[] { workloadsOuId },
});
// --- Budget: alert when Savings Plans utilisation drops under 95 percent ------------------
new CfnBudget(this, "SavingsPlansUtilization", new CfnBudgetProps
{
Budget = new CfnBudget.BudgetDataProperty
{
BudgetName = "hl-savings-plans-utilization",
BudgetType = "SAVINGS_PLANS_UTILIZATION",
TimeUnit = "DAILY",
BudgetLimit = new CfnBudget.SpendProperty { Amount = 95, Unit = "PERCENTAGE" },
},
NotificationsWithSubscribers = new[]
{
new CfnBudget.NotificationWithSubscribersProperty
{
Notification = new CfnBudget.NotificationProperty
{
NotificationType = "ACTUAL",
ComparisonOperator = "LESS_THAN",
Threshold = 95,
ThresholdType = "PERCENTAGE",
},
Subscribers = new[]
{
new CfnBudget.SubscriberProperty { SubscriptionType = "EMAIL", Address = finopsEmail },
},
},
},
});
}
}Complete code
One small tool with two commands. size works on a plain CSV of hourly eligible spend and needs no AWS access, so you can learn the maths for free. rightsize lists Compute Optimizer EC2 findings where savings exist.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<!-- Look up exact 4.x versions at https://api.nuget.org/v3-flatcontainer/<id>/index.json -->
<PackageReference Include="AWSSDK.ComputeOptimizer" Version="4.*" />
</ItemGroup>
</Project>using System.Globalization;
using Amazon.ComputeOptimizer;
using Amazon.ComputeOptimizer.Model;
if (args.Length == 0)
{
Console.WriteLine("Usage:");
Console.WriteLine(" size <hourly.csv> <discountPercent> [percentile=10] (no AWS access needed)");
Console.WriteLine(" rightsize [minMonthlySavingsUsd=20] (reads Compute Optimizer)");
return 1;
}
return args[0] switch
{
"size" => Size(args),
"rightsize" => await RightSizeAsync(args),
_ => Unknown(args[0]),
};
static int Unknown(string command)
{
Console.Error.WriteLine($"Unknown command '{command}'.");
return 1;
}
// ---- size: commitment sizing from hourly on-demand-equivalent spend -------------------------
static int Size(string[] args)
{
if (args.Length < 3) { Console.Error.WriteLine("size needs <hourly.csv> <discountPercent>"); return 1; }
// One number per line (USD per hour at On-Demand-equivalent rates). Lines starting with # are ignored.
var hourly = File.ReadAllLines(args[1])
.Where(l => !string.IsNullOrWhiteSpace(l) && !l.TrimStart().StartsWith('#'))
.Select(l => decimal.Parse(l.Split(',')[^1], CultureInfo.InvariantCulture))
.OrderBy(x => x)
.ToArray();
decimal discount = decimal.Parse(args[2], CultureInfo.InvariantCulture) / 100m;
int percentile = args.Length > 3 ? int.Parse(args[3], CultureInfo.InvariantCulture) : 10;
// Baseline = the Nth percentile of hourly usage: usage is at or above this level (100-N)% of hours.
int index = Math.Clamp((int)Math.Floor(hourly.Length * percentile / 100.0), 0, hourly.Length - 1);
decimal baselineOnDemand = hourly[index];
// A Savings Plan commitment is expressed at the DISCOUNTED rate.
decimal commitmentPerHour = Math.Round(baselineOnDemand * (1 - discount), 2);
decimal onDemandTotal = hourly.Sum();
decimal withPlanTotal = 0m;
decimal unusedCommitment = 0m;
foreach (var usage in hourly)
{
decimal discountedUsage = usage * (1 - discount); // cost of this hour if fully covered
decimal covered = Math.Min(discountedUsage, commitmentPerHour);
decimal overflow = (discountedUsage - covered) / (1 - discount); // On-Demand cost of the uncovered share
withPlanTotal += commitmentPerHour + overflow; // you always pay the commitment
unusedCommitment += commitmentPerHour - covered;
}
decimal saving = onDemandTotal - withPlanTotal;
Console.WriteLine($"Hours analysed: {hourly.Length}");
Console.WriteLine($"Baseline (P{percentile}): {baselineOnDemand:N2} USD/hour on-demand equivalent");
Console.WriteLine($"Suggested commitment: {commitmentPerHour:N2} USD/hour (discounted rate)");
Console.WriteLine($"On-demand total: {onDemandTotal:N2} USD");
Console.WriteLine($"With plan total: {withPlanTotal:N2} USD");
Console.WriteLine($"Saving: {saving:N2} USD ({(onDemandTotal == 0 ? 0 : saving / onDemandTotal * 100):F1}%)");
Console.WriteLine($"Unused commitment: {unusedCommitment:N2} USD");
Console.WriteLine("Illustrative maths only: use the Cost Explorer recommendation and your own approval process before buying.");
return 0;
}
// ---- rightsize: Compute Optimizer EC2 findings with real savings ----------------------------
static async Task<int> RightSizeAsync(string[] args)
{
double minSavings = args.Length > 1 ? double.Parse(args[1], CultureInfo.InvariantCulture) : 20;
using var client = new AmazonComputeOptimizerClient();
var rows = new List<(string Name, string Current, string Best, double Risk, double Saving)>();
string? token = null;
do
{
var response = await client.GetEC2InstanceRecommendationsAsync(new GetEC2InstanceRecommendationsRequest
{
NextToken = token,
MaxResults = 100,
});
foreach (var rec in response.InstanceRecommendations ?? [])
{
var best = rec.RecommendationOptions?.OrderBy(o => o.Rank).FirstOrDefault();
double saving = best?.SavingsOpportunity?.EstimatedMonthlySavings?.Value ?? 0;
if (best is null || saving < minSavings) continue;
rows.Add((rec.InstanceName ?? rec.InstanceArn, rec.CurrentInstanceType, best.InstanceType, best.PerformanceRisk ?? 0, saving));
}
token = string.IsNullOrEmpty(response.NextToken) ? null : response.NextToken;
}
while (token is not null);
Console.WriteLine($"{"Instance",-34} {"Current",-12} {"Suggested",-12} {"Risk",5} {"Saving/mo",10}");
foreach (var r in rows.OrderByDescending(x => x.Saving))
{
Console.WriteLine($"{r.Name,-34} {r.Current,-12} {r.Best,-12} {r.Risk,5:F1} {r.Saving,10:N2}");
}
Console.WriteLine($"\n{rows.Count} recommendations, total estimated saving {rows.Sum(r => r.Saving):N2} USD per month.");
Console.WriteLine("Check performance risk and ownership before changing anything. Risk of 3 or more needs a test first.");
return 0;
}An input file to try the size command (a day of a payments platform's hourly spend, repeated to form a week is enough). Paste at least 24 numbers:
# USD per hour at on-demand-equivalent rates (fictional)
6.1
5.9
5.8
5.7
5.8
6.0
6.8
8.2
9.5
10.1
10.4
10.2
10.0
9.8
9.6
9.9
10.3
10.8
10.1
9.0
8.0
7.2
6.6
6.2Run dotnet run -- size hourly.csv 30 for a 30 percent discount. Percentile 10 is roughly 5.8 dollars an hour, so the commitment is about 4.06 dollars an hour at the discounted rate and covers the floor of the daily pattern. The saving applies to the covered baseline only, while the daytime peaks above it still pay On-Demand rates. Try percentile 50 and see how unused commitment appears at night.
Code explained line by line
- The
switchexpression dispatches the two commands.sizeis synchronous because it only reads a file, andrightsizeawaits the AWS call. sizereads one number per line, ignoring blanks and#comments, and sorts the values ascending.l.Split(',')[^1]takes the last field so the same file can holdtimestamp,valuerows from a real export.- The baseline is a percentile of hourly usage. At percentile 10, usage is at or above this value in 90 percent of hours. That is what "steady floor" means in numbers.
- The commitment is quoted at the discounted rate, because a Savings Plan is a dollar-per-hour amount of discounted usage. This detail catches people out when they compare the console recommendation with their own spreadsheet.
- For each hour,
coveredis the part of that hour's discounted usage that the commitment absorbs, andoverflowconverts the excess back to its On-Demand cost. The hour's cost is the commitment (always paid) plus the overflow. unusedCommitmentaccumulates the hours when usage was under the commitment. That waste is the risk side of the deal. If it is more than a few percent, the commitment is too high.rightsizepages through Compute Optimizer results withNextToken, takes the best-ranked option per instance, and filters out anything saving less than a threshold so the list is actionable. Properties are null-checked (?.) because v4 SDK objects can have unset members.- Output is sorted by saving and ends with a reminder: performance risk is a Compute Optimizer score, and anything with a higher score should be tested first.
Security considerations
⚠ Learning shortcut — not for production
The lab computes and reads, and never buys. In production, a purchase is a financial commitment with a named approver, a ticket, Finance sign-off and a plan for what happens at expiry. Purchase permissions are limited by SCP to one role, purchases are logged in CloudTrail, and a Savings Plans utilisation budget alerts when a plan is underused. The recommendation tool runs with read-only Compute Optimizer and Cost Explorer permissions.
- Rightsizing is a change to production. A smaller instance may be fine on average and fail at month end. Use the performance-risk score, test in a lower environment, change in a window with rollback ready, and watch latency and error alarms afterwards.
- Do not rightsize security tooling or DR standbys blindly. Low utilisation is the point of a standby. Tag these resources so recommendation reviews can exclude them.
- Recommendation data is inventory. Exports list instances, accounts and sizes. Keep them in the FinOps account with limited access.
- Delegated administrator. Compute Optimizer and Cost Optimization Hub can be administered from a delegated account so the management account does not become the working console. ⚠ VERIFY current delegation support.
- Compliance. A cost saving never overrides a control. If a recommendation conflicts with a regulatory or resilience requirement (for example an operational-resilience impact tolerance), the requirement wins and the exception is documented.
Banking use case
Harbourline's Payments platform runs on 40 EC2 instances and Fargate tasks. A 60-day review finds an hourly floor of about 5.8 dollars at On-Demand-equivalent rates and peaks above 10. Compute Optimizer flags 11 instances as over-provisioned, and the team halves the size of 7 after testing. The new floor drops to about 4.9 dollars an hour. Only then does FinOps buy a one-year, no-upfront Compute Savings Plan at 4.9 dollars times the discount factor, deliberately a little under the floor, approved by the head of platform and the finance partner. Compute Savings Plans are chosen because the roadmap includes moving the batch workload from EC2 to Fargate. A quarterly review checks utilisation (target above 95 percent) and coverage, and the team stages a second plan six months later rather than one large purchase. Total saving in the first year is close to a quarter of the compute bill, and almost half of that came from rightsizing alone.
Common mistakes
- Committing before rightsizing. You lock in oversized capacity.
- Committing to the average. Hours below the commitment waste money. Use the floor.
- Choosing a three-year term for a changing estate. Cloud roadmaps change faster than commitments.
- Choosing EC2 Instance Savings Plans and then changing family. For example, a move to Graviton instances leaves an x86 family plan uncovered. Compute Savings Plans are more forgiving.
- Ignoring Lambda and Fargate. Compute Savings Plans cover them, but a plan sized only from EC2 data misses part of the baseline.
- Trusting the recommendation without context. It cannot know about next month's decommissioning or migration.
- Buying in a member account. The discount may not be shared as expected, and ownership becomes unclear. Purchase in the management account unless there is a reason not to.
- No utilisation monitoring. A plan that quietly runs at 70 percent utilisation is a 30 percent loss on the commitment.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| Compute Optimizer shows no recommendations | Not opted in, or not enough metric data (needs about 30 hours of metrics for a first pass ⚠ VERIFY) | Opt in, wait, and check the resource type is supported |
| EC2 recommendations ignore memory | No CloudWatch agent memory metric | Install the agent or use external metric ingestion ⚠ VERIFY |
OptInRequiredException | Account not enrolled | Run update-enrollment-status --status Active |
| Member accounts missing from organisation view | --include-member-accounts not set, or delegated admin not configured | Enable organisation access from the management account |
| Savings Plans recommendation is empty | Not enough eligible usage, or the plan type does not match your usage | Try another type or lookback; check eligible services |
| Utilisation below 100 percent immediately after purchase | Usage dropped, or another plan or RI already covers the same usage | Compare the commitment with the floor; check overlapping commitments |
AccessDenied on ce:GetSavingsPlansPurchaseRecommendation | Role lacks Cost Explorer recommendation permissions or is a member account | Use a role in the management account with the right actions |
Trusted Advisor API returns SubscriptionRequiredException | Support plan does not include the API | Use the console, or upgrade only if justified ⚠ VERIFY |
Cost and cleanup
Cost: free. Compute Optimizer default recommendations are free. Enhanced infrastructure metrics are a paid add-on, which you do not need for this lesson. Savings Plans recommendations, utilisation and coverage reports are free. Trusted Advisor's basic checks are free. Cost Explorer API calls are charged per request ⚠ VERIFY. This lesson never purchases a commitment, so there is nothing to cancel. If you have a sandbox account with no resources, Compute Optimizer will simply report nothing, so use the size command with the sample file, or read the findings from a non-production account you already run.
Cleanup:
# Optional: turn Compute Optimizer off again if you only opted in for the lesson.
aws compute-optimizer update-enrollment-status --status Inactive \
--profile learn-sandbox --region us-east-1
# Remove the lab SCP and budget if you deployed them.
aws organizations detach-policy --policy-id p-abc123 --target-id ou-abcd-11111111 --profile learn-mgmt
aws organizations delete-policy --policy-id p-abc123 --profile learn-mgmt
aws budgets delete-budget --account-id 111122223333 --budget-name hl-savings-plans-utilization \
--profile learn-mgmt --region us-east-1
# Remove local files.
rm -f hourly.csvIf you did buy a Savings Plan while experimenting, stop and check the Savings Plans console now: some purchases can be returned within a short window after purchase and under strict conditions. ⚠ VERIFY the current return policy. Do not rely on it.
Exercises
- 🟢 Guided: run
sizeon the sample file at percentiles 5, 10, 25 and 50 with a 30 percent discount. Write down how the saving and the unused commitment change. - 🟡 Challenge: add a
--paymentoption that models No upfront versus All upfront by adding a discount uplift and an upfront cash amount, and report the cost of capital at 6 percent a year. - 🔴 Live problem: the CFO wants a three-year, All upfront Compute Savings Plan for 100 percent of current compute spend "to lock in the best rate". Write your reply: what you will check, what you would buy instead, and what must happen before purchase.
Assignment
Add governance/commitments/ to your portfolio repository with the tool, a one-page commitment-policy.md (who approves, coverage and utilisation targets, term rules, review cadence, rightsizing-first rule) and the SCP.
Solutions
On the sample data, a lower percentile (5) gives a lower commitment, a smaller saving and almost no unused commitment. A higher percentile (50) raises the commitment and creates unused commitment in the quiet hours. In the sample the saving actually falls (about 41.7 dollars at percentile 10 against 35.1 at percentile 50 for the day) while the unused commitment grows from cents to about 21 dollars. Somewhere between percentile 10 and 25 is usually the sweet spot for a workload with a strong daily pattern. The lesson to record: commit to the floor, not the average, and revisit as the floor rises.
Model the plan cost as: hourly commitment times hours in the term, minus an extra discount for partial or all upfront (the rates differ by plan and are published on the pricing page for the plan, ⚠ VERIFY). For upfront payments, compute the cost of capital as upfront amount times 6 percent times years outstanding. Compare the net saving of All upfront (higher discount, more capital tied up) with No upfront. Often the extra discount from paying upfront is only a few percentage points, so a firm with a high cost of capital may prefer No upfront. Present both and let Finance choose.
Knowledge check
Answer: A fixed amount of spend per hour, at the discounted rate, for one or three years, regardless of whether you use it. Usage above the commitment is billed On-Demand. It cannot be changed after purchase.
Answer: Compute Savings Plans. EC2 Instance Savings Plans are tied to an instance family in a Region, and cover EC2 only.
Answer: Because a commitment based on oversized usage locks in the waste. Reduce the baseline first, then commit to the new floor.
Answer: Treat it as a candidate for testing, not as an instruction. A high risk score means the smaller size may not meet demand. Test in a lower environment with realistic load, consider the second option, check month-end peaks, and change with rollback ready.
Answer: Usage fell below the commitment (migration, rightsizing, a Region move to an uncovered service) or the plan type does not match the usage that remains (for example an EC2 Instance plan after a family change). Overlapping commitments can also leave one underused.
Interview questions
- How do you decide how much to commit? Rightsize first, use the hourly floor over 30 to 60 days, commit at or below it, choose the flexible type unless the roadmap is stable, stagger purchases, and monitor utilisation.
- Savings Plans or Reserved Instances? Savings Plans for compute (flexibility, Fargate and Lambda), Database Savings Plans or RIs for databases depending on engine coverage, and RIs or capacity reservations when you need reserved capacity.
- What is the downside of a three-year commitment? It cannot be cancelled. A migration, architecture change or business change can leave you paying for usage that no longer exists.
- Who in a bank should be allowed to buy commitments? A small FinOps role with Finance approval and an audit trail, enforced with SCPs.
Certification practice
A company runs a steady fleet of EC2 instances today but plans to move part of the workload to AWS Fargate and AWS Lambda over the next year, and may switch instance families. It wants the largest discount that still allows those changes. Which purchase fits BEST?
A. EC2 Instance Savings Plans for the current family. B. Standard Reserved Instances for the current instances. C. Compute Savings Plans. D. Spot Instances for all workloads.
Answer: C. Compute Savings Plans apply across EC2 families, sizes and Regions and also to Fargate and Lambda. A and B are tied to a family or shape and do not cover Fargate or Lambda. D is unsuitable for steady production workloads and is not a commitment discount.
An operations team wants right-sizing suggestions for EC2 instances across all accounts in its organisation using utilisation history. Which action should they take?
A. Enable AWS Compute Optimizer from the management account and include member accounts. B. Enable VPC Flow Logs. C. Create a Config rule for instance types. D. Purchase a Savings Plan.
Answer: A. Compute Optimizer analyses utilisation metrics and produces rightsizing recommendations, with organisation-wide views. B captures network traffic. C checks configuration, not utilisation. D is a purchase decision that should follow rightsizing.
Which statement about Savings Plans is correct?
A. You can cancel a plan at any time without penalty. B. You commit to a consistent amount of usage per hour for one or three years. C. They apply only to Amazon S3. D. They are free of charge.
Answer: B. A Savings Plan is an hourly spend commitment for one or three years. A is false because plans cannot be changed or cancelled after purchase (subject to limited return conditions). C is wrong because plans cover compute and some database and machine-learning services. D is wrong because you pay the commitment.
Completion checklist
- I can explain a Savings Plan versus a Reserved Instance in two sentences
- I ran the
sizecommand at several percentiles and understand unused commitment - I know why rightsizing comes first
- I read Compute Optimizer findings (or the lesson sample) and triaged them by risk
- I wrote a commitment policy with approvers and targets
- I did not buy anything, and I ran the cleanup steps
Key takeaways
- Order: delete idle, rightsize, then commit to the floor.
- A Savings Plan is an hourly dollar commitment. It cannot be changed, so size it conservatively.
- Compute Savings Plans are the flexible default. Family-specific plans give more discount for less freedom.
- Recommendations are inputs. A named human approves changes and purchases.
- Monitor utilisation and coverage as you monitor any other control.
Further reading
Independent learning resource — not affiliated with, endorsed or sponsored by Amazon Web Services. AWS and related marks are trademarks of Amazon.com, Inc. or its affiliates. All banking data in examples is fictional. Sample architectures are for learning and are not automatically compliant with GDPR, PCI DSS or any banking regulation.
Cost and Usage Reports: billing data exports, Athena and showback
Export the most detailed AWS billing data with Data Exports (CUR 2.0), query it with Athena or DuckDB, and build a showback report that allocates direct and shared costs per cost centre.
Well-Architected Tool reviews: Security pillar, Financial Services Industry Lens and tracking improvements
Run a structured Well-Architected review of a Harbourline workload in the AWS Well-Architected Tool, apply the Financial Services Industry Lens, turn high-risk findings into an owned improvement plan, and track progress with milestones and a C# risk report.