<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>AWS Cost Optimization Case Studies · Remote Since Forever</title>
  <subtitle>AWS cost optimization case studies — Graviton (ARM) up to 20% off compute, Compute Savings Plans up to 66% off, budget alerts before the invoice hits.</subtitle>
  <link href="https://blog.clearview.team/tags/aws-cost-optimization/feed.xml" rel="self" type="application/atom+xml" />
  <link href="https://blog.clearview.team/tags/aws-cost-optimization/" />
  <updated>2026-08-20T17:39:48+02:00</updated>
  <id>https://blog.clearview.team/tags/aws-cost-optimization/feed.xml</id>
  <author>
    <name>Clearview Team</name>
  </author>
  <entry>
    <title>The most Flexible AWS Savings Plan</title>
    <link href="https://blog.clearview.team/2024/the-most-flexible-aws-savings-plan/" />
    <id>https://blog.clearview.team/2024/the-most-flexible-aws-savings-plan/</id>
    <published>2024-03-11T01:12:09+01:00</published>
    <updated>2024-03-11T01:12:09+01:00</updated>
    <author>
      <name>Clearview</name>
    </author>
    <summary>How AWS Compute Savings Plans can cut up to 66% off the cloud bill — without locking you into an instance family.</summary>
    <content type="html">&lt;p&gt;&lt;img src=&quot;/assets/images/posts/the-most-flexible-aws-savings-plan/cover.svg&quot; alt=&quot;Editorial cover — a downward-trending Savings Plan line against a flat on-demand baseline, with an &amp;quot;up to 66% off&amp;quot; callout.&quot; /&gt;&lt;/p&gt;

&lt;p&gt;AWS provides several ways to reduce your cost but no other program is as flexible as the &lt;strong&gt;Compute Saving Plan&lt;/strong&gt;. This article covers what you need to know to successfully and efficiently use the AWS savings program.&lt;/p&gt;

&lt;h3 id=&quot;what-are-savings-plans&quot;&gt;What are Savings Plans&lt;/h3&gt;

&lt;p&gt;Put plainly, all AWS cost-saving plans offer cost reductions compared to On-Demand prices, in exchange for a long-term commitment. That commitment is &lt;strong&gt;&lt;em&gt;1 or 3 years long&lt;/em&gt;&lt;/strong&gt; and is an &lt;strong&gt;hourly spend commitment&lt;/strong&gt; type.&lt;/p&gt;

&lt;p&gt;AWS provides three types of Savings Plans:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Compute Savings Plans,&lt;/li&gt;
  &lt;li&gt;EC2 Instance Savings Plans, and&lt;/li&gt;
  &lt;li&gt;Amazon SageMaker Savings Plans.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The focus of this article is on the most flexible type of savings plan which is the Compute Savings Plan.&lt;/p&gt;

&lt;h3 id=&quot;research-research-research&quot;&gt;Research, Research, Research&lt;/h3&gt;

&lt;p&gt;The first step we need to take is to see if there are any &lt;a href=&quot;https://us-east-1.console.aws.amazon.com/cost-management/home#/savings-plans/recommendations&quot;&gt;Recommendations&lt;/a&gt;. This page might tell you what AWS recommends to purchase. Not everyone gets this kind of suggestion as they are based on your usage.&lt;/p&gt;

&lt;h4 id=&quot;follow-the-next-example-to-understand-how-to-purchase-a-compute-savings-plan&quot;&gt;Follow the next example to understand how to purchase a Compute Savings Plan.&lt;/h4&gt;

&lt;h3 id=&quot;a-simple-example-get-a-discount-on-a-single-t4gmicro-ec2-instance&quot;&gt;A Simple Example: Get a Discount on a Single t4g.micro EC2 Instance&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/posts/the-most-flexible-aws-savings-plan/purchase-illustration.svg&quot; alt=&quot;Two paths from a single t4g.micro instance in eu-west-1 — Path A on-demand at $0.0092/hour, Path B 1-year Compute Savings Plan at $0.0075/hour (an 18% reduction), with the 3-year term shown as a dotted Path B′ at 42%.&quot; /&gt;&lt;/p&gt;

&lt;p&gt;This is a straightforward example. In this example, the commitment is for 1 year in Europe (Ireland), the eu-west-1 region.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;A very important note is to know that discounts vary from Region to Region so do your research beforehand.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3 id=&quot;step-1-check-your-bill&quot;&gt;Step 1: Check Your Bill&lt;/h3&gt;

&lt;p&gt;Find your bill in the AWS console. You can see something like this.&lt;/p&gt;

&lt;figure class=&quot;post-figure&quot;&gt;
  &lt;img src=&quot;/assets/images/posts/the-most-flexible-aws-savings-plan/0_bOFhgAIo4NxFWIEB.png&quot; width=&quot;462&quot; height=&quot;83&quot; alt=&quot;AWS Bill screenshot made by the author.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
  &lt;figcaption&gt;AWS Bill screenshot made by the author.&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;We identified that we are paying On-Demand prices for a &lt;strong&gt;&lt;em&gt;t4g.micro&lt;/em&gt;&lt;/strong&gt; EC2 instance.&lt;/p&gt;

&lt;h3 id=&quot;step-2-identify-the-savings-rate-in-your-region&quot;&gt;Step 2: Identify the Savings Rate in Your Region&lt;/h3&gt;

&lt;p&gt;Find out in which region your EC2 instance is hosted. After that access the table at &lt;a href=&quot;https://aws.amazon.com/savingsplans/compute-pricing/&quot;&gt;Savings Plan Compute Pricing&lt;/a&gt; page. That page will show you a table like the one below.&lt;/p&gt;

&lt;figure class=&quot;post-figure&quot;&gt;
  &lt;img src=&quot;/assets/images/posts/the-most-flexible-aws-savings-plan/0_G2yKI4l2pHLtw77n.png&quot; width=&quot;1024&quot; height=&quot;619&quot; alt=&quot;AWS Savings Plan Compute Pricing Page screenshot made by the author.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
  &lt;figcaption&gt;AWS Savings Plan Compute Pricing Page screenshot made by the author.&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;The goal is to get a discount on the usage of a &lt;strong&gt;&lt;em&gt;t4g.micro&lt;/em&gt;&lt;/strong&gt; EC2 instance.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;On-Demand rate — $0.0092 * 720 hours (hours in a 30-day month) = $6.624&lt;/li&gt;
  &lt;li&gt;Savings Plans rate — $0.0075 * 720 hours (hours in a 30-day month) = $5.62500&lt;/li&gt;
  &lt;li&gt;Savings over On-Demand — 18%&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;If you commit to a&lt;/strong&gt; 3-year term &lt;strong&gt;the savings will be 42% instead of 18% for the Ireland Region.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3 id=&quot;step-3-purchase-a-plan&quot;&gt;Step 3: Purchase a Plan&lt;/h3&gt;

&lt;p&gt;So the purchase plan will look like this.&lt;/p&gt;

&lt;figure class=&quot;post-figure&quot;&gt;
  &lt;img src=&quot;/assets/images/posts/the-most-flexible-aws-savings-plan/0__Qh-mEqhQjv5IOiZ.png&quot; width=&quot;729&quot; height=&quot;770&quot; alt=&quot;AWS Savings Plan Purchase screenshot made by the author.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
  &lt;figcaption&gt;AWS Savings Plan Purchase screenshot made by the author.&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure class=&quot;post-figure&quot;&gt;
  &lt;img src=&quot;/assets/images/posts/the-most-flexible-aws-savings-plan/0_gXSAULqlrwI8ktBg.png&quot; width=&quot;1024&quot; height=&quot;354&quot; alt=&quot;AWS Savings Plan Cart screenshot made by the author.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
  &lt;figcaption&gt;AWS Savings Plan Cart screenshot made by the author.&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;Important notes:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Do not purchase large plans and over-commit.&lt;/li&gt;
  &lt;li&gt;Purchase small plans and then monitor the coverage.&lt;/li&gt;
  &lt;li&gt;If you need more coverage at a later period in time you can purchase additional savings plans.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;The hourly commitment rate is the one after the discount — the Savings Plans Rate.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3 id=&quot;reports-analysis&quot;&gt;Reports Analysis&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/posts/the-most-flexible-aws-savings-plan/reports-illustration.svg&quot; alt=&quot;Two dashboard panels — left, a utilization gauge near full; right, a coverage line climbing from flat-low to about 43% after the plan activates.&quot; /&gt;&lt;/p&gt;

&lt;h4 id=&quot;utilization-report&quot;&gt;Utilization Report&lt;/h4&gt;

&lt;p&gt;Below you can see a sample utilization report for a single day after the savings plan has been purchased.&lt;/p&gt;

&lt;figure class=&quot;post-figure&quot;&gt;
  &lt;img src=&quot;/assets/images/posts/the-most-flexible-aws-savings-plan/0_V3Hn5IthXeSXfWbN.png&quot; width=&quot;1024&quot; height=&quot;215&quot; alt=&quot;AWS Utilization report screenshot made by the author.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
  &lt;figcaption&gt;AWS Utilization report screenshot made by the author.&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h4 id=&quot;coverage-reports&quot;&gt;Coverage Reports&lt;/h4&gt;

&lt;p&gt;Under the “Billing and Cost Management / Savings Plan” menu, you can find the &lt;a href=&quot;https://us-east-1.console.aws.amazon.com/cost-management/home#/savings-plans/coverage?&quot;&gt;Coverage report&lt;/a&gt;. Here you can get information about how much of your spending has been covered by a savings plan during a certain period. You get information such as &lt;strong&gt;Average coverage&lt;/strong&gt;, &lt;strong&gt;Potential monthly savings vs On-Demand,&lt;/strong&gt; and &lt;strong&gt;On-Demand spend not covered&lt;/strong&gt;.&lt;/p&gt;

&lt;h4 id=&quot;before-creating-a-savings-plan&quot;&gt;Before Creating a Savings Plan&lt;/h4&gt;

&lt;p&gt;This is an example of a Coverage report showing no active Savings plan. It has yet to be activated.&lt;/p&gt;

&lt;figure class=&quot;post-figure&quot;&gt;
  &lt;img src=&quot;/assets/images/posts/the-most-flexible-aws-savings-plan/0_JKO2iox2GVks_pJ0.png&quot; width=&quot;1024&quot; height=&quot;215&quot; alt=&quot;AWS Coverage report screenshot made by the author.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
  &lt;figcaption&gt;AWS Coverage report screenshot made by the author.&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h4 id=&quot;after-creating-a-savings-plan&quot;&gt;After Creating a Savings Plan&lt;/h4&gt;

&lt;p&gt;This is an example of a Coverage report that shows an active Savings plan with a coverage of 43%&lt;/p&gt;

&lt;figure class=&quot;post-figure&quot;&gt;
  &lt;img src=&quot;/assets/images/posts/the-most-flexible-aws-savings-plan/0_wl5oFMKLOn4OWYLZ.png&quot; width=&quot;1024&quot; height=&quot;215&quot; alt=&quot;AWS Coverage report screenshot made by the author.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
  &lt;figcaption&gt;AWS Coverage report screenshot made by the author.&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;blockquote&gt;
  &lt;p&gt;It is very difficult to get 100% coverage so start with 50% and iterate.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3 id=&quot;do-your-research-first&quot;&gt;Do Your Research First&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/posts/the-most-flexible-aws-savings-plan/due-diligence-illustration.svg&quot; alt=&quot;A four-card checklist — confirm the regional rate, model the hourly commitment, buy small and layer up, and remember you cannot cancel.&quot; /&gt;&lt;/p&gt;

&lt;p&gt;As described above &lt;strong&gt;Compute Savings Plan&lt;/strong&gt; represents a flexible savings plan that supports multiple regions, and services and you commit to a dollar amount instead of an instance type or size. But there are dangers as if you calculate wrong then you are stuck paying that committed dollar amount.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;If you purchase Savings Plans you commit to a certain dollar amount on a period and you can not cancel. Therefore be careful and &lt;strong&gt;do your research first&lt;/strong&gt; before committing to any kind of Savings Plan.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;aside class=&quot;post-cta&quot;&gt;
  &lt;h2 id=&quot;we-could-trim-your-aws-bill&quot;&gt;We Could Trim Your AWS Bill&lt;/h2&gt;

  &lt;p&gt;If your AWS bill is creeping up and nobody is sure which workloads to commit a Savings Plan against, this is the kind of engagement &lt;strong&gt;Clearview Team&lt;/strong&gt; takes on. We model the coverage, stage the purchase, and track utilization so you keep the discount without ever over-committing.&lt;/p&gt;

  &lt;p&gt;&lt;a href=&quot;/work-with-us/&quot;&gt;Scope an engagement →&lt;/a&gt;&lt;/p&gt;
&lt;/aside&gt;
</content>
    <category term="technology" />
    <category term="savings-tips" />
    <category term="cloud-computing" />
    <category term="aws" />
    <category term="internet" />
    <category term="aws-cost-optimization" />
    <category term="aws-devops" />
    
  </entry>
  
  <entry>
    <title>Migrating EC2 to AWS Graviton (ARM): A Cost-Reduction Case Study</title>
    <link href="https://blog.clearview.team/2024/embracing-the-future-of-cloud-computing/" />
    <id>https://blog.clearview.team/2024/embracing-the-future-of-cloud-computing/</id>
    <published>2024-02-11T05:59:43+01:00</published>
    <updated>2024-02-11T05:59:43+01:00</updated>
    <author>
      <name>Nedim Hadzimahmutovic</name>
    </author>
    <summary>How we cut Clearview client EC2 bills by up to 20% by migrating x86 workloads to AWS Graviton (ARM64) — the instance-family swap (M6g, C7gd, R7g), the AMI-selection step in Terraform, and the compatibility checks we ran first.</summary>
    <content type="html">&lt;p&gt;&lt;img src=&quot;/assets/images/posts/embracing-the-future-of-cloud-computing/cover.svg&quot; alt=&quot;Editorial cover — an ARM Graviton processor die with circuit traces, brand-coloured glow, set on a dark Ink backdrop.&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The world of cloud computing is changing fast, that is a fact. Some changes have a more significant impact, as was the case with the rise of AWS Graviton processors.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;The whole tech industry is experiencing the growing adoption of &lt;strong&gt;ARM&lt;/strong&gt; architecture, so why should it not be the case with the Cloud as well?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This article focuses on the impact of AWS Graviton on the Cloud offering, the shift towards the &lt;strong&gt;ARM&lt;/strong&gt; architecture, and how &lt;strong&gt;Clearview&lt;/strong&gt; is helping clients jump on the Graviton train and &lt;strong&gt;save on costs up to 20%&lt;/strong&gt;.&lt;/p&gt;

&lt;h3 id=&quot;key-points-on-aws-graviton&quot;&gt;Key points on AWS Graviton&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;AWS Graviton processors are becoming popular because of their &lt;strong&gt;superior performance&lt;/strong&gt; and &lt;strong&gt;energy efficiency&lt;/strong&gt; in cloud environments which reduces your carbon footprint,&lt;/li&gt;
  &lt;li&gt;Adapting the ARM architecture &lt;strong&gt;requires data migration&lt;/strong&gt; or &lt;strong&gt;possible code improvements&lt;/strong&gt; before benefiting from the superior improvements in both cost and performance.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;the-rise-of-aws-graviton&quot;&gt;The Rise of AWS Graviton&lt;/h3&gt;

&lt;h4 id=&quot;understanding-aws-graviton-processors&quot;&gt;Understanding AWS Graviton Processors&lt;/h4&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/posts/embracing-the-future-of-cloud-computing/processors.svg&quot; alt=&quot;An ARM Graviton die at the centre with three benefit callouts radiating outward: performance, cost-effectiveness, energy efficiency.&quot; /&gt;&lt;/p&gt;

&lt;p&gt;AWS Graviton processors are powered by &lt;strong&gt;ARM&lt;/strong&gt; architecture, enabling performance and cost optimizations, which represent a significant advancement in cloud computing, compared to traditional x86 processors.&lt;/p&gt;

&lt;p&gt;Graviton processors are optimized for Cloud workloads with the following benefits:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Large L1 and L2 &lt;strong&gt;caches for every virtual central processing unit&lt;/strong&gt; (vCPU), meaning that most of your workload never burdens RAM,&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Every virtual CPU is a physical core&lt;/strong&gt;, meaning more isolation between virtual CPUs,&lt;/li&gt;
  &lt;li&gt;Cores are &lt;strong&gt;connected in a fast mesh&lt;/strong&gt; with ~2TB/s of bisection bandwidth, which allows applications to move very quickly from core to core,&lt;/li&gt;
  &lt;li&gt;Graviton’s RAM architecture means &lt;strong&gt;you don’t need to worry about application memory allocation&lt;/strong&gt;, or &lt;strong&gt;which cores are running the application&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;generations-of-aws-graviton&quot;&gt;Generations of AWS Graviton&lt;/h3&gt;

&lt;p&gt;Graviton processors come in &lt;strong&gt;various generations&lt;/strong&gt; with each generation offering various advances in processing power and efficiency.&lt;/p&gt;

&lt;h4 id=&quot;graviton&quot;&gt;Graviton&lt;/h4&gt;

&lt;p&gt;The &lt;strong&gt;first generation&lt;/strong&gt; ARM architecture-based, known as A1 type, Graviton-powered EC2 instances were launched in 2018. Not every region is still providing this first-generation instance type. Use the following awscli command to check if a region supports the A1 instance type.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;aws ec2 describe-instance-type-offerings &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--location-type&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;availability-zone&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--filters&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;location,Values&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;us-east-2a &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--region&lt;/span&gt; us-east-2 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--query&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;InstanceTypeOfferings[*].[InstanceType]&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--output&lt;/span&gt; text &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--profile&lt;/span&gt; default | &lt;span class=&quot;nb&quot;&gt;sort&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep &lt;/span&gt;a1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This processor features:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;64-bit ARM Neoverse cores,&lt;/li&gt;
  &lt;li&gt;The instances are up to 40% less expensive than the same number of vCPUs and DRAM available in other instance types.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;graviton-2&quot;&gt;Graviton 2&lt;/h4&gt;

&lt;p&gt;Launched in 2019 it represents the &lt;strong&gt;second generation&lt;/strong&gt; of AWS Graviton processes. Graviton2-based instance types offer up to 40% better price performance than fifth-generation instances.&lt;/p&gt;

&lt;h4 id=&quot;graviton-2-instance-types&quot;&gt;Graviton 2 Instance types&lt;/h4&gt;

&lt;p&gt;We now have 12 instance families (M6g, M6gd, C6g, C6gd, C6gn, R6g, R6gd, T4g, X2gd, Im4gn, Is4gen, and G5g) that are powered by AWS Graviton2 processors that provide significant price performance benefits for a wide range of workloads.&lt;/p&gt;

&lt;h4 id=&quot;graviton-3&quot;&gt;Graviton 3&lt;/h4&gt;

&lt;p&gt;Launched in 2022, it is the &lt;strong&gt;third and latest generation&lt;/strong&gt; that is generally available. When compared to AWS Graviton2 processors it provides:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;up to &lt;strong&gt;25% better computing&lt;/strong&gt; performance,&lt;/li&gt;
  &lt;li&gt;up to 2x better floating-point performance,&lt;/li&gt;
  &lt;li&gt;up to 2x faster crypto performance, and&lt;/li&gt;
  &lt;li&gt;up to 3x better ML performance,&lt;/li&gt;
  &lt;li&gt;support for bfloat16,&lt;/li&gt;
  &lt;li&gt;and features the latest DDR5 memory, which provides 50% more memory bandwidth compared to DDR4.&lt;/li&gt;
  &lt;li&gt;up to &lt;strong&gt;60% less energy usage&lt;/strong&gt; for the same performance than comparable EC2 instances.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;graviton-3-instance-types&quot;&gt;Graviton 3 instance types&lt;/h4&gt;

&lt;p&gt;All 7th generation instance types containing “g” means it is based on AWS Graviton 3, the silicon designed by AWS. Examples:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;C7g, C7gd, C7gn:&lt;/strong&gt; the “C” instance family is designed for compute-intensive workloads,&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;M7g&lt;/strong&gt;, &lt;strong&gt;M7gd&lt;/strong&gt;: “G” instance family is designed for general-purpose workloads with balanced computing, memory, and networking,&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;R7g, R7gd&lt;/strong&gt;: The “R” instance family is designed for memory-intensive workloads.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;graviton-4&quot;&gt;Graviton 4&lt;/h4&gt;

&lt;p&gt;Launched in late November 2023 Graviton 4 represents the &lt;strong&gt;fourth generation&lt;/strong&gt; and it is &lt;strong&gt;still in preview only&lt;/strong&gt;, with general availability planned in Q1 of 2024. When compared to Graviton3 processors it provides:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;up to &lt;strong&gt;30% better&lt;/strong&gt; computing performance,&lt;/li&gt;
  &lt;li&gt;50% more cores,&lt;/li&gt;
  &lt;li&gt;75% more memory bandwidth.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Graviton4 will be available in memory-optimized Amazon EC2 R8g instances, which are currently in preview only. R8g instances offer larger instance sizes with up to 3x more vCPUs and 3x more memory than current generation R7g instances. To learn more about Graviton4-based R8g instances, visit this &lt;a href=&quot;https://aws.amazon.com/ec2/instance-types/r8g/&quot;&gt;link&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;switch-your-aws-services-to-graviton&quot;&gt;Switch your AWS Services to Graviton&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/posts/embracing-the-future-of-cloud-computing/migration.svg&quot; alt=&quot;Three migration rows from x86 to Graviton — EC2 m5 → m7g, RDS db.m5 → db.m7g, ElastiCache cache.m5 → cache.m7g.&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Here we will describe which services we have switched over to AWS Graviton.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Some services can be switched with a few clicks, while others require a full data migration following best practices.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4 id=&quot;aws-ec2&quot;&gt;AWS EC2&lt;/h4&gt;

&lt;p&gt;Following is a tutorial on how we switched &lt;strong&gt;EC2&lt;/strong&gt; instances. Please note that t4g is run on &lt;strong&gt;Graviton 2&lt;/strong&gt;. Migrating our NodeJScode to be compatible with &lt;strong&gt;ARM&lt;/strong&gt; architecture meant upgrading a few packages only.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Note: do not forget to set your awscli profile as in all of these examples the default one is used.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4 id=&quot;find-arm-lts-ubuntu-images&quot;&gt;Find ARM LTS Ubuntu Images&lt;/h4&gt;

&lt;p&gt;For the latest LTS which is 22.04 LTS (Jammy Jellyfish), currently.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;aws ec2 describe-images &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--filters&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Name=name,Values=ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-arm64-server-*&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Name=architecture,Values=arm64&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--query&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;sort_by(Images, &amp;amp;CreationDate)[].[Name, ImageId, Architecture]&quot;&lt;/span&gt;  &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--output&lt;/span&gt; text &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--region&lt;/span&gt; us-east-1 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--profile&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;default
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This command will show you the IDs of the images that support the ARM architecture. Choose one and set it at the next step.&lt;/p&gt;

&lt;h4 id=&quot;set-ami-id&quot;&gt;Set AMI ID&lt;/h4&gt;

&lt;p&gt;As the AMI ID has been found in the previous command, we need to save it to a variable.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;AMI_ID=ami-02ddaf75821f25213
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;list-ec2-key-pairs&quot;&gt;List EC2 Key Pairs&lt;/h4&gt;

&lt;p&gt;The following commands will show keys that were added previously. If you get an empty result you need to add your public SSH key.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;aws ec2 describe-key-pairs &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--region&lt;/span&gt; us-east-1 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--profile&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;default
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;find-the-availability-zone&quot;&gt;Find the Availability Zone&lt;/h4&gt;

&lt;p&gt;The zone is directly connected to the subnet.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;aws ec2 describe-instance-type-offerings &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;--location-type&lt;/span&gt; availability-zone &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--filters&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;instance-type,Values&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;t4g.small &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--region&lt;/span&gt; us-east-1 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--profile&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;default
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;Note: This step is very important as you need to find the what availability zone supports your instance size.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4 id=&quot;find-the-subnet-and-security-group&quot;&gt;Find the Subnet and Security Group&lt;/h4&gt;

&lt;p&gt;We need to find the correct Subnet and SG.&lt;/p&gt;

&lt;h4 id=&quot;list-security-groups&quot;&gt;List Security Groups&lt;/h4&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;aws ec2 describe-security-groups &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--query&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;SecurityGroups[*].{Name:GroupName,ID:GroupId}&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--region&lt;/span&gt; us-east-1 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--profile&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;default
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;list-subnets&quot;&gt;List subnets&lt;/h4&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;aws ec2 describe-subnets &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--region&lt;/span&gt; us-east-1 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--profile&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;default
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;Note: Find the correct subnet that is used by your old EC2 instance.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4 id=&quot;create-the-ec2-instance&quot;&gt;Create the EC2 Instance&lt;/h4&gt;

&lt;p&gt;Please note that the following command is an example only and that you need to change the values for:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;the key name,&lt;/li&gt;
  &lt;li&gt;the subnet ID,&lt;/li&gt;
  &lt;li&gt;the security group ID,&lt;/li&gt;
  &lt;li&gt;set your tags,&lt;/li&gt;
  &lt;li&gt;use your profile name.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;aws ec2 run-instances &lt;span class=&quot;nt&quot;&gt;--image-id&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$AMI_ID&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--instance-type&lt;/span&gt; t4g.small  &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--key-name&lt;/span&gt; nedim &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--subnet-id&lt;/span&gt; subnet-000000000000000 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--security-group-ids&lt;/span&gt; sg-00000000000000000 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--associate-public-ip-address&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--tag-specifications&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;ResourceType=instance,Tags=[{Key=Name,Value=ubuntu-test-graviton}]&apos;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--region&lt;/span&gt; us-east-1 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--profile&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;default
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;prepare-the-image&quot;&gt;Prepare the image&lt;/h4&gt;

&lt;p&gt;Connect to the VM, and run the system upgrade.&lt;/p&gt;

&lt;h4 id=&quot;new-server-configuration-with-ansible&quot;&gt;New Server Configuration with Ansible&lt;/h4&gt;

&lt;p&gt;Since we used Ansible to set up the old server the process of setting up an identically configured server was a piece of cake. All we had to do was change the hostname in the host inventory file add the new server and rerun the playbooks.&lt;/p&gt;

&lt;h4 id=&quot;volume-size&quot;&gt;Volume size&lt;/h4&gt;

&lt;p&gt;Make sure the new disk volume is identical to the size of the old server’s disk volume as we will copy over data from the old server to the new one.&lt;/p&gt;

&lt;h4 id=&quot;data-migration&quot;&gt;Data Migration&lt;/h4&gt;

&lt;p&gt;Using RSYNC, copy over the data from the old server to the new Graviton-based one, using the SSH protocol.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;rsync -avz -e ssh /var/www/ root@enew-server.compute-1.amazonaws.com:/var/www/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;Note: This data migration does not guarantee that the code will work 100%, you will need to deploy and build the code again to be sure it works as expected. In our case, we needed to upgrade several NodeJS packages.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3 id=&quot;aws-rds&quot;&gt;AWS RDS&lt;/h3&gt;

&lt;p&gt;With RDS instances no migration is necessary and you can take the easy way of just modifying the instance class of your instances if your database engine version supports it.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Determine if the current database version meets the minimum required version for moving to Graviton2.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Version supporting Graviton:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;MySQL&lt;/strong&gt;: 8.0.17 and higher,&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;PostgreSQL&lt;/strong&gt;: 12.3, 13 and higher,&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;MariaDB&lt;/strong&gt;: 10.4.13, 10.5 and higher.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If your RDS instance isn’t at a version supported by Graviton2, you need to upgrade to a supported version.&lt;/p&gt;

&lt;h3 id=&quot;aws-elasticache-for-redis&quot;&gt;AWS ElastiCache for Redis&lt;/h3&gt;

&lt;p&gt;Migrating Amazon Elasticache for Redis and Memcached to Graviton2-based instances offers a &lt;strong&gt;smooth transition&lt;/strong&gt;, only a change of instance type is required, with a performance improvement of up to 45%, all at a 20% lower cost compared to similar x86-based instances.&lt;/p&gt;

&lt;h3 id=&quot;the-beginning-of-a-new-age-in-cloud-computing&quot;&gt;The Beginning of a New Age in Cloud Computing&lt;/h3&gt;

&lt;p&gt;In conclusion, the rise of &lt;strong&gt;AWS Graviton&lt;/strong&gt; and &lt;strong&gt;ARM&lt;/strong&gt; architecture represents a change in cloud computing that impacts the whole IT industry. These technologies bring together &lt;strong&gt;improved performance&lt;/strong&gt;, &lt;strong&gt;cost-effectiveness&lt;/strong&gt;, and &lt;strong&gt;energy efficiency&lt;/strong&gt;. As more organizations adopt these technologies, we can expect a future where the flexibility of &lt;strong&gt;ARM&lt;/strong&gt; &lt;strong&gt;architecture&lt;/strong&gt; and the efficiency of &lt;strong&gt;Graviton&lt;/strong&gt; processors set the &lt;strong&gt;standard for cloud infrastructure&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Therefore, do not miss the chance to make the switch and be part of the new standard.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;aside class=&quot;post-cta&quot;&gt;
  &lt;h2 id=&quot;we-could-migrate-you&quot;&gt;We Could Migrate You&lt;/h2&gt;

  &lt;p&gt;If you are running EC2 workloads on x86 and the bill is starting to bite, this is the kind of engagement &lt;strong&gt;Clearview Team&lt;/strong&gt; takes on. We benchmark your workload on Graviton, plan the migration around your release cadence, and ship the Terraform that keeps you on ARM.&lt;/p&gt;

  &lt;p&gt;&lt;a href=&quot;/work-with-us/&quot;&gt;Scope an engagement →&lt;/a&gt;&lt;/p&gt;
&lt;/aside&gt;
</content>
    <category term="aws-cost-optimization" />
    <category term="cloud-computing" />
    <category term="arm" />
    <category term="aws-graviton" />
    <category term="aws" />
    <category term="aws-devops" />
    
  </entry>
  
  <entry>
    <title>AWS Budgets and Alerts with Terraform: A Cost-Monitoring Case Study</title>
    <link href="https://blog.clearview.team/2024/before-setting-up-your-next-cloud-project-do-not-forget-to-set-the-budgets-and-alerts/" />
    <id>https://blog.clearview.team/2024/before-setting-up-your-next-cloud-project-do-not-forget-to-set-the-budgets-and-alerts/</id>
    <published>2024-01-03T13:47:03+01:00</published>
    <updated>2026-08-11T00:00:00+02:00</updated>
    <author>
      <name>Nedim Hadzimahmutovic</name>
    </author>
    <summary>How we set AWS budgets and Slack alerts with Terraform — the `aws_budgets_budget` notification block, its `subscriber_email_addresses`, and how to route a real breach into SNS before the invoice hits the CFO&apos;s inbox.</summary>
    <content type="html">&lt;h3 id=&quot;monitor-and-control-amazon-cloud-costs-with-terraform&quot;&gt;Monitor and Control Amazon Cloud Costs with Terraform&lt;/h3&gt;

&lt;h4 id=&quot;for-every-cloud-project-you-need-to-set-budgets-and-alerts-with-terraform&quot;&gt;For every Cloud project, you need to set budgets and alerts with Terraform&lt;/h4&gt;

&lt;figure class=&quot;post-figure&quot;&gt;
  &lt;img src=&quot;/assets/images/posts/before-setting-up-your-next-cloud-project-do-not-forget-to-set-the-budgets-and-alerts/cover.svg&quot; width=&quot;1600&quot; height=&quot;900&quot; alt=&quot;AWS Budgets with Terraform — descending cost line with budget cap and alert dot&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
  &lt;figcaption&gt;AWS Budgets with Terraform&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h3 id=&quot;why-set-up-a-budget-for-your-cloud-account&quot;&gt;Why set up a budget for your cloud account?&lt;/h3&gt;

&lt;p&gt;If you wonder why most startups fail it is simple, they run out of money and there have been many horror stories about crazy big cloud bills.&lt;/p&gt;

&lt;p&gt;At &lt;a href=&quot;https://clearview.team/&quot;&gt;&lt;strong&gt;&lt;em&gt;Clearview&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;, when we put a new client on the Cloud, we know they will get a bill eventually. It’s our responsibility to make sure that the bill will not be a big and sudden surprise.&lt;/p&gt;

&lt;h3 id=&quot;setting-up-the-budgets&quot;&gt;Setting up the budgets&lt;/h3&gt;

&lt;figure class=&quot;post-figure&quot;&gt;
  &lt;img src=&quot;/assets/images/posts/before-setting-up-your-next-cloud-project-do-not-forget-to-set-the-budgets-and-alerts/setting-up.svg&quot; width=&quot;1200&quot; height=&quot;420&quot; alt=&quot;Four required pieces of an AWS budget — name, limit amount, period, alert threshold&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
  &lt;figcaption&gt;Setting the AWS Cloud budget&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;The first step is to set budgets and alerts. We usually set:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;The Account wide budget,&lt;/li&gt;
  &lt;li&gt;The Most used service budget,&lt;/li&gt;
  &lt;li&gt;The Most important tag budget.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every budget sends out an email notification when the budget cost threshold is reached, in these two cases:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;The ACTUAL cost&lt;/strong&gt;
which will be triggered once that amount has already been spent,&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;The FORECASTED cost&lt;/strong&gt;
notification will be triggered earlier as the cost is based on prediction based on your past usage.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As we are a tech company the budgets are set using &lt;strong&gt;Terraform&lt;/strong&gt; and in the next section, you can find diagrams and code samples that explain how budgets and notifications work.&lt;/p&gt;

&lt;h3 id=&quot;monthly-account-budget&quot;&gt;Monthly Account Budget&lt;/h3&gt;

&lt;figure class=&quot;post-figure&quot;&gt;
  &lt;img src=&quot;/assets/images/posts/before-setting-up-your-next-cloud-project-do-not-forget-to-set-the-budgets-and-alerts/monthly-cap.svg&quot; width=&quot;1200&quot; height=&quot;420&quot; alt=&quot;Monthly account budget with three alert thresholds at 50, 80, and 100 percent&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
  &lt;figcaption&gt;Set your Monthly AWS Budget.&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;This budget tracks account-wide costs.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/posts/before-setting-up-your-next-cloud-project-do-not-forget-to-set-the-budgets-and-alerts/1_DjYvXzclbSKPmda0FHPUWQ.png&quot; alt=&quot;AWS budget configuration diagram&quot; /&gt;&lt;/p&gt;

&lt;div class=&quot;language-hcl highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nx&quot;&gt;resource&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;aws_budgets_budget&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;monthly_account_budget&quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;name&lt;/span&gt;         &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Monthly Budget for my Account&quot;&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;budget_type&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;COST&quot;&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;limit_amount&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;500&quot;&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;limit_unit&lt;/span&gt;   &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;USD&quot;&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;time_unit&lt;/span&gt;    &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;MONTHLY&quot;&lt;/span&gt;

  &lt;span class=&quot;nx&quot;&gt;notification&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;comparison_operator&lt;/span&gt;        &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;GREATER_THAN&quot;&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;threshold&lt;/span&gt;                  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;90&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;threshold_type&lt;/span&gt;             &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;PERCENTAGE&quot;&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;notification_type&lt;/span&gt;          &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;ACTUAL&quot;&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;subscriber_email_addresses&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;email@my.team&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

  &lt;span class=&quot;nx&quot;&gt;notification&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;comparison_operator&lt;/span&gt;        &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;GREATER_THAN&quot;&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;threshold&lt;/span&gt;                  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;threshold_type&lt;/span&gt;             &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;PERCENTAGE&quot;&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;notification_type&lt;/span&gt;          &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;FORECASTED&quot;&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;subscriber_email_addresses&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;email@my.team&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/clearview/aws_budgets_notifications_with_terraform/blob/0b8af27933b32c27c7b09c4b633724ed17fe82b9/monthly_account_budget.tf#L1-L23&quot;&gt;aws_budgets_notifications_with_terraform/monthly_account_budget.tf at 0b8af27933b32c27c7b09c4b633724ed17fe82b9 · clearview/aws_budgets_notifications_with_terraform&lt;/a&gt;&lt;/p&gt;

&lt;h4 id=&quot;the-notification-block-arguments&quot;&gt;The notification block arguments&lt;/h4&gt;

&lt;p&gt;Each &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;notification&lt;/code&gt; block inside &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;aws_budgets_budget&lt;/code&gt; controls one
alert. The five arguments the AWS provider expects are:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;comparison_operator&lt;/code&gt;&lt;/strong&gt; — one of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;GREATER_THAN&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LESS_THAN&lt;/code&gt;, or
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;EQUAL_TO&lt;/code&gt;. For a spend budget you almost always use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;GREATER_THAN&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;threshold&lt;/code&gt;&lt;/strong&gt; — a number. Compared against the budgeted amount.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;threshold_type&lt;/code&gt;&lt;/strong&gt; — &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PERCENTAGE&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ABSOLUTE_VALUE&lt;/code&gt;. Percentage
is easier to reason about because you don&apos;t have to rewrite the
block when the budget limit changes.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;notification_type&lt;/code&gt;&lt;/strong&gt; — &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ACTUAL&lt;/code&gt; (the current spend) or
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;FORECASTED&lt;/code&gt; (AWS&apos;s prediction based on past usage). Set one of
each per budget so you get both an early warning and a real breach
alert.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;subscriber_email_addresses&lt;/code&gt;&lt;/strong&gt; — a &lt;strong&gt;list of email strings&lt;/strong&gt;.
This is where the alert lands. Every address in the list receives
a copy. Note: it is a Terraform list, not a comma-separated
string, so use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;[&quot;a@x&quot;, &quot;b@x&quot;]&lt;/code&gt; shape not &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&quot;a@x, b@x&quot;&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are two adjacent arguments that this example does not use but
you might reach for:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;subscriber_sns_topic_arns&lt;/code&gt;&lt;/strong&gt; — send the notification to an SNS
topic instead of (or in addition to) email. Useful when you want
the alert to fan out into Slack via an SNS→Lambda hop.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;subscriber_type&lt;/code&gt;&lt;/strong&gt; on the older &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;notification&lt;/code&gt; shape has been
replaced by the three &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;subscriber_*&lt;/code&gt; list arguments; you should
not need it on modern provider versions (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;hashicorp/aws &amp;gt;= 4.0&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Full provider docs: &lt;a href=&quot;https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/budgets_budget#notification&quot;&gt;aws_budgets_budget#notification&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;budgets-by-service&quot;&gt;Budgets by Service&lt;/h3&gt;

&lt;figure class=&quot;post-figure&quot;&gt;
  &lt;img src=&quot;/assets/images/posts/before-setting-up-your-next-cloud-project-do-not-forget-to-set-the-budgets-and-alerts/by-service.svg&quot; width=&quot;1200&quot; height=&quot;420&quot; alt=&quot;Budgets scoped per AWS service — EC2, S3, RDS, AppRunner&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
  &lt;figcaption&gt;AWS Budgets illustration.&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h4 id=&quot;ec2-monthly-budget&quot;&gt;EC2 Monthly Budget&lt;/h4&gt;

&lt;p&gt;This budget will track costs for EC2 services only.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/posts/before-setting-up-your-next-cloud-project-do-not-forget-to-set-the-budgets-and-alerts/1_nB9REBXD-JJqMweyPN5ReQ.png&quot; alt=&quot;AWS budget configuration diagram&quot; /&gt;&lt;/p&gt;

&lt;div class=&quot;language-hcl highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nx&quot;&gt;resource&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;aws_budgets_budget&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;ec2_monthly_budget&quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;name&lt;/span&gt;         &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;My EC2 Monthly Budget&quot;&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;budget_type&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;COST&quot;&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;limit_amount&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;400&quot;&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;limit_unit&lt;/span&gt;   &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;USD&quot;&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;time_unit&lt;/span&gt;    &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;MONTHLY&quot;&lt;/span&gt;

  &lt;span class=&quot;nx&quot;&gt;cost_filter&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Service&quot;&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;values&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
      &lt;span class=&quot;s2&quot;&gt;&quot;Amazon Elastic Compute Cloud - Compute&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

  &lt;span class=&quot;nx&quot;&gt;notification&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;comparison_operator&lt;/span&gt;        &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;GREATER_THAN&quot;&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;threshold&lt;/span&gt;                  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;90&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;threshold_type&lt;/span&gt;             &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;PERCENTAGE&quot;&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;notification_type&lt;/span&gt;          &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;ACTUAL&quot;&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;subscriber_email_addresses&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;email@my.team&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

  &lt;span class=&quot;nx&quot;&gt;notification&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;comparison_operator&lt;/span&gt;        &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;GREATER_THAN&quot;&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;threshold&lt;/span&gt;                  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;threshold_type&lt;/span&gt;             &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;PERCENTAGE&quot;&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;notification_type&lt;/span&gt;          &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;FORECASTED&quot;&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;subscriber_email_addresses&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;email@my.team&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/clearview/aws_budgets_notifications_with_terraform/blob/0b8af27933b32c27c7b09c4b633724ed17fe82b9/ec2_monthly_account_budget.tf#L1-L30&quot;&gt;aws_budgets_notifications_with_terraform/ec2_monthly_account_budget.tf at 0b8af27933b32c27c7b09c4b633724ed17fe82b9 · clearview/aws_budgets_notifications_with_terraform&lt;/a&gt;&lt;/p&gt;

&lt;h4 id=&quot;s3-monthly-budget&quot;&gt;S3 Monthly Budget&lt;/h4&gt;

&lt;figure class=&quot;post-figure&quot;&gt;
  &lt;img src=&quot;/assets/images/posts/before-setting-up-your-next-cloud-project-do-not-forget-to-set-the-budgets-and-alerts/s3-budget.svg&quot; width=&quot;1200&quot; height=&quot;380&quot; alt=&quot;S3 monthly budget with usage bar and 75 percent alert marker&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
  &lt;figcaption&gt;AWS S3 Monthly Budget.&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;This budget will track costs for S3 buckets only.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/posts/before-setting-up-your-next-cloud-project-do-not-forget-to-set-the-budgets-and-alerts/1_6k0O3vCONWjcWbY-5mLdIw.png&quot; alt=&quot;AWS budget configuration diagram&quot; /&gt;&lt;/p&gt;

&lt;div class=&quot;language-hcl highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nx&quot;&gt;resource&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;aws_budgets_budget&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;s3_monthly_budget&quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;name&lt;/span&gt;         &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;My S3 Monthly Budget&quot;&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;budget_type&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;COST&quot;&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;limit_amount&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;100&quot;&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;limit_unit&lt;/span&gt;   &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;USD&quot;&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;time_unit&lt;/span&gt;    &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;MONTHLY&quot;&lt;/span&gt;

  &lt;span class=&quot;nx&quot;&gt;cost_filter&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Service&quot;&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;values&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
      &lt;span class=&quot;s2&quot;&gt;&quot;Amazon Simple Storage Service&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

  &lt;span class=&quot;nx&quot;&gt;notification&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;comparison_operator&lt;/span&gt;        &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;GREATER_THAN&quot;&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;threshold&lt;/span&gt;                  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;90&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;threshold_type&lt;/span&gt;             &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;PERCENTAGE&quot;&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;notification_type&lt;/span&gt;          &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;ACTUAL&quot;&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;subscriber_email_addresses&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;email@my.team&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

  &lt;span class=&quot;nx&quot;&gt;notification&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;comparison_operator&lt;/span&gt;        &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;GREATER_THAN&quot;&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;threshold&lt;/span&gt;                  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;110&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;threshold_type&lt;/span&gt;             &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;PERCENTAGE&quot;&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;notification_type&lt;/span&gt;          &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;FORECASTED&quot;&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;subscriber_email_addresses&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;email@my.team&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/clearview/aws_budgets_notifications_with_terraform/blob/0b8af27933b32c27c7b09c4b633724ed17fe82b9/s3_monthly_account_budget.tf#L1-L30&quot;&gt;aws_budgets_notifications_with_terraform/s3_monthly_account_budget.tf at 0b8af27933b32c27c7b09c4b633724ed17fe82b9 · clearview/aws_budgets_notifications_with_terraform&lt;/a&gt;&lt;/p&gt;

&lt;h4 id=&quot;apprunner-monthly-budget&quot;&gt;AppRunner Monthly Budget&lt;/h4&gt;

&lt;p&gt;This budget will track costs for AppRunner services only.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/posts/before-setting-up-your-next-cloud-project-do-not-forget-to-set-the-budgets-and-alerts/1_bhPgTlQFCHCZI_ScAe8BMg.png&quot; alt=&quot;AWS budget configuration diagram&quot; /&gt;&lt;/p&gt;

&lt;div class=&quot;language-hcl highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nx&quot;&gt;resource&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;aws_budgets_budget&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;apprunner_monthly_budget&quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;name&lt;/span&gt;         &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;My AppRunner Monthly Budget&quot;&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;budget_type&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;COST&quot;&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;limit_amount&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;100&quot;&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;limit_unit&lt;/span&gt;   &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;USD&quot;&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;time_unit&lt;/span&gt;    &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;MONTHLY&quot;&lt;/span&gt;

  &lt;span class=&quot;nx&quot;&gt;cost_filter&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Service&quot;&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;values&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
      &lt;span class=&quot;s2&quot;&gt;&quot;AWS App Runner&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

  &lt;span class=&quot;nx&quot;&gt;notification&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;comparison_operator&lt;/span&gt;        &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;GREATER_THAN&quot;&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;threshold&lt;/span&gt;                  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;90&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;threshold_type&lt;/span&gt;             &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;PERCENTAGE&quot;&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;notification_type&lt;/span&gt;          &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;ACTUAL&quot;&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;subscriber_email_addresses&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;email@my.team&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

  &lt;span class=&quot;nx&quot;&gt;notification&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;comparison_operator&lt;/span&gt;        &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;GREATER_THAN&quot;&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;threshold&lt;/span&gt;                  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;110&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;threshold_type&lt;/span&gt;             &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;PERCENTAGE&quot;&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;notification_type&lt;/span&gt;          &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;FORECASTED&quot;&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;subscriber_email_addresses&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;email@my.team&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/clearview/aws_budgets_notifications_with_terraform/blob/0b8af27933b32c27c7b09c4b633724ed17fe82b9/apprunner_monthly_account_budget.tf#L1-L30&quot;&gt;aws_budgets_notifications_with_terraform/apprunner_monthly_account_budget.tf at 0b8af27933b32c27c7b09c4b633724ed17fe82b9 · clearview/aws_budgets_notifications_with_terraform&lt;/a&gt;&lt;/p&gt;

&lt;h3 id=&quot;budgets-based-on-tag-filtering&quot;&gt;Budgets based on tag filtering&lt;/h3&gt;

&lt;h4 id=&quot;production-tag-monthly-budget&quot;&gt;Production Tag Monthly Budget&lt;/h4&gt;

&lt;p&gt;This budget will group multiple types of service based on the tag, in this case, the production tag is used.&lt;/p&gt;

&lt;figure class=&quot;post-figure&quot;&gt;
  &lt;img src=&quot;/assets/images/posts/before-setting-up-your-next-cloud-project-do-not-forget-to-set-the-budgets-and-alerts/1_DpawlPqyEVxauvxdWVgT8w.png&quot; width=&quot;1024&quot; height=&quot;585&quot; alt=&quot;Terraform configuration for a production-tag monthly AWS budget&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
  &lt;figcaption&gt;&lt;a href=&quot;https://github.com/clearview/aws_budgets_notifications_with_terraform/blob/0b8af27933b32c27c7b09c4b633724ed17fe82b9/production_tag_monthly_budget.tf#L1-L36&quot;&gt;production_tag_monthly_budget.tf on GitHub&lt;/a&gt;&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h3 id=&quot;links&quot;&gt;Links&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/clearview/aws_budgets_notifications_with_terraform&quot;&gt;GitHub repo&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;closing&quot;&gt;Closing&lt;/h3&gt;

&lt;p&gt;This article explained the importance of setting a cloud budget and then demonstrated how to do it programmatically. Not only that, we went a step further and created nice diagrams for each budget so that it is easier for every reader to imagine the setup.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;We hope this article finds its way and helps you avoid unnecessary cloud costs.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;aside class=&quot;post-cta&quot;&gt;
  &lt;h2 id=&quot;we-could-set-this-up-for-your-team&quot;&gt;We Could Set This Up For Your Team&lt;/h2&gt;

  &lt;p&gt;If you are starting a new cloud project — or running one without budgets and alerts — this is the kind of engagement &lt;strong&gt;Clearview Team&lt;/strong&gt; takes on. We wire the budgets, the Slack alerts, and the Terraform that keeps every account on a leash, before the surprise invoice arrives.&lt;/p&gt;

  &lt;p&gt;&lt;a href=&quot;/work-with-us/&quot;&gt;Scope an engagement →&lt;/a&gt;&lt;/p&gt;
&lt;/aside&gt;
</content>
    <category term="budget" />
    <category term="cloud-computing" />
    <category term="cloud-services" />
    <category term="alerts" />
    <category term="cloud" />
    <category term="aws-cost-optimization" />
    <category term="aws-devops" />
    
  </entry>
  
</feed>
