Sub topic 4
Configuring a service: Region, size, and options
This chapter assumes you know the basics of EC2, S3, and RDS, understand AWS Regions, and can read a monthly cost breakdown. It also assumes you have seen the structure of an estimate: an estimate holds services, and each service holds one or more configurations. Here you will work on a single service configuration and learn which inputs move the price most.
What a configuration is
A service configuration is one set of choices for one service in an estimate. If you add Amazon EC2 twice, once for web servers and once for batch workers, you have two configurations of the same service. Each configuration produces its own upfront cost and monthly cost, and the estimate adds them together.
Every configuration form asks for the same three kinds of input:
- Where the resource runs, which is the Region.
- What the resource is, which is its size, type, and family.
- How it is used and bought, which covers the options such as operating system, storage class, and purchase model.
Usage amounts (hours, requests, gigabytes) are covered in the next chapter. This chapter focuses on the first two kinds of input plus the service-specific options that change the unit price.
Region comes first
AWS prices the same resource differently in different Regions. The reasons include local power, land, and network costs, plus taxes. A configuration that looks identical except for the Region can differ by 10 to 30 percent or more for compute, and the gap can be larger for some services.
Choose the Region before anything else for three reasons:
- The list of available instance types, database engines, and features depends on the Region. A type you pick in one Region may not exist in another.
- Changing the Region later can reset dependent fields, such as the instance type list or the storage options.
- Data transfer between Regions is billed, so the Region choices for related services affect the total.
Pick the Region where you plan to deploy, not the one that is cheapest, unless cost is the deciding factor. Latency to users, data residency rules, and service availability usually matter more than a small price difference. When you want to compare, create two configurations that differ only in Region and read the totals side by side.
Size and type
Size is the field that most often dominates the cost. For each service it has a different name:
| Service | Primary size input | Example value |
|---|---|---|
| Amazon EC2 | Instance type | t3.micro, m6i.large |
| Amazon RDS | DB instance class and storage | db.m6g.large, 100 GB |
| Amazon S3 | Storage class and total stored data | S3 Standard, 500 GB |
| AWS Lambda | Memory and duration per invocation | 512 MB, 200 ms |
| Amazon EBS | Volume type, size, IOPS | gp3, 200 GB |
An instance type name has a pattern. In m6i.large, m is the family (general purpose), 6 is the generation, i marks the processor variant (Intel), and large is the size within the family. Within a family, each step up in size roughly doubles the vCPUs, the memory, and the hourly price. For example, large to xlarge doubles the capacity and, in most cases, the price. This means that doubling the size costs about the same as running two of the smaller instances, so size choices are mostly about fit, not about discounts.
Newer generations often cost the same or less than older ones and perform better. Check whether the generation you picked is the current one before you commit to it in an estimate.
Estimating from a baseline, not a guess
If you have an existing server, take its size from measurements. Look at peak and average CPU and memory in your monitoring tool, then choose the smallest type that fits with some headroom. If you are estimating a new workload with no data, state the sizing assumption in the configuration's description field so a reviewer knows the number is a guess.
Service-specific options
After Region and size, each service shows options that change the unit price. These are easy to leave at their defaults, and the defaults are not always what you plan to run.
Amazon EC2
- Operating system. Linux is the baseline. Windows adds a license charge to the hourly rate, and some Linux distributions with commercial support do too.
- Tenancy. Shared tenancy is the default. Dedicated Instances and Dedicated Hosts cost more.
- Pre-installed software. Options such as SQL Server in the image add license fees.
- Storage. The root volume and any extra EBS volumes are billed separately from the instance. Choose the volume type and size.
- Monitoring. Detailed monitoring adds a charge per instance.
Amazon RDS
- Database engine. Engines have different prices, and commercial engines include or add license cost.
- Deployment option. A Multi-AZ deployment keeps a standby copy in another Availability Zone and roughly doubles the instance cost, because you pay for the standby.
- Storage type and size. General purpose, provisioned IOPS, and magnetic-class choices are billed differently, and provisioned IOPS adds a separate IOPS charge.
- Backup storage. Backup space beyond the size of your database is billed.
Amazon S3
- Storage class. S3 Standard, Infrequent Access, and Glacier classes differ in storage price, retrieval fees, and minimum storage duration.
- Request types. PUT, COPY, POST, and LIST requests cost more than GET requests.
Seeing how options change the price
You can reproduce the arithmetic behind a compute line item by hand. The following function multiplies an hourly rate by hours, utilization, and instance count. Add an optional multiplier for a Multi-AZ style doubling or a license surcharge, and you can test how options change the result before you enter them in 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, option_multiplier=1.0):
"""Estimate monthly On-Demand compute cost.
utilization is the fraction of the month the instances run (0 to 1).
option_multiplier scales the rate for options such as a standby copy
(2.0) or a license surcharge expressed as a ratio.
"""
return hourly_rate * option_multiplier * HOURS_PER_MONTH * utilization * instance_count
# The rates below are illustrative placeholders, not current AWS prices.
rate = 0.02
single_az = monthly_compute_cost(rate, instance_count=2)
multi_az = monthly_compute_cost(rate, instance_count=2, option_multiplier=2.0)
print(f"Single-AZ: {single_az:.2f}")
print(f"Multi-AZ: {multi_az:.2f}")
print(f"Difference: {multi_az - single_az:.2f}")The output shows that a single setting, here the standby copy, accounts for the whole difference. Use this kind of check on any line item that looks surprising.
The configuration workflow
The sequence below keeps the dependent fields stable, because each step narrows the choices for the next.
Common errors
- Leaving the default Region. The total is correct for a Region you will not use.
- Pricing one instance when you need several. Check the quantity, and remember that high-availability designs need at least two instances.
- Forgetting attached storage. Instance cost and EBS cost are separate line items. An estimate with compute only is understated.
- Ignoring the operating system. Windows or database-licensed images change the hourly rate.
- Using an unavailable type. If a type is not offered in the chosen Region, the form will not show it. Pick a comparable type rather than forcing the estimate to use a different Region.
- Mixing up units. Gigabytes, gibibytes, and terabytes differ. Confirm which unit the field uses.
Checking a configuration against list prices
After you configure a service, verify the hourly rate the calculator used. The AWS Price List Query API returns the list price record for a given configuration. The following AWS CLI command looks up a t3.micro Linux instance with shared tenancy in US East (N. Virginia). The filters correspond to the options you choose in the calculator: instance type, location, operating system, tenancy, and pre-installed software.
aws pricing get-products \
--region us-east-1 \
--service-code AmazonEC2 \
--filters \
"Type=TERM_MATCH,Field=instanceType,Value=t3.micro" \
"Type=TERM_MATCH,Field=location,Value=US East (N. Virginia)" \
"Type=TERM_MATCH,Field=operatingSystem,Value=Linux" \
"Type=TERM_MATCH,Field=tenancy,Value=Shared" \
"Type=TERM_MATCH,Field=preInstalledSw,Value=NA" \
"Type=TERM_MATCH,Field=capacitystatus,Value=Used" \
--max-items 1Each filter field maps to a configuration choice. If you change the operating system in the calculator, change the operatingSystem value in the filter. The --region us-east-1 flag selects the API endpoint, not the Region being priced. The location filter sets the priced Region. The Price List API is covered in detail in a later chapter.
Summary of the habits that prevent errors
- Set the Region first and confirm it again before reading the total.
- Size from measurements, and write down assumptions when you have none.
- Open every options section and replace defaults with the values you will deploy.
- Include attached resources: storage, backups, monitoring, and licenses.
- Spot-check at least one line item by hand or against the Price List API.
Exercise
You configure Amazon RDS for a production database. The estimate shows a monthly instance cost of 200 units for a single-AZ deployment. Your team decides on a Multi-AZ deployment. Roughly what instance cost should you expect, and why? Name one other RDS option you should also check.
Show answer
Expect roughly 400 units for the instance, because Multi-AZ keeps a standby copy in another Availability Zone and you pay for that standby instance. Storage and backup choices also change the total, so also check the storage type and size (including any provisioned IOPS charge) and backup storage beyond the database size.
Exercise
In the Price List API command, you change the calculator configuration from Linux to Windows. Which filter must you change, and does the --region flag need to change if you also move the priced Region from US East (N. Virginia) to Europe (Ireland)?
Show answer
Change the operatingSystem filter value from Linux to Windows. The --region flag does not need to change, because it selects the API endpoint. To price Europe (Ireland), change the location filter value to the Europe (Ireland) location name.