Post

AWS Costs optimization Tools and Frameworks: Extract from AWS Series

Abstract

AWS provides various tools and best practices to control, audit your billing expenses. These tools enable you to maintain optimal spending levels through the implementation of different strategies and to monitor resource utilization. Additionally, AWS facilitates the creation of notification systems to alert you when spending thresholds are exceeded. We’ll also discuss the potential business impact that can be achieved through the use of these tools.

Pricing Models are defined for each service

The widely notable benefit of Public Cloud billing model compared to traditional DataCenter-based is the shift from CapEx to Opex model that allows to reduce upfront costs (only pay for what you use, scale up/down system any at time based on the demand).

CapEx (capital expenditures) are funds used by a company to acquire, upgrade, and maintain, improve its fixed physical assets such as buildings, technology or equipment.

Opex (operational expenditure) is the ongoing cost a company spends on day-to-day basis to run its business, product, system. These expenses can be one-time or recurring.

In addition to the shift from CapEx to OpEx, AWS provides features such as reserved capacity and upfront payments that enable you to receive AWS credits and reduce your overall billing expenses.

In order to utilize these features effectively, it’s important to have a clear understanding of the internal billing structure of each service. A helpful starting point is the pricing page, which is available for every AWS service and provides a detailed breakdown of pricing based on region, service-specific details, and more. Here are a few examples:

  • https://aws.amazon.com/ec2/pricing/
  • https://aws.amazon.com/eks/pricing/
  • https://aws.amazon.com/dynamodb/pricing/

Estimate your infrastructure costs with AWS pricing Calculator

Pricing calculator allows estimate costs of usage subset of services for you infrastructure. You can specify desired configuration setup for each service, amount of time it will be running, data rates, volume size, etc.

img.png

Specify the region, service, billing period details and service specific details

img_1.png

For EC2 by includes vCPU and memory, calculator can propose best matching of instance family and type for your setup.

img_2.png

Once, estimates are generated you can export results into CSV, PDF, JSON format

img_3.png

Estimated costs are available for monthly/yearly period.

img_4.png

img_5.png

Apply Security Savings Bundle to get AWS Credits for CloudFront and WAF

If you are using CloudFront, by applying to CloudFront Security Savings Bundle you can save up to 30% of CloudFront usage. Discounts are based on upfront commitments, additionally you will receive AWS credits to use with AWS WAF (Web Application Firewall Service).

CloudFront Commitment and receive the discount example (monthly and annual calculation):

ActionsPrice
Your Typical CloudFront spending$600 per-month
Now you apply Commitment to pay for CloudFront$420 per-month
AWS credits applied to your account every month towards CloudFront(Commitment + 30%(Commitment)) = $600 per-month
Free AWS credits for CloudFront$80 per-month
Free AWS credits for AWS WAF10%(Commitment) = $42
PeriodSavings
Monthly$180 + $42 = $222
Annual$222 * 12 = $2664

You can save up to 72% on your Compute workloads with Saving Plans. It is a Pricing Model that offers discounted prices on regular and on-demand instances if you commit 1 or 3 years.

You can get recommendations based on past resources’ usage: img.png

Purchase existing plans:

  • Compute saving plans (ec2, fargate, lambda, regardless of region, instance family, size, tenancy, OS)
  • EC2 instance saving plans (ec2 commitment to EC2 family and region, regardless of size, tenancy and OS)
  • SageMaker saving plans (SageMaker service usage, regardless of region, instance family)

Hourly commitment:

  • Payment method All upfront (biggest discount)
  • Partial Upfront
  • No Upfront

Saving plan can be downloaded in CSV formant

Run analysis with Trusted Advisor for costs optimization strategies

img_1.png

All Categories in Trusted Advisors reflect Pillars:

  • cost optimization
  • performance
  • security
  • fault tolerance
  • service limits

There are multiple optimization and performance checks including:

  • identify idle resources
  • utilization of components
  • over-provisioned EBS volumes
  • RDS idle DBs, Redshift
  • EC2 instances with running DB engines verification
  • Lambda functions
  • Load Balancers

Plus, Export and download checks as xlsx file is supported

Create Cost Categories based on your context and business units

After accessing Billing console (https://console.aws.amazon.com/billing/) you can group costs and usage information into a specific context of you business (Development unit/account/vertical, Team owning particular infrastructure, etc.).

This is done by defining and creating custom categories to which you can map cost and usage information based on rules that you create (dimensions are based on resources TAGs, service, charge type, account, etc.).

After enabling categories - at the start of each month you will see aggregation of costs for defined categories in other billing tools:

  • Cost Explorer
  • AWS budgets
  • AWS cost detection anomaly
  • AWS cost and usage report

See more service specific details with Cost Explorer

  • allows to view and analyse your usage with main graph or RI reports
  • shows current month and last 12 months.
  • calculates forecast for next 12 months
  • supports most used service group by region, period, etc.
  • downloadable CSV format

Use CloudWatch Alarm to be notified if billing exceeds defined threshold

Allows to monitor of estimated charges as CW metric (us-east-1 North Virginia region). This can be an estimated charges for every service and total A defined CloudWatch alarm is trigger when costs exceed the provided Threshold values.

Precondition

  • enable in Billing DashBoard (https://us-east-1.console.aws.amazon.com/billing/home)
  • enable checkbox in Cost Management Preferences -> Receive Billing Alerts

Create Billing Alarm

  • Cloudwatch -> Create Alarm -> Select Metrics (“billing”)-> TotalEstimatedCharge
  • Define condition (> >= < <=)
  • define threshold sum $
  • choose SNS topic for notification

Run Well Architected reviews using AWS Well Architected Tool

Review process is based on Well Architected Framework where you can include one or more AWS Pillars and start evaluation.

Well Architected Tool is a subset of grouped question with multiple answers poll-based interview model (at this moment it contains 58 questions) that you are going through and select the answers. You can narrow the context and scope of which AWS Pillar review will be done or choose all of them.

img.png

The results are grouped as risks with different severity into a Plan for mitigation with action items for improvements.

img_1.png

After finishing the review and evaluation you will receive the improvements items with link to documentation that contain implementation guidance.

img_2.png

Create AWS Budgets to control and receive notifications when you are above Free Tier or specific threshold

  • track and take action on resources’ usage
  • cost budget (how much to spend on a service)
  • usage budgets (how much use on services)
  • reserved instance options (to be alerted when reserve instances usage falls below threshold)
  • saving plan utilisation budgets (with alerts)

img.png

  • Zero spend budget (notify once spending exceeds $0.01 above Free Tier limits)
  • Monthly cost budget
  • Daily Savings Plans coverage budget
  • Daily reservation utilization budget

img_1.png

This post is licensed under CC BY 4.0 by the author.