Serverless pricing: SAA-C03 study notes and practice questions
What to know about Serverless pricing for the SAA-C03 exam, from the Design Cost-Optimized Architectures domain (20% of the exam guide), then 1 free question to test it. Part of the SAA-C03 study guide.
Serverless cost questions describe a workload’s traffic: mostly idle, bursty, or steady and heavy. Pay-per-use wins the first two; always-on capacity with a commitment often wins the third.
How each service bills
Service
You pay for
AWS Lambda
Requests plus duration × memory (GB-seconds); Arm (Graviton) functions cost less per GB-second. Provisioned concurrency adds a charge while it’s on
API Gateway
Requests (HTTP APIs cost less than REST APIs) plus data transfer; caching costs per hour
DynamoDB on-demand
Read and write request units used, plus storage
AWS Fargate
vCPU and memory per second while tasks run
Step Functions
State transitions (Standard) or requests and duration (Express)
S3, SQS, SNS, EventBridge
Storage and requests; no idle cost
Aurora Serverless v2
Aurora capacity units per second; can scale down to zero ACUs when idle
Key facts
No traffic, no compute bill. For an API that gets a few thousand requests a day, Lambda and API Gateway cost a tiny fraction of even one small always-on instance.
HTTP APIs are the cheaper, simpler API Gateway option when you don’t need REST API features such as usage plans, request validation or caching.
Lambda cost tuning: more memory means more CPU, so a function can run faster and cheaper. Arm architecture lowers price per GB-second. Compute Savings Plans cover Lambda.
At steady high volume, the per-request price can overtake provisioned capacity: a container fleet on Savings Plans, or DynamoDB provisioned capacity with auto scaling, can be cheaper.
How to choose
“Internal tool used a few hundred times a day”: API Gateway + Lambda (+ DynamoDB on-demand).
“Nightly job of 2 hours”: Fargate or Batch, not Lambda (15-minute limit).
“Database used only in office hours, idle otherwise”: Aurora Serverless v2, or stop instances when idle.
“Constant, predictable high request rate”: compare with provisioned capacity plus a commitment.
Common traps
Always-on EC2 for an API that is idle most of the day.
Assuming serverless is always cheapest. At sustained high throughput it often isn’t.
REST API features nobody asked for. HTTP APIs cost less.
A finance department uses an internal REST API that handles about 3,000 requests a day, almost all during office hours, and each request finishes in under 300 ms.
A few staff also use it in the evenings, so it must answer at any time of day. The API runs on two always-on Amazon EC2 instances behind an Application Load Balancer.
Which change will reduce cost the MOST while keeping the API available at all times?
Choose one answer.
AA. Rebuild the API on Amazon API Gateway HTTP APIs, with an AWS Lambda function behind each of its endpoints.
BB. Buy 3-year Reserved Instances for both EC2 instances, and keep the Application Load Balancer in front of them as it is.
CC. Add scheduled Auto Scaling actions that scale the instances in to zero after office hours and back out to two each morning.
DD. Move the API to an Amazon ECS service that runs one AWS Fargate task, behind the existing Application Load Balancer.
Show the answer and explanation
Answer: A
A. Right: Correct. API Gateway charges per request and Lambda charges per request and per unit of compute time, with no minimum fees. For 3,000 short requests a day the bill is a tiny fraction of two servers and a load balancer, and the API still answers at any hour. Learn more: Amazon API Gateway pricing (opens in a new tab)
B. Wrong: Reserved Instances lower the hourly rate of the instances, but the company still pays for two servers and a load balancer around the clock. The load balancer is billed for every hour it runs, and most of those hours carry almost no traffic. Learn more: Amazon EC2 billing and purchasing options (opens in a new tab)
C. Wrong: Scheduled scaling would remove most instance hours, but with no instances in the evening the staff who use the API then would get errors. The load balancer would also still be billed for every hour. This breaks the always-available requirement. Learn more: Scheduled scaling for Amazon EC2 Auto Scaling (opens in a new tab)
D. Wrong: One Fargate task costs less than two instances, but it still runs and is billed all day and night, and the load balancer's hourly charge remains. A single task also leaves no spare capacity if it fails. A request-priced service removes the idle cost entirely. Learn more: AWS Fargate for Amazon ECS (opens in a new tab)
Explanation
At about 3,000 short requests a day, the API is idle almost all the time, so the biggest saving comes from not paying for idle capacity at all. API Gateway and Lambda are billed per request and per unit of compute used, with no minimum fees, and they still answer in the evening. Every other option keeps a load balancer and at least one server or task billed around the clock, or loses evening availability.
Want more on Serverless pricing? The 5 full-length practice sets have 7 more Serverless pricing questions, 325 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets →