<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Walid BATTOU</title>
    <description>The latest articles on DEV Community by Walid BATTOU (@wbattou).</description>
    <link>https://dev.to/wbattou</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F956641%2F8bfd3469-e299-4132-a538-4fc99892bb66.jpg</url>
      <title>DEV Community: Walid BATTOU</title>
      <link>https://dev.to/wbattou</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/wbattou"/>
    <language>en</language>
    <item>
      <title>The Hidden Cost of Paying Twice for Inter-AZ Network Traffic in AWS</title>
      <dc:creator>Walid BATTOU</dc:creator>
      <pubDate>Mon, 25 Nov 2024 00:49:16 +0000</pubDate>
      <link>https://dev.to/aws-builders/aws-the-hidden-cost-of-network-traffic-hln</link>
      <guid>https://dev.to/aws-builders/aws-the-hidden-cost-of-network-traffic-hln</guid>
      <description>&lt;p&gt;Today, it's well known that network cost on AWS can be very expensive.&lt;/p&gt;

&lt;p&gt;I would like to explain the hidden cost of Inter-AZs network traffic when an AWS managed service (EC2) communicates with other AWS services like FSx, Amazon MQ, Load Balancer and Fargate.&lt;/p&gt;

&lt;p&gt;We have several categories of network costs. This article will not duplicate content from existing articles like below:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/blogs/architecture/overview-of-data-transfer-costs-for-common-architectures/" rel="noopener noreferrer"&gt;Overview of Data Transfer Costs for Common Architectures&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/blogs/networking-and-content-delivery/understand-aws-data-transfer-details-in-depth-from-cost-and-usage-report-using-athena-query-and-quicksight/" rel="noopener noreferrer"&gt;Understand AWS Data transfer details in depth from cost and usage report using Athena query and QuickSight&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Starting with Cost Explorer
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;How to check the cost of network traffic between Availability Zones?!&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Filter by "API operation": InterZone-In and InterZone-Out
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqrqi6y4t02g7s43j9yv4.png" alt="InterZone-In" width="800" height="220"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you group by Service, these operations will be under "EC2-Other".&lt;br&gt;
If you group by Usage type, these operations will be under "&lt;em&gt;Region&lt;/em&gt;-DataTransfer-Regional-Bytes".&lt;/p&gt;

&lt;p&gt;Most of your Inter-AZs traffic related to EC2 instances appears under the EC2-Other service category.&lt;/p&gt;

&lt;p&gt;Let's filter by this Usage type:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Filter by "&lt;em&gt;Region&lt;/em&gt;-DataTransfer-Regional-Bytes"&lt;/li&gt;
&lt;li&gt;Group by "Service"
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fem4kroxrj06t6ygh14pe.png" alt="DataTransfer-Regional-Bytes" width="408" height="1140"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What we can observe?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The "API operation" InterZone-In, InterZone-Out are under the service "EC2-Other" only and the Usage type "&lt;em&gt;Region&lt;/em&gt;-DataTransfer-Regional-Bytes".&lt;/li&gt;
&lt;li&gt;Under the Usage type "&lt;em&gt;Region&lt;/em&gt;-DataTransfer-Regional-Bytes" we can have a lot of services, but what we have behind it?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Let's take an example with FSx&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Filter by "&lt;em&gt;Region&lt;/em&gt;-DataTransfer-Regional-Bytes"&lt;/li&gt;
&lt;li&gt;Filter by Service "FSx"&lt;/li&gt;
&lt;li&gt;Group by "API Operation"
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8h5czjihvxcg0prny6wk.png" alt="CreateFileSystem" width="342" height="408"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
For the FSx service, we are paying for the Usage type named ""&lt;em&gt;Region&lt;/em&gt;-DataTransfer-Regional-Bytes" identified with the "API operation" "CreateFileSystem:Lustre". With Cost Explorer, we are not able to know if this traffic is related to Inter AZs, traffic Out of AWS, Inter Regions or other. We need to use the CUR(Cost &amp;amp; Usage Report) to understand what we have behind it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deep Dive into the CUR (CUDOS dashboard version 5.4)
&lt;/h2&gt;

&lt;p&gt;If you're working on AWS and not aware of CUDOS and other dashboards provided by AWS, check this &lt;a href="https://catalog.workshops.aws/awscid/en-US" rel="noopener noreferrer"&gt;link&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let's check the tab "Data Transfer &amp;amp; Networking"&lt;/strong&gt;&lt;br&gt;
On this tab, we have multiple choice to dig into the detail related to network cost. I checked the box "Inter AZ":&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdfjdlxlkxwweztcpuj20.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdfjdlxlkxwweztcpuj20.png" alt="CUDOS" width="420" height="564"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For clarity, I've added a column description to the 'Data Transfer Details Usage and Cost' visualization.&lt;/p&gt;

&lt;p&gt;We find for FSx what we found in Cost Explorer:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy3bmmunxnpo790ni0meg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy3bmmunxnpo790ni0meg.png" alt="Cost explorer" width="800" height="18"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The description clarifies that with FSx, we need to pay for Inter-AZs network traffic between FSx and:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;EC2&lt;/li&gt;
&lt;li&gt;an EIP (Elastic IP)&lt;/li&gt;
&lt;li&gt;a Load Balancer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For my example, we need to pay &lt;strong&gt;twice&lt;/strong&gt; the Inter AZs network traffic between an EC2 and a file system on FSx:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbopod3h00q7ajn25cavs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbopod3h00q7ajn25cavs.png" alt="Diagram" width="800" height="489"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;My first question when I discovered that was:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Is it mentioned in the AWS documentation?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The answer is yes for &lt;a href="https://aws.amazon.com/fsx/windows/pricing/" rel="noopener noreferrer"&gt;FSx&lt;/a&gt; but sometimes not clear for other services like &lt;a href="https://aws.amazon.com/fargate/pricing/" rel="noopener noreferrer"&gt;Fargate&lt;/a&gt;.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fygn1fe019y80swuwyqrd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fygn1fe019y80swuwyqrd.png" alt="Fargate" width="800" height="163"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The description in the CUR is the same one for any managed services with inter AZs traffic:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1rowxr3qleupjfvk5dpl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1rowxr3qleupjfvk5dpl.png" alt="Data Transfer Details" width="800" height="382"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Take Away
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Use CUDOS to check your Network Traffic on AWS&lt;/li&gt;
&lt;li&gt;Keep resources within the same AZ (when it's possible)&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>networking</category>
      <category>finops</category>
    </item>
    <item>
      <title>AWS VPC Endpoint is JUST a FinOps topic!?</title>
      <dc:creator>Walid BATTOU</dc:creator>
      <pubDate>Mon, 04 Mar 2024 19:39:31 +0000</pubDate>
      <link>https://dev.to/aws-builders/aws-vpc-endpoint-is-just-a-finops-topic-5fd0</link>
      <guid>https://dev.to/aws-builders/aws-vpc-endpoint-is-just-a-finops-topic-5fd0</guid>
      <description>&lt;p&gt;This article follows up on the previous one, where we attempted to address the following question:&lt;br&gt;
&lt;a href="https://dev.to/aws-builders/aws-vpc-endpoint-is-not-a-security-topic-2mfi"&gt;AWS VPC Endpoint is NOT a security topic!? &lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Clarification about my last article
&lt;/h2&gt;

&lt;p&gt;Even if we demonstrate that the VPC Endpoint is not focused on security or performance because the traffic stays on the AWS backbone. In a real-world use case, we can have compliance requirements.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy7bpujwm7ndsg53hbcrt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy7bpujwm7ndsg53hbcrt.png" alt="Image description" width="800" height="336"&gt;&lt;/a&gt;&lt;br&gt;
If you have compliance requirements such as &lt;a href="https://www.hhs.gov/hipaa/index.html"&gt;HIPPA&lt;/a&gt;(health) or &lt;a href="https://www.pcisecuritystandards.org/"&gt;PCI-DSS&lt;/a&gt;(Bank) it is not feasible to tell the auditor "Hey, do not check the AWS documentation, VPC Endpoint is not about security, I checked it."&lt;/p&gt;

&lt;p&gt;However, if you have no compliance requirements, be frugal! You will have the options described below.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why is it a topic related to cost?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;How VPC endpoints are billed?&lt;/strong&gt;&lt;br&gt;
They are billed based on the elastic network interfaces(ENI) per availability zone behind the endpoint. We can deploy it across 1 to 3 availability zones based on your infrastructure requirements. Of course, it is recommended to have at least two for high availability.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw2ga5lb1ffrjku6h7lxj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw2ga5lb1ffrjku6h7lxj.png" alt="Image description" width="612" height="506"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Split VPC endpoints into two categories!
&lt;/h2&gt;

&lt;p&gt;You will find the &lt;a href="https://docs.aws.amazon.com/vpc/latest/privatelink/aws-services-privatelink-support.html"&gt;list of AWS services&lt;/a&gt; that support VPC endpoints.&lt;/p&gt;

&lt;p&gt;I split this list into two categories:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Endpoints related to an &lt;strong&gt;application&lt;/strong&gt; (eg. API gateway, Athena).&lt;/li&gt;
&lt;li&gt;Endpoints related to the &lt;strong&gt;infrastructure&lt;/strong&gt; (eg. CloudWatch, SSM).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Based on that, we can start with the costs incurred when using or not using an "&lt;strong&gt;infrastructure&lt;/strong&gt;" VPC endpoint like CloudWatch Log for example (price for eu-west-1).&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's focus on the CloudWatchLog VPC Endpoint
&lt;/h2&gt;

&lt;p&gt;Consider a scenario where we have 10 VPCs, each hosting multiple workloads that utilize CloudWatch Logs for application logging. On average, the monthly log volume is 1TB for all of them.&lt;/p&gt;

&lt;p&gt;We have 3 options:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Without VPC endpoint (with NAT Gateway).&lt;/li&gt;
&lt;li&gt;With VPC Endpoint (one per VPC).&lt;/li&gt;
&lt;li&gt;With Centralized VPC Endpoint.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Cost without VPC Endpoint (with NAT Gateway)
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fefw5m4oabnv46zinwtdj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fefw5m4oabnv46zinwtdj.png" alt="Image description" width="800" height="528"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What we pay in this case:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;1TB(DataProcessing per month)*0.048=$48/month&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Total: $48/month&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Cost with VPC Endpoint
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fraly4dyc88rndr1w6qw8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fraly4dyc88rndr1w6qw8.png" alt="Image description" width="800" height="462"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What we pay in this case:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;VPCEndpoint/month for 3 AZs for each VPC:

&lt;ul&gt;
&lt;li&gt;$0.011*730(hours in month)*3=$~24/month&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;VPCEndpoint data processed:

&lt;ul&gt;
&lt;li&gt;$0.01*1000=$10/month&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Total for 10VPCs: (24*10)+10=$250/month&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Cost with Centralized Endpoint
&lt;/h2&gt;

&lt;p&gt;On AWS, we usually have multiple accounts and VPCs. The general practice is to have a network account with a transit gateway in it. For more information, please refer to this &lt;a href="https://docs.aws.amazon.com/whitepapers/latest/building-scalable-secure-multi-vpc-network-infrastructure/transit-gateway.html"&gt;documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpzhssojfxhcq0xg0up14.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpzhssojfxhcq0xg0up14.png" alt="Image description" width="800" height="562"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What we pay in this case:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;VPCEndpoint/month for 3 AZs:

&lt;ul&gt;
&lt;li&gt;$0.011*730(hours in month)*3=$~24/month&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;VPCEndpoint data processed:

&lt;ul&gt;
&lt;li&gt;$0.01*1000=10$/month&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Transit Gateway data processed:

&lt;ul&gt;
&lt;li&gt;$0.02*1000=20$/month&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Total: $54/month&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;With 1TB of data transfer for 10 VPCs. The best scenario is to not use the VPC endpoint and keep using the NAT Gateway.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmidvk84wvzpg7uz7fcjv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmidvk84wvzpg7uz7fcjv.png" alt="Image description" width="800" height="933"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The decision to utilize a VPC endpoint or not varies based on individual use cases. It's essential to evaluate the specific requirements and factors involved.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Make your own calculations!&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  When keeping a NAT Gateway is more cost-effective!?
&lt;/h2&gt;

&lt;p&gt;When does it become more economical to use the centralized solution?&lt;/p&gt;

&lt;p&gt;Based on the previous calculation, the following table shows that above approximately 1.3TB of DataTransfer, the centralized endpoint is more cost-effective. Below this amount, you can continue using the NAT Gateway.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0u88wuu1dnsx3e662t3p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0u88wuu1dnsx3e662t3p.png" alt="Image description" width="800" height="237"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the next article, we will see how to deploy a centralized VPC Endpoint in an air-gapped environment on AWS.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>finops</category>
      <category>security</category>
      <category>networking</category>
    </item>
    <item>
      <title>AWS VPC Endpoint is NOT a security topic!?</title>
      <dc:creator>Walid BATTOU</dc:creator>
      <pubDate>Fri, 16 Feb 2024 20:31:50 +0000</pubDate>
      <link>https://dev.to/aws-builders/aws-vpc-endpoint-is-not-a-security-topic-2mfi</link>
      <guid>https://dev.to/aws-builders/aws-vpc-endpoint-is-not-a-security-topic-2mfi</guid>
      <description>&lt;p&gt;This article demystifies the security and performance implications of using AWS VPC Endpoints.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Spoiler:&lt;/strong&gt; This is not about security for me.&lt;/p&gt;

&lt;p&gt;Indeed, many companies have compliance constraints that mandate the implementation of an &lt;a href="https://en.wikipedia.org/wiki/Air_gap_(networking)"&gt;air-gapped&lt;/a&gt; environment.&lt;/p&gt;

&lt;p&gt;Let's take a closer look at how VPC endpoints work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with official AWS documentation
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;VPC Endpoint definition from AWS&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://docs.aws.amazon.com/whitepapers/latest/aws-privatelink/what-are-vpc-endpoints.html"&gt;VPC Endpoint doc&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftn2hsoguex48eiqcwy82.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftn2hsoguex48eiqcwy82.png" alt="AWS VPC Endpoints security" width="800" height="117"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Takeaways from the docs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Traffic stays on the AWS Network&lt;/li&gt;
&lt;li&gt;Prevent availability risks or bandwidth constraints&lt;/li&gt;
&lt;li&gt;Use AWS PrivateLink&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;AWS PrivateLink&lt;/strong&gt;&lt;br&gt;
If you're looking for VPC endpoints, you quickly come across the concept of AWS PrivateLink.&lt;br&gt;
&lt;a href="https://docs.aws.amazon.com/vpc/latest/privatelink/what-is-privatelink.html"&gt;PrivateLink doc&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frsao4amoq0cxzkzlaz6y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frsao4amoq0cxzkzlaz6y.png" alt="Image description" width="800" height="77"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Do we exit the AWS network without an endpoint?
&lt;/h2&gt;

&lt;p&gt;AWS PrivateLink supports many &lt;a href="https://docs.aws.amazon.com/vpc/latest/privatelink/aws-services-privatelink-support.html"&gt;AWS services&lt;/a&gt;. For this test, we will use &lt;a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/setup-create-vpc.html"&gt;SSM&lt;/a&gt; (System Manager).&lt;/p&gt;

&lt;p&gt;Below are two diagrams showing the difference between having an endpoint and not having one.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F562qn4ijjup5mz3g21uy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F562qn4ijjup5mz3g21uy.png" alt="AWS VPC Endpoints" width="800" height="777"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let's test it with the traceroute command!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Below are the results indicating the hops traversed from an EC2 instance to the SSM endpoint.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fspqpp40fq4cq3fu1h9cc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fspqpp40fq4cq3fu1h9cc.png" alt="Image description" width="800" height="155"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If we analyze the IP addresses of each hop. There is no IP outside of the AWS network. This is why we can conclude that we stay on the AWS network.&lt;/p&gt;

&lt;p&gt;You can check below the reference of the RFC mentioned:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Network class E: &lt;a href="https://www.rfc-editor.org/rfc/rfc1112#section-4"&gt;RFC1112&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;CGNAT Shared Space: &lt;a href="https://datatracker.ietf.org/doc/html/rfc6598"&gt;RFC6598&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This last one is pretty interesting because AWS recommends using it in case of &lt;a href="https://aws.amazon.com/blogs/containers/addressing-ipv4-address-exhaustion-in-amazon-eks-clusters-using-private-nat-gateways/"&gt;IP exhaustion for EKS&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;What is intriguing here is the use of unusual CIDR blocks internally by AWS.&lt;/p&gt;
&lt;h2&gt;
  
  
  Are we experiencing better latency with the endpoint?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;How to test this?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With a bash script of course :)&lt;/p&gt;

&lt;p&gt;The following script measures the average latency of HTTP requests to the SSM endpoint over &lt;strong&gt;30 minutes&lt;/strong&gt;. It records timing metrics for each request and calculates the average latency from the results. Thanks to ChatGPT for the curl options.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;end_time=$((SECONDS+1800)) 
while [ $SECONDS -lt $end_time ]; do
   curl -o /dev/null -s -w 'Connect: %{time_connect} TTFB: %{time_starttransfer} Total time: %{time_total}\n' https://ssm.eu-west-1.amazonaws.com;
   sleep 2; 
done &amp;gt;&amp;gt; output.log
count_lines=$(awk '{print $NF}' output.log | wc -l)
sum_lines=$(awk '{print $NF}' output.log | paste -sd+ - | bc)
average=$(echo "scale=4; $sum_lines / $count_lines" | bc)
echo "Average Latency: $average"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Result&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;WITHOUT&lt;/strong&gt; endpoint --&amp;gt; ~55ms&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;WITH&lt;/strong&gt; endpoint --&amp;gt; ~55ms&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;About bandwidth, based on a real-world use case using Athena with and without an endpoint, the performance remained the same.&lt;/p&gt;

&lt;h2&gt;
  
  
  Observation
&lt;/h2&gt;

&lt;p&gt;Based on these tests we can conclude that network security and performance are the same with and without an endpoint.&lt;/p&gt;

&lt;p&gt;AWS constructed its infrastructure using public DNS, but resolving a public IP doesn't necessarily mean traversing the internet to access it.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Example:&lt;/em&gt;&lt;br&gt;
If you create a private load balancer on AWS, its DNS name is publicly resolvable.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsob3hrgxzf49nm1eok6r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsob3hrgxzf49nm1eok6r.png" alt="Image description" width="800" height="103"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Take Aways
&lt;/h2&gt;

&lt;p&gt;Now, if using an endpoint is not focused on security or performance, which criteria can we rely on?&lt;/p&gt;

&lt;p&gt;Let's delve into this topic in the next article of this series.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>security</category>
      <category>networking</category>
    </item>
    <item>
      <title>Detecting Incomplete AWS s3 Multipart Uploads: Storage Lens vs CUDOS</title>
      <dc:creator>Walid BATTOU</dc:creator>
      <pubDate>Wed, 24 Jan 2024 00:14:59 +0000</pubDate>
      <link>https://dev.to/aws-builders/detecting-incomplete-aws-s3-multipart-uploads-storage-lens-vs-cudos-2hgj</link>
      <guid>https://dev.to/aws-builders/detecting-incomplete-aws-s3-multipart-uploads-storage-lens-vs-cudos-2hgj</guid>
      <description>&lt;p&gt;The goal of this article is to explain the different ways provided by AWS to detect incomplete multipart uploads.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is s3 multipart upload?
&lt;/h2&gt;

&lt;p&gt;For objects bigger than 100MB, AWS provides a feature to chunk an object before uploading it to s3.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foseu197qa8yj3b03k5md.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foseu197qa8yj3b03k5md.png" alt="Image description" width="800" height="452"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is s3 incomplete multipart upload?
&lt;/h2&gt;

&lt;p&gt;An incomplete multipart upload occurs when a user starts uploading a large object using multipart upload but does not finish the process.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4oz39scoahq7aes5bz7n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4oz39scoahq7aes5bz7n.png" alt="Image description" width="800" height="452"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem?
&lt;/h2&gt;

&lt;p&gt;We need to pay for the incomplete parts stored in our s3 buckets.&lt;br&gt;
AWS provides two ways to detect it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage_lens.html"&gt;Storage Lens&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://d1s0yx3p3y3rah.cloudfront.net/anonymous-embed?dashboard=cudos"&gt;CUDOS&lt;/a&gt; dashboard&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  CUDOS
&lt;/h2&gt;

&lt;p&gt;AWS provides CUDOS, a QuickSight dashboard part of the &lt;a href="https://www.wellarchitectedlabs.com/cloud-intelligence-dashboards/"&gt;CID Framework&lt;/a&gt;(Cost Intelligence Dashboards) to dive deep into your cost usage based on the CUR(Cost &amp;amp; Usage Report) data. &lt;/p&gt;

&lt;p&gt;One of the tabs of CUDOS is "Amazon s3". At the bottom of it, we have a view named "Buckets with Incomplete MultiPart Uploads Last 30 Days".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmzuh2ihwq0cokunsk4hh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmzuh2ihwq0cokunsk4hh.png" alt="Image description" width="800" height="336"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The source of this dashboard is the CUR (Cost Usage Report). When I saw this view, I wondered:&lt;br&gt;
&lt;em&gt;&lt;strong&gt;How can we retrieve this information from a cost perspective without access to S3 metrics?&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Let's deep dive into the CUDOS template and what we have behind the view above.&lt;/p&gt;

&lt;p&gt;From the analysis, if you click on the view, we will see the fields used in it.&lt;/p&gt;

&lt;p&gt;Let's check what we have behind the "MPU Request Delta" calculated field.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5y9udk860421s88uxh7k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5y9udk860421s88uxh7k.png" alt="Image description" width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the CUR we have two operations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;InitiateMultipartUpload&lt;/li&gt;
&lt;li&gt;CompleteMultipartUpload&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The people who built this view must have thought like this:&lt;/p&gt;

&lt;p&gt;"We cannot obtain the exact number of gigabytes of lost storage from the CUR. Nevertheless, we can still get an idea if we take the delta between 'Initiate' and 'Complete' requests we will know if some multipart uploads failed."&lt;/p&gt;

&lt;p&gt;To know exactly the amount of gigabytes, we need to go through Storage Lens.&lt;/p&gt;

&lt;h2&gt;
  
  
  Storage Lens
&lt;/h2&gt;

&lt;p&gt;For each of my articles, I tried to not duplicate existing content.&lt;br&gt;
For s3 multipart upload with Storage Lens, you can check this &lt;a href="https://aws.amazon.com/blogs/aws-cloud-financial-management/discovering-and-deleting-incomplete-multipart-uploads-to-lower-amazon-s3-costs/"&gt;blog post&lt;/a&gt; written by AWS employees.&lt;/p&gt;

&lt;p&gt;Key take Aways from it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Delegate Storage Lens administration to a member account in your AWS organization (Audit or Security account).&lt;/li&gt;
&lt;li&gt;Create an organizational dashboard from the member account.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Observation
&lt;/h2&gt;

&lt;p&gt;The default configuration for s3 buckets should include a lifecycle rule to automatically abort old incomplete multipart uploads. It would be good to just have a checkbox to activate it.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>cudos</category>
      <category>finops</category>
      <category>s3</category>
    </item>
    <item>
      <title>Lower your AWS CloudFront Bills with AWS PPA !</title>
      <dc:creator>Walid BATTOU</dc:creator>
      <pubDate>Mon, 15 Jan 2024 21:20:16 +0000</pubDate>
      <link>https://dev.to/aws-builders/lower-your-aws-cloudfront-bills-with-aws-ppa--icl</link>
      <guid>https://dev.to/aws-builders/lower-your-aws-cloudfront-bills-with-aws-ppa--icl</guid>
      <description>&lt;p&gt;AWS PPA (Private Pricing Addendum) is a discounted pricing model for a specific AWS service with high consumption (commitment per year). We are not talking about EDP, Savings plan, this is another discount.&lt;/p&gt;

&lt;p&gt;There is not so much content about AWS PPA. I have practical experience with s3 and CloudFront PPA which is why I wanted to tackle this topic.&lt;/p&gt;

&lt;p&gt;So let's deep dive into AWS PPA for CloudFront.&lt;/p&gt;

&lt;p&gt;I checked the AWS documentation about this topic, and PPA is not mentioned in any of them.&lt;/p&gt;

&lt;p&gt;However, when we are looking at the CloudFront pricing page, the following part corresponds to PPA I think:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcesskcjk9zhgvpzv4m84.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcesskcjk9zhgvpzv4m84.png" alt="Image description" width="800" height="298"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As mentioned below, you can start talking to AWS about PPA when you have 10TB/month for Data Transfer Out to Internet.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgtsz49yfiqhgjg1qjdr9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgtsz49yfiqhgjg1qjdr9.png" alt="Image description" width="800" height="29"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The CloudFront Savings Bundle is another discount program. I won't explain this offer here. &lt;/p&gt;

&lt;h1&gt;
  
  
  What do we need to remember?
&lt;/h1&gt;

&lt;p&gt;It is not possible to combine both PPA and CloudFront Savings Bundle. According to AWS, the PPA is more advantageous than the CloudFront Savings Bundle.&lt;/p&gt;

&lt;h1&gt;
  
  
  How does the Private Pricing Addendum apply to CloudFront?
&lt;/h1&gt;

&lt;p&gt;You will find below to which CloudFront usage type the PPA is applied. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh641yadv5yij92bhs9f0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh641yadv5yij92bhs9f0.png" alt="Image description" width="800" height="238"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;DataTransfer-Out-Bytes:&lt;/strong&gt; From CloudFront to Internet (GB).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DataTransfer-Out-OBytes:&lt;/strong&gt; From CloudFront to origin (GB).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Request-Tier1/2(HTTP/HTTPS):&lt;/strong&gt; HTTP(S) GET and HEAD requests.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Request-HTTP(S)-Proxy:&lt;/strong&gt; HTTP(S) DELETE, OPTIONS, PATCH, POST, and PUT requests from CloudFront to your origin.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Recommendations
&lt;/h1&gt;

&lt;p&gt;AWS suggests a helpful tip to decrease your bills related to DOT (DataTransfer Out to Internet).&lt;/p&gt;

&lt;p&gt;Because of the discount model of CloudFront, you can put it in front of any AWS services that transfer data to the internet. This way, we will use CloudFront as a simple proxy but with the lowest price for DOT.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HOWEVER,&lt;/strong&gt; there is indeed some missing information regarding this recommendation.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is missing on the CloudFront Pricing page?
&lt;/h2&gt;

&lt;p&gt;As of writing these lines, the Pricing Example 2 from the documentation mentions this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5z66zevo5x30cnmuk981.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5z66zevo5x30cnmuk981.png" alt="Image description" width="800" height="55"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;AWS forgot to mention two usage types here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;DataTransfer-Out-OBytes&lt;/strong&gt;:from CloudFront to origin (GB).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Requests-HTTP(S)-Proxy&lt;/strong&gt;: Forward from CloudFront to origin.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We can put CloudFront in front of any AWS services, and that is a good point. However, if your workload does not use any CloudFront features and uses it just as a proxy, you will have a high consumption of these two metrics.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;IMPORTANT&lt;/strong&gt;&lt;br&gt;
Even with a PPA commitment, the usage type &lt;strong&gt;DataTransfer-Out-OBytes&lt;/strong&gt; does not have PPA applied to it (cf. diagram above).&lt;/p&gt;

&lt;p&gt;This point deserves a dedicated example on the pricing page!&lt;/p&gt;

&lt;h2&gt;
  
  
  Take Aways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Check the eligibility of your DataTransfer to Internet for PPA.&lt;/li&gt;
&lt;li&gt;Do your own maths for DOT optimization with CloudFront.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Source:&lt;br&gt;
&lt;a href="https://aws.amazon.com/cloudfront/pricing/"&gt;https://aws.amazon.com/cloudfront/pricing/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/billing-and-usage-interpreting.html"&gt;https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/billing-and-usage-interpreting.html&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>finops</category>
      <category>cloudfront</category>
    </item>
    <item>
      <title>Edge API Gateway Custom Domain with SAM: certificate in us-east-1 when using another region</title>
      <dc:creator>Walid BATTOU</dc:creator>
      <pubDate>Thu, 28 Dec 2023 16:16:37 +0000</pubDate>
      <link>https://dev.to/aws-builders/edge-api-gateway-custom-domain-with-sam-certificate-in-us-east-1-when-using-another-region-2641</link>
      <guid>https://dev.to/aws-builders/edge-api-gateway-custom-domain-with-sam-certificate-in-us-east-1-when-using-another-region-2641</guid>
      <description>&lt;h2&gt;
  
  
  Purpose?
&lt;/h2&gt;

&lt;p&gt;I want to deploy an &lt;a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-api-endpoint-types.html#api-gateway-api-endpoint-types-edge-optimized" rel="noopener noreferrer"&gt;edge-optimized&lt;/a&gt; API Gateway with a custom domain name.&lt;/p&gt;

&lt;h2&gt;
  
  
  The tool to build it?
&lt;/h2&gt;

&lt;p&gt;My infrastructure background led me to CloudFormation when I started on AWS. Where some developers can start with SST, ServerlessFramework, or CDK.&lt;br&gt;
In the serverless world, I use SAM (Serverless Application Model).&lt;/p&gt;
&lt;h2&gt;
  
  
  Problem?
&lt;/h2&gt;

&lt;p&gt;To deploy an Edge API Gateway, it's &lt;a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-custom-domains.html#edge-optimized-custom-domain-names" rel="noopener noreferrer"&gt;mandatory to generate a certificate in us-east-1&lt;/a&gt;.&lt;br&gt;
The problem with CloudFormation is that resources in one stack are deployed in a single region. We are not able to set another region for a specific resource.&lt;br&gt;
&lt;strong&gt;&lt;em&gt;Example:&lt;/em&gt;&lt;/strong&gt; Create a Certificate with ACM (AWS Certificat Manager) in us-east-1.&lt;/p&gt;
&lt;h2&gt;
  
  
  How to solve it?
&lt;/h2&gt;

&lt;p&gt;From this statement, we have multiple options to choose from:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;To create a dedicated stack for the certificate in us-east-1, and use the certificate in our main stack, for me in eu-west-1.&lt;/li&gt;
&lt;li&gt;To create a unique stack (in eu-west-1) and use CloudFormation custom resources to handle certificate creation in us-east-1.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To learn more about CloudFormation custom resources, you can check out &lt;a href="https://mng.workshop.aws/cloudformation/customresource.html" rel="noopener noreferrer"&gt;this workshop&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Why the first option?
&lt;/h2&gt;

&lt;p&gt;I chose the first option for simplicity and maintainability. Custom resources expand CloudFormation but I love to keep things simple. That means not creating too many resources via custom resources.&lt;/p&gt;

&lt;p&gt;I will use custom resources in my solution to "GET" some values (not creating anything).&lt;/p&gt;
&lt;h2&gt;
  
  
  Stack
&lt;/h2&gt;

&lt;p&gt;Prerequisites:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Having your Route53 zone in the same AWS Account.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Architecture&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwfa45xba7agnflttn0zj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwfa45xba7agnflttn0zj.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's go and Build !!!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1/ As you can see in the diagram above, the first step is to create the "certificate.yaml" file.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To create an ACM certificate on AWS with DNS as  DomainValidationOptions, we need to provide the DomainName and the HostedZoneId. CloudFormation does not get the HostedZoneId dynamically.&lt;/p&gt;

&lt;p&gt;I made a custom resource for a dynamic approach, not hardcoded. AWS should provide the support of DomainName only.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1h15wzjh7yvppaqqcuxa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1h15wzjh7yvppaqqcuxa.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To get the ARN of this certificate from the other stack I store it in a ParameterStore.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; CertificateARN:
    Type: "AWS::SSM::Parameter"
    Properties:
      Name: !Ref ACMCertificate
      Type: "String"
      Value: !Ref Certificate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2/ Deploy the main stack with the template named "template.yaml".&lt;/strong&gt;&lt;br&gt;
Now we need to deploy the main stack, our EDGE API Gateway. We need to get the certificate we created in Step 1 and the HostedZoneId for our domain. To do this we will create a second custom resource.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fllr6abctoiflfkk1uz26.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fllr6abctoiflfkk1uz26.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The stack described in this article is available on my &lt;a href="https://github.com/wbattou/edge-api-gateway-custom-domain" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; if you want to test or reuse it.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>serverless</category>
      <category>apigateway</category>
      <category>awssam</category>
    </item>
    <item>
      <title>CloudWatch Metrics Pricing - FinOps</title>
      <dc:creator>Walid BATTOU</dc:creator>
      <pubDate>Tue, 22 Nov 2022 11:31:56 +0000</pubDate>
      <link>https://dev.to/wbattou/cloudwatch-metrics-pricing-finops-65d</link>
      <guid>https://dev.to/wbattou/cloudwatch-metrics-pricing-finops-65d</guid>
      <description>&lt;p&gt;In this article, I will talk about CloudWatch metrics. Like the other articles in my FinOps series, I will give you some tips about the cost-effective architecture design pattern.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/u-a7FJi-1wA"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Many AWS services provide metrics by default that are free of charge(cf:&lt;a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/aws-services-cloudwatch-metrics.html"&gt;https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/aws-services-cloudwatch-metrics.html&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;From AWS documentation :&lt;br&gt;
"Many AWS services offer basic monitoring by publishing a default set of metrics to CloudWatch with no charge to customers."&lt;/p&gt;

&lt;h1&gt;
  
  
  Take care of the additional cost incure if you use external solution like DataDog or NewRelic (get metrics from APIs).
&lt;/h1&gt;

&lt;p&gt;Many companies want to use a manage solution for their Observability strategies. These solutions are usually very expensive. When you make a forecast for this kind of solutions for AWS, you need to take care of the additional cost you will pay : &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The amount of API calls to GET metrics.&lt;/li&gt;
&lt;li&gt;The amount of Data Out from AWS to internet to upload your logs to your managed solution.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Build the dashboards you will often consult.
&lt;/h1&gt;

&lt;p&gt;Every Ops needs some dashboards to consult in case of incident or performance issue. You have to define a clear strategy about this point.&lt;/p&gt;

&lt;p&gt;When an Ops team checks the monthly cost of a dashboard, 3$ &lt;br&gt;
does not seem expensive. But if you have 20 members in your team and each of them creates multiple dashboards, the bill will increase.&lt;/p&gt;

&lt;p&gt;Use some IaC tools like Terraform or CloudFormation to build your dashboards. In this case you will have the opportunity to destroy and recreate them when needed.&lt;/p&gt;

&lt;h1&gt;
  
  
  Use "Metrics Insights - query builder" which is free of charge.
&lt;/h1&gt;

&lt;p&gt;CloudWatch Metrics Insights is a powerful SQL query engine that you can use to query your metrics. Unfortunately, for the moment it is not possible to save searches directly on it.&lt;/p&gt;

&lt;p&gt;You can use the interactive builder view and save the SQL query generated in a git repository to share them with your team.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>finops</category>
      <category>cloudwatch</category>
    </item>
    <item>
      <title>s3 Storage/DataRetrievals Pricing - FinOps tips</title>
      <dc:creator>Walid BATTOU</dc:creator>
      <pubDate>Thu, 10 Nov 2022 07:24:28 +0000</pubDate>
      <link>https://dev.to/wbattou/s3-storagedataretrievals-pricing-finops-tips-2c3d</link>
      <guid>https://dev.to/wbattou/s3-storagedataretrievals-pricing-finops-tips-2c3d</guid>
      <description>&lt;p&gt;In this article, I will talk about s3, a complex and highly available service. Like the other articles in my FinOps series, I will give you some tips about the cost-effective architecture design pattern.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/t4Fy7YF-2VM"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Because s3 is a huge topic, today I will only talk about the cost of data storage and data retrieval. The other charges will be covered in a future article (Requests, Data transfer).&lt;/p&gt;

&lt;h2&gt;
  
  
  Monitor storage metrics with Storage Lens.
&lt;/h2&gt;

&lt;p&gt;When you work on s3, you need some insights about the objects we store, for example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The size of your buckets.&lt;/li&gt;
&lt;li&gt;The total number of encrypted bytes.&lt;/li&gt;
&lt;li&gt;How many objects do you have ?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With Storage Lens, you can analyze your storage with ~29 metrics and interactive dashboards to aggregate data for your entire organization.&lt;/p&gt;

&lt;p&gt;Storage Lens provides metrics, you can use them in CloudWatch to create alarms and triggered actions.&lt;/p&gt;

&lt;p&gt;A real case example :&lt;/p&gt;

&lt;p&gt;Using multipart upload to backup your data on s3.&lt;/p&gt;

&lt;p&gt;When you use s3 multipart upload (from an object size of 100 MB, you should consider using multipart uploads) and the uploading process fails, you pay for the partial data you have in your bucket.&lt;/p&gt;

&lt;p&gt;Consequences :&lt;/p&gt;

&lt;p&gt;You will not find any data in your bucket but a high cost in cost explorer.&lt;/p&gt;

&lt;p&gt;Solution:&lt;/p&gt;

&lt;p&gt;Use Storage Lens to identify this issue and publish the metrics to CloudWatch to be able to create an alarm.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choose the right encryption strategy, do not use KMS for a bucket with a high volume of data (performance impact and high cost).
&lt;/h2&gt;

&lt;p&gt;A real case example :&lt;/p&gt;

&lt;p&gt;You have a data lake workload and use s3 to store the data.&lt;/p&gt;

&lt;p&gt;As part of the security guideline of the company, you need to encrypt your data at rest and in transit. A CMK KMS key is used to encrypt all of your s3 buckets at rest.&lt;/p&gt;

&lt;p&gt;Consequences :&lt;/p&gt;

&lt;p&gt;After a period of time, you notice that KMS is very expensive.&lt;/p&gt;

&lt;p&gt;Solution:&lt;/p&gt;

&lt;p&gt;For big data workloads, I do not recommend using a CMK KMS key for encryption. Why? Because of the interaction between s3 and KMS to decrypt/encrypt objects when you access them.&lt;/p&gt;

&lt;p&gt;For a bucket with TeraBytes or PetaBytes of data, you will have a performance impact and high cost for KMS service.&lt;/p&gt;

&lt;p&gt;From my experience, with a very large s3 bucket, we saved 6K$/month by changing the encryption key from SSE-KMS to SSE-S3.&lt;/p&gt;

&lt;p&gt;If the security guideline does not allow you to do that, consider using "S3 Bucket Keys for SSE-KMS".&lt;/p&gt;

&lt;h2&gt;
  
  
  Prefer intelligent Tiering class, depending on your retrieval performance requirements.
&lt;/h2&gt;

&lt;p&gt;As you can see in the animation, with Intelligent Tiering you don't pay to retrieve data except for the expedited mode.&lt;/p&gt;

&lt;p&gt;If your use case does not need specific performance and you don’t know how your workload will evolve, Intelligent Tiering is the right class to begin with.&lt;/p&gt;

&lt;h2&gt;
  
  
  AWS backup for s3 is expensive, do not choose it as default.
&lt;/h2&gt;

&lt;p&gt;For the Ireland region, AWS backup for s3 costs 0.05$/GB per month. It is really expensive but you should take this option if your use case needs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Need point-in-time recovery.&lt;/li&gt;
&lt;li&gt;Protect from accidental objects/version deletion.&lt;/li&gt;
&lt;li&gt;Want to use AWS backup policies at the organizational level.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I hope these tips will help you. Do not hesitate to give me some feedback.&lt;/p&gt;

</description>
      <category>s3</category>
      <category>aws</category>
      <category>finops</category>
      <category>costmanagement</category>
    </item>
    <item>
      <title>Application Load Balancer Pricing - FinOps</title>
      <dc:creator>Walid BATTOU</dc:creator>
      <pubDate>Wed, 02 Nov 2022 23:23:34 +0000</pubDate>
      <link>https://dev.to/wbattou/application-load-balancer-pricing-jl4</link>
      <guid>https://dev.to/wbattou/application-load-balancer-pricing-jl4</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/sKGF00NhWcY"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;I would like to thank the people who gave me some feeback on my first article.&lt;/p&gt;

&lt;p&gt;On this one, I made an animation about the pricing of an Application Load Balancer on AWS and my FinOps recommendations for it.&lt;/p&gt;

&lt;h2&gt;
  
  
  If you still have some Classic Load Balancer in place, you pay for DataProcessing and not LCU. Migrate CLB to ALB to save cost.
&lt;/h2&gt;

&lt;p&gt;The CLB (Classic Load Balancer) was released in 2009, ALB (Application Load Balancer) was released in 2016. If you started on AWS before 2016, you had no choice but taking CLB.&lt;/p&gt;

&lt;p&gt;Check your workloads and do the migration.&lt;/p&gt;

&lt;h2&gt;
  
  
  If you don’t use API Gateway features, challenge the migration to an ALB to reduce cost.
&lt;/h2&gt;

&lt;p&gt;This recommendation applies to a Serverless use case. When you start using Lambda for building an API, the default choice is API Gateway.&lt;/p&gt;

&lt;p&gt;Since 2018, it has been possible to use an ALB to invoke lambda functions and serve HTTP(S) requests, which can be cheaper.&lt;/p&gt;

&lt;h2&gt;
  
  
  When enabling access log, do not forget to define s3 retention policy.
&lt;/h2&gt;

&lt;p&gt;When using an ALB, think about defining your observability strategy :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;    How do I check my logs ?&lt;/li&gt;
&lt;li&gt;    Which dashboard will I use ?&lt;/li&gt;
&lt;li&gt;    I store it on s3 but which period do I need to archive ?&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>finops</category>
      <category>costoptimization</category>
      <category>costmanagement</category>
    </item>
    <item>
      <title>CloudWatch Logs Pricing - FinOps</title>
      <dc:creator>Walid BATTOU</dc:creator>
      <pubDate>Thu, 27 Oct 2022 06:00:11 +0000</pubDate>
      <link>https://dev.to/wbattou/cloudwatch-logs-finops-overview-58dn</link>
      <guid>https://dev.to/wbattou/cloudwatch-logs-finops-overview-58dn</guid>
      <description>&lt;p&gt;I would like to share graphical content about some FinOps topics and what you need to know about AWS Bills. I am starting with a CloudWatch log animation, let me know if you are interested in this content.&lt;/p&gt;

&lt;p&gt;You will find some explanations about my recommendations below.&lt;/p&gt;

&lt;h2&gt;
  
  
  Configure retention policy on your log groups.
&lt;/h2&gt;

&lt;p&gt;You can directly configure your log group retention policy on your CloudWatch agent configuration file.&lt;/p&gt;

&lt;p&gt;Concerning the archiving of your oldest logs, for the moment, you can periodically copy them to s3 but not schedule the copy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Avoid selecting a long period of time when using Logs Insights queries.
&lt;/h2&gt;

&lt;p&gt;You can use CloudWatch Logs Insights to do some queries and build some dashboards based on them. On dashboards or queries, do not select a large period of time when you have a lot of data in your log groups.&lt;/p&gt;

&lt;h2&gt;
  
  
  Think about using throttling/WAF on your internet facing workloads to avoid a high log volume ingestion.
&lt;/h2&gt;

&lt;p&gt;For this recommendation, we can take API gateway for example.&lt;br&gt;
Suppose that your company can’t have the time to invest on security for the moment, there aren’t any WAF rules or throttling in place.&lt;/p&gt;

&lt;p&gt;What happens if your API Gateway gets attacked and logging is enable on it ?&lt;br&gt;
The result will be a high volume of log. The most expensive part is logs ingestion (cf:animation below). In the cloud, other than causing some performance troubles, an attack will lead to an additional cost on logs and metrics.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rvybPPv9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pd0m4k36gmg8jnxoq3ho.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rvybPPv9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pd0m4k36gmg8jnxoq3ho.PNG" alt="Image description" width="867" height="1554"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/5JlvTSesl7Y"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>aws</category>
      <category>finops</category>
      <category>cloudwatch</category>
    </item>
  </channel>
</rss>
