Following up on our article from last week, we're continuing forward - today we're going to apply this to a real scenario, finding out how much we're paying for our website hosting.
At Cloud Accountant we believe you should use exactly what you need, no more, no less. In our case, our website is simple - there's no dynamic functionality we required. That's why HTML, CSS and JS were the best choice for us.
This article assumes that you followed our last blog post, Here
OUR INFRASTRUCTURE
What's in Cloud Accountant's infrastructure?
Route 53 - This hosts our DNS for CloudAccountant.io
S3 - This stores our static content, and also our logs
CloudFront - This serves up our content to end users
AWS Certificate Manager - This allows us to automatically provision an SSL Certificate for CloudAccountant.io
WHAT ARE WE SPENDING ON ROUTE 53?
Route 53 handles our DNS for CloudAccountant.io, the below query will let us know the aggregate cost for the Hosted Zone we've specified, replace HOSTEDZONEID with your own
SELECT line_item_resource_id,
sum(line_item_blended_cost) AS cost, month
from CA
WHERE line_item_resource_id LIKE '%HOSTEDZONEID%'
GROUP BY line_item_resource_id, month
ORDER BY line_item_resource_id;
What if you want a more detailed view? Maybe you'd like to find out how much you're spending on each record query type
SELECT line_item_resource_id,line_item_blended_cost,line_item_usage_type, line_item_operation, line_item_line_item_description
from CA
WHERE line_item_resource_id LIKE '%HOSTEDZONEID%'
ORDER BY line_item_resource_id;
Looks like we're spending $0.515 Per month for our DNS, but that'll be our highest cost.
HOW ABOUT THOSE CLOUDFRONT COSTS, THEY CAN'T BE CHEAP - RIGHT?
CloudFront acts as our CDN, it allows for rapid delivery of our static content, replace CFDISTRIBUTIONID with your distribution ID. This will give you the aggregate cost of the distribution
SELECT line_item_resource_id,
sum(line_item_blended_cost) AS cost, month
from CA
WHERE line_item_resource_id LIKE '%CFDISTRIBUTIONID%'
GROUP BY line_item_resource_id, month
ORDER BY line_item_resource_id;
You can even break the data down further, finding out exactly how much data in each region is costing you.
SELECT line_item_resource_id,line_item_blended_cost,line_item_usage_type, line_item_operation, line_item_line_item_description
from CA
WHERE line_item_resource_id LIKE '%CFDISTRIBUTIONID%'
ORDER BY line_item_resource_id;
We're spending $0.118 on CloudFront, and we get amazing performance from it
AWS CERTIFICATE MANAGER
We're lucky here - AWS Certificate Manager provides SSL Certificates used on ELBs and CloudFront Distribution for FREE. If you're using a private CA you can search by the Line_Item_Product_Code "AWSCertificateManager"
S3
We store our static content in S3, along with our logs. This gives a simple place to stored static content that can be delivered via Cloudfront
SELECT line_item_resource_id,
sum(line_item_blended_cost) AS cost, month
from CA
WHERE line_item_resource_id = 'WSBUCKETNAME'
GROUP BY line_item_resource_id, month
ORDER BY line_item_resource_id;
Our static content has a total cost of $0.015/Month
What about the logs bucket?
SELECT line_item_resource_id,
sum(line_item_blended_cost) AS cost, month
from CA
WHERE line_item_resource_id = 'LOGSBUCKET'
GROUP BY line_item_resource_id, month
ORDER BY line_item_resource_id;
The logs cost us about $0.02
PUTTING IT ALL TOGETHER
What's the total cost that we're paying for these resources?
SELECT bill_payer_account_id,
sum(line_item_blended_cost) as cost
from CA
WHERE line_item_resource_id = 'BUCKET'
OR line_item_resource_id = 'LOGSBUCKET'
OR line_item_resource_id LIKE '%HOSTEDZONE%'
OR line_item_resource_id LIKE '%CFID%'
GROUP BY bill_payer_account_id;
Our total cost is $0.66/Month, and without the DNS hosting, it's about $0.15/Month. Isn't it time to find out what you're spending?
WHAT ABOUT THE PERFORMANCE?
You'd think because it's cheap, it'd be slow, right? You get what you pay for is the age-old saying. If we run our site through gtmetrix we can see the performance score is 99%, for only $0.15/Month.
WANT TO LEARN MORE?
Over the next few weeks we'll be releasing more in-depth Amazon CUR and Athena queries and use-cases. In the meantime the best resource to help you write additional queries is understanding the line items in the report, AWS has a glossary of these on their website, Here
FEELING THE BURN FROM YOUR AWS BILL AND NEED IMMEDIATE RELIEF?
Reach out to our team on CloudAccountant.io, schedule a risk free 20 minute session with one of our experts to give you a demo of what we can really do. On average we've saved our clients 72% on their AWS bill, without any risk on their end
Comments