Sub topic 4
Configuring a service: Region, size, and options
This chapter assumes you know core AWS services such as EC2, S3, and RDS. It also assumes you understand Regions and can read a monthly cost breakdown. By the end, you should be able to fill in a service configuration so that each choice maps to a pricing dimension.
What a configuration is
In the AWS Pricing Calculator, you add a service to an estimate and then fill in a configuration form. The form asks for three kinds of input:
- Region: where the resources run.
- Size and type: how big or what kind of resource you need.
- Options: settings such as operating system, tenancy, storage type, and purchase option.
Each field changes the price the calculator looks up. A wrong value in any of them changes the total, and the calculator will not warn you.
Region
Prices differ between Regions, so pick the Region first. The same instance type can cost noticeably more in one Region than in another. Choose the Region where you plan to deploy, not the one nearest to you by habit.
Region also affects other things you may need to account for. Some services or instance types are not offered everywhere. Data transfer between Regions is billed separately, and a later chapter covers it.
Size and type
Size is the main driver for compute and database services. For Amazon EC2 you choose an instance type, such as t3.micro, and the number of instances. For Amazon RDS you choose a database instance class. For Amazon S3 there is no instance. You choose storage classes and amounts instead.
Pick the size from what you know about the workload. If you do not know yet, choose a reasonable starting size, write down that it is a guess, and revisit it after testing.
Options that change the rate
Options often change the price more than people expect. Common ones for EC2 are in the table below.
| Option | Why it matters |
|---|---|
| Operating system | Windows and some Linux distributions carry licensing charges that Linux does not. |
| Tenancy | Shared tenancy is cheapest. Dedicated options cost more. |
| Storage | Volume type, size, and provisioned IOPS are billed separately from the instance. |
| Pre-installed software | Software such as SQL Server adds license cost. |
| Multi-AZ (RDS) | Running a standby in a second Availability Zone roughly doubles instance cost. |
Checking one line item by hand
You can verify a line item with simple arithmetic. The calculator multiplies the hourly rate by the hours the instances run. The function below does the same calculation, so you can compare your result with the calculator.
HOURS_PER_MONTH = 730 # average hours in a month, a common basis for monthly estimates
def monthly_compute_cost(hourly_rate, instance_count, utilization=1.0):
"""Estimate monthly On-Demand compute cost.
utilization is the fraction of the month the instances run (0 to 1).
"""
return hourly_rate * HOURS_PER_MONTH * utilization * instance_count
# hourly_rate is an illustrative placeholder, not a current AWS price.
example_rate = 0.02
print(round(monthly_compute_cost(example_rate, instance_count=3, utilization=0.5), 2))With a rate of 0.02, three instances running half the month give 0.02 × 730 × 0.5 × 3 = 21.90. If the calculator shows a very different number for the same inputs, one of your fields probably differs from what you intended. Check Region and options first.
Common errors
- Wrong Region. You configure one service in us-east-1 and another in a different Region by accident, so the estimate mixes rates.
- Default options left unchanged. The form fills in defaults such as Linux and shared tenancy. If your workload differs, the estimate is understated.
- Missing companion charges. You add the instance but not its EBS volumes, load balancer, or backup storage.
- Description left blank. Without a note on why you chose a size, reviewers cannot judge it later. Use the description field to record your assumptions.
Summary
Configure each service in order: Region, then size and type, then options. Each choice selects a rate. The next chapter covers the other half of the line item, which is usage.
Exercise
You add three EC2 instances to an estimate and accept every default. Your real workload runs on Windows with dedicated tenancy. Which two configuration fields are most likely to make the estimate too low, and what else might be missing?
Show answer
Operating system and tenancy. Linux with shared tenancy is the cheapest combination, so Windows licensing and dedicated tenancy both raise the real rate. The estimate may also be missing companion charges such as EBS storage and a load balancer.
Exercise
Using the formula in this chapter, what is the monthly cost of 4 instances at a rate of 0.05 per hour that run for the whole month? Use 730 hours.
Show answer
0.05 × 730 × 1.0 × 4 = 146.00.