Sort on-premises costs from cloud costs and watch a variable cost move
Task
Classify the costs of an invented on-premises estate as capital or operational expenditure and as fixed or variable, and pick out the items that are cloud charges and so never belong in an on-premises estimate. Then build an estimate in the AWS Pricing Calculator for one small Amazon EC2 instance and some AWS Lambda requests, and change the usage to watch the monthly figure follow it: that movement is variable cost. Finally, check from CloudShell that nothing in your own account is running and billing you while idle. You can then explain why a fair comparison uses the total cost of ownership, not purchase prices.
Steps
- In CloudShell, write the list of costs to sort:
cat > clf-lab04-tco.csv << 'EOF'
item,capex or opex,fixed or variable,on-premises or cloud
server purchase,,,
storage array purchase,,,
building lease,,,
power,,,
cooling,,,
security guards and access control,,,
hardware maintenance contract,,,
hardware refresh every few years,,,
operations staff,,,
EC2 instance hours,,,
S3 storage per gigabyte-month,,,
Lambda requests,,,
data transferred out of AWS,,,
EOF
Open it with nano clf-lab04-tco.csv, fill in the three columns for every row, save with Ctrl+O and leave with Ctrl+X. Then compare with the Notes. 2. Open the AWS Pricing Calculator at calculator.aws and choose Create estimate. Search for Amazon EC2, choose Configure, and pick the Region closest to you. Configure one Linux instance of a small general purpose type, such as t3.micro, with On-Demand pricing, running all month. Choose Save and add service and read the monthly figure the summary shows. Do not write the figure into this lab: prices change. 3. Edit the EC2 entry and change only how long the instance runs, from all month to office hours (for example 8 hours a day, 5 days a week). Read the monthly figure again. It falls because an On-Demand instance is billed for the time it runs, and a stopped one is not billed for compute. That is a variable cost following usage, which a server you have bought can never do. 4. Add AWS Lambda to the same estimate with a request count you invent, such as one million requests a month at 128 MB. If the page offers to include the free tier, leave that option unticked so you see the usage rate itself. Halve the request count and read the figure again: Lambda's cost follows requests. 5. Change the EC2 entry's Region to one on another continent and compare. Prices differ between Regions, which is why an estimate names its Region. Do not choose Save and share: it publishes the estimate at a link anyone can open. If you want a copy, use Export to download it to your own computer. 6. Back in CloudShell, check that nothing in your account is running unnoticed in this Region:
aws ec2 describe-instances --query "length(Reservations[].Instances[?State.Name=='running'][])" --output text
AWS does not stop an idle instance for you. Any running instance is billed for every hour it runs, whether it serves traffic or not. Open the Billing and Cost Management console and read the Bills page for this month: each line there is a variable charge for something that ran.
Verify
In the estimate, the summary panel shows exactly 2 services: Amazon EC2 and AWS Lambda.
aws ec2 describe-instances --query "length(Reservations[].Instances[?State.Name=='running'][])" --output text
Expected output: 0 in an account used only for this course. Any other number is an instance billed for every hour it runs; find out what it is before you finish.
Cost and clean-up
Nothing in this lab is billed. The estimate is a web page, the CloudShell file is free storage, and describe-instances only reads.
Created by this lab: the file clf-lab04-tco.csv in your CloudShell home directory; an unsaved estimate in the AWS Pricing Calculator, which lives only in your browser tab.
- Remove the cost list:
rm clf-lab04-tco.csv
- Close the AWS Pricing Calculator tab. The unsaved estimate is discarded with it, and because you never chose Save and share, no link to it exists.
Check it is gone
ls clf-lab04-tco.csv
aws budgets describe-budgets --account-id 111122223333 --query "length(Budgets[?BudgetName=='clf-zero-spend-budget'])" --output text
Expected output: No such file or directory from the first command, then 1 from the second: the file is gone, and lesson 1's budget is still watching the account.
Notes
Answers to step 1. Capital expenditure, fixed: server purchase, storage array purchase, hardware refresh. Operational expenditure, fixed: building lease, security guards and access control, hardware maintenance contract, operations staff. Operational expenditure, partly variable: power and cooling, which rise with how hard the hardware works but are paid whether or not the capacity is useful. On-premises software licences can be either, depending on whether they are bought outright or by subscription. Cloud costs, which never belong in an on-premises estimate: EC2 instance hours, S3 storage per gigabyte-month, Lambda requests and data transferred out of AWS; all four are operational and variable.
The items most often left out of an on-premises budget are power, cooling and floor space. That is why lesson 4 compares total cost of ownership rather than the price of a server.
This is an independent study companion for the AWS Certified Cloud Practitioner (CLF-C02) exam and is not produced by or endorsed by Amazon Web Services. AWS, Amazon Web Services and AWS Certified Cloud Practitioner are trademarks of Amazon.com, Inc. or its affiliates.
This is an independent study companion for AWS Certified Cloud Practitioner CLF-C02 and is not produced by or endorsed by CompTIA.