August 19, 2020
How-to

10 approaches to control your AWS bill

,

The below suggestions can help streamline your monthly AWS bills. Many of the recommendations are applicable to other cloud providers, such as Google Cloud and Microsoft Azure, too.

1. S3 versioning and EBS/RDS snapshots

AWS makes it easy to amass immense amounts of historical data, through S3 versioning, RDS snapshots and EBS Lifecycle Manager. Keeping a few backups is always a good idea, but careful planning is needed to ensure storage costs don’t grow linearly. Lifecycle policies for S3, ECR and EBS are invaluable and can also be used to change storage tiers (i.e. Glacier for S3). For more complex logic, one can configure a regularly invoked Lambda function to explicitly clean up old data. This function can also be used to replicate RDS snapshots across regions for regional resiliency.

2. General-purpose instance classes

When choosing an instance class for ElastiCache, RDS, EC2 or other AWS services, it is tempting to opt for a compute or memory-optimized variant. By and large, these are orders of magnitude more expensive than general-purposes t3.XXX sizes and aren’t needed unless you have specific requirements. AWS’ concept of burstable CPU, governed by CPU credits, works well for the majority of use cases. Using the latest generation of instance type always gets the most performance at a lower cost too.

3. Savings plans

Reserved Instances, whereby one makes a 1-year or 3-year commitment for a particular AWS service at a negotiated rate, have been around for a while. In their current incarnation, you can switch between instance classes easily. Savings Plans allow for a broader commitment to a collection of AWS services (namely EC2, Fargate and Lambda), providing more flexibility. Take note to only purchase any commitment as a last resort, after you have already optimized and reduced your environment footprint as much as possible.

4. RDS multi-AZ and replicas

Enabling multi-AZ for RDS instances or adding an additional instance to an Aurora RDS cluster immediately doubles your costs. This should only be done in production environments where you need the resiliency or extra performance of a read-replica.

5. Resizing ECS task definitions

Above and beyond ECS autoscaling, where the number of tasks for a given service is automatically adjusted, consider adjusting the task definition configuration for the allocated vCPU and memory. Though there are a limited number of supported configuration permutations, lowering either vCPU or memory slightly can have large savings across multiple environments and dozens of tasks. A big advantage of using Fargate over EC2 is that one doesn’t need to worry about provisioning sufficient underlying EC2 instance capacity.

6. Share expensive services across AWS accounts

If you have multiple AWS accounts, consider joining them all to an organization. Not only does this umbrella topology make billing simpler, but it allows you to share certain services to reduce cost. Shield Advanced is priced at $3,000/month per organization and Private Certificate Authorities are $400/month but can be shared across accounts.

7. Thrashing Docker containers

If using ECS Fargate, a common unforeseen expense can be thrashing Docker containers which are failing to properly start up. The ECS service will continue to initiate a new task indefinitely. Each time, the task definition will pull the image from either ECR or Docker Hub consuming a sizeable amount of bandwidth. Over the course of a month, a single failing task can cost multiple terabytes of transfer costs. One can monitor for this with Datadog alerts or CloudWatch alarms.

8. Third-party integrations

Integrations like Datadog, Vanta and Fivetran can be overly aggressive with their sync frequency and breadth of data absorbed. This leads to high CloudWatch metric, Data Transfer and NAT Gateway charges. For each provider, ensure you have only the bare minimum of enabled features (i.e. disabling DMS in Datadog, if not using it) and a reasonable sync frequency (i.e. every 15 mins instead of every 5 mins).

9. Dovetailing services

The headline pricing for all AWS services can be deceiving. Generally priced per hour, a cost of $0.98/hour looks a lot more affordable than $729.12/month. Equations, partial hours and dimensions(i.e. LCUs on ALBs) can further complicate pricing estimates.

However, the biggest hidden cost is all of the ancillary services that each AWS offering relies on. For example, using an ALB can have ‘dovetailed’ costs with CloudWatch metrics, S3 logging, DataTransfer, WAF ACLs, etc. Removing or consolidating any single AWS resource can therefore have knock-on effects to your bill.

10. Expiring credits

Many startups are fortunate enough to acquire credits with AWS, through their Ramp credit card or from the incubator they participated in. While thousands of dollars in free money is nothing to scoff at, AWS sets a finite expiry on the credits, usually 12 months later. Take a periodic look at both your remaining credit balance and the credit expiry to avoid unpleasant surprises. This can be seen under My Billing Dashboard and then Credits.

Lewis Drummond
Head of Infrastructure & DevOps, Ramp

10 approaches to control your AWS bill

August 19, 2020
by
Lewis Drummond
,
Head of Infrastructure & DevOps, Ramp

The below suggestions can help streamline your monthly AWS bills. Many of the recommendations are applicable to other cloud providers, such as Google Cloud and Microsoft Azure, too.

1. S3 versioning and EBS/RDS snapshots

AWS makes it easy to amass immense amounts of historical data, through S3 versioning, RDS snapshots and EBS Lifecycle Manager. Keeping a few backups is always a good idea, but careful planning is needed to ensure storage costs don’t grow linearly. Lifecycle policies for S3, ECR and EBS are invaluable and can also be used to change storage tiers (i.e. Glacier for S3). For more complex logic, one can configure a regularly invoked Lambda function to explicitly clean up old data. This function can also be used to replicate RDS snapshots across regions for regional resiliency.

2. General-purpose instance classes

When choosing an instance class for ElastiCache, RDS, EC2 or other AWS services, it is tempting to opt for a compute or memory-optimized variant. By and large, these are orders of magnitude more expensive than general-purposes t3.XXX sizes and aren’t needed unless you have specific requirements. AWS’ concept of burstable CPU, governed by CPU credits, works well for the majority of use cases. Using the latest generation of instance type always gets the most performance at a lower cost too.

3. Savings plans

Reserved Instances, whereby one makes a 1-year or 3-year commitment for a particular AWS service at a negotiated rate, have been around for a while. In their current incarnation, you can switch between instance classes easily. Savings Plans allow for a broader commitment to a collection of AWS services (namely EC2, Fargate and Lambda), providing more flexibility. Take note to only purchase any commitment as a last resort, after you have already optimized and reduced your environment footprint as much as possible.

4. RDS multi-AZ and replicas

Enabling multi-AZ for RDS instances or adding an additional instance to an Aurora RDS cluster immediately doubles your costs. This should only be done in production environments where you need the resiliency or extra performance of a read-replica.

5. Resizing ECS task definitions

Above and beyond ECS autoscaling, where the number of tasks for a given service is automatically adjusted, consider adjusting the task definition configuration for the allocated vCPU and memory. Though there are a limited number of supported configuration permutations, lowering either vCPU or memory slightly can have large savings across multiple environments and dozens of tasks. A big advantage of using Fargate over EC2 is that one doesn’t need to worry about provisioning sufficient underlying EC2 instance capacity.

6. Share expensive services across AWS accounts

If you have multiple AWS accounts, consider joining them all to an organization. Not only does this umbrella topology make billing simpler, but it allows you to share certain services to reduce cost. Shield Advanced is priced at $3,000/month per organization and Private Certificate Authorities are $400/month but can be shared across accounts.

7. Thrashing Docker containers

If using ECS Fargate, a common unforeseen expense can be thrashing Docker containers which are failing to properly start up. The ECS service will continue to initiate a new task indefinitely. Each time, the task definition will pull the image from either ECR or Docker Hub consuming a sizeable amount of bandwidth. Over the course of a month, a single failing task can cost multiple terabytes of transfer costs. One can monitor for this with Datadog alerts or CloudWatch alarms.

8. Third-party integrations

Integrations like Datadog, Vanta and Fivetran can be overly aggressive with their sync frequency and breadth of data absorbed. This leads to high CloudWatch metric, Data Transfer and NAT Gateway charges. For each provider, ensure you have only the bare minimum of enabled features (i.e. disabling DMS in Datadog, if not using it) and a reasonable sync frequency (i.e. every 15 mins instead of every 5 mins).

9. Dovetailing services

The headline pricing for all AWS services can be deceiving. Generally priced per hour, a cost of $0.98/hour looks a lot more affordable than $729.12/month. Equations, partial hours and dimensions(i.e. LCUs on ALBs) can further complicate pricing estimates.

However, the biggest hidden cost is all of the ancillary services that each AWS offering relies on. For example, using an ALB can have ‘dovetailed’ costs with CloudWatch metrics, S3 logging, DataTransfer, WAF ACLs, etc. Removing or consolidating any single AWS resource can therefore have knock-on effects to your bill.

10. Expiring credits

Many startups are fortunate enough to acquire credits with AWS, through their Ramp credit card or from the incubator they participated in. While thousands of dollars in free money is nothing to scoff at, AWS sets a finite expiry on the credits, usually 12 months later. Take a periodic look at both your remaining credit balance and the credit expiry to avoid unpleasant surprises. This can be seen under My Billing Dashboard and then Credits.

Don’t miss these
How to track spend across all vendors
10 details to negotiate with vendors to maximize savings and minimize stress
Vendor Management Best Practices
Meet our customers

How we helped Squared Away find extra savings automatically

How we helped Brigit get a customer-centric corporate card solution

How we helped Mode track spend in real-time

How we helped Eight Sleep automate their accounting

How we helped WayUp put expense reports on auto-pilot

How we help Red Antler centralize its company spend

Learn more about Ramp

Streamline approvals.
Review requests, pre-approve expenses, and issue general expense cards in a few clicks – or directly in Slack. Delegate approvals and empower your team leads to spend on the things they need and control their team’s expenses.
Learn more
Issue instant cards.
Unlimited virtual and physical cards with built-in spend limits, instantly available for everyone in your team. Define spend rules and let your smart cards enforce your policies automatically. No more surprises or under-the-radar spending.
Learn more
See spend as it happens.
Stop waiting on monthly statements or manual spreadsheets. Find, browse, and download real-time transactions from any employee, department, or merchant – on any device.
Learn more
Close your books 5x faster.
An accounting experience by finance teams, built for speed and efficiency. Automate manual processes and start enjoying instant reconciliation – Ramp does all the heavy lifting.
Learn more
Trim wasteful spend.
Ramp analyses every transaction and identifies hundreds of actionable ways your company can cut expenses and alerts your team via email, SMS, or Slack. It’s like having a second finance team, laser-focused on cutting costs.
Learn more
Consolidate reimbursements.
Ramp makes it easy to reimburse your employees for any incidental out-of-pocket expenses. Review, approve, and pay employees back for anything that didn’t make it onto a card with the rest of your Ramp transactions.
Learn more