Sub topic 2
Turning Workload Usage into AWS Pricing Calculator Inputs
Assume you know basic EC2, S3, and RDS concepts, AWS Regions, and how to read a monthly cost breakdown. The calculator is only as useful as its usage assumptions. Start with measurable workload behavior, then map it to the calculator’s pricing dimensions.
Turn workload behavior into inputs
For each service, record the Region, resource type, quantity, runtime, and usage volume. Distinguish provisioned capacity from actual activity. An EC2 instance may run continuously, while a Lambda function may be charged mainly for requests and execution duration.
| Workload fact | Calculator input |
|---|---|
| Three instances run half the month | Instance count, instance type, and 365 hours |
| Five million API calls per month | Requests |
| Two terabytes stored | Storage capacity |
| One hundred gigabytes leave AWS | Data transfer out |
Use a consistent period, such as one month. The following calculation helps check an EC2 line item:
HOURS_PER_MONTH = 730
def monthly_compute_cost(hourly_rate, instance_count, utilization=1.0):
return hourly_rate * HOURS_PER_MONTH * utilization * instance_count
# Illustrative rate, not a current AWS price.
print(round(monthly_compute_cost(0.02, 3, 0.5), 2))Do not use utilization to reduce hours unless the instances actually stop. A running instance generally incurs compute charges even when it is idle.
Compare purchase options
On-Demand pricing charges for usage without a long-term commitment. It is flexible and useful for uncertain or changing workloads.
Savings Plans provide a discounted rate in exchange for a committed hourly spend over a term. Compute Savings Plans offer broader flexibility; EC2 Instance Savings Plans usually offer a larger discount but constrain the commitment more.
Reserved Instances apply a commitment and discount to qualifying configurations, especially stable EC2 or RDS workloads. They can be less flexible when instance families, Regions, or operating systems change.
Compare options using the same workload assumptions:
Do not forget data transfer
Include data transfer between Regions, Availability Zones, AWS services, and the public internet. Network charges often depend on direction and path. For example, traffic crossing Availability Zones can add charges even when both resources are inside AWS.
Estimate inbound traffic, outbound traffic, cross-Region traffic, and cross-AZ traffic separately. Add supporting services such as NAT Gateway, load balancers, and CloudFront when they carry the workload.
Exercise
A service runs two EC2 instances continuously and sends 200 GB to the internet each month. Which inputs should the estimate include?
Show answer
Include the Region, instance type, two instances, about 730 running hours per month, and 200 GB of internet data transfer out. Add load balancer, NAT Gateway, or other network-service usage if the architecture uses them.