<?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: Gert Leenders</title>
    <description>The latest articles on DEV Community by Gert Leenders (@glnds).</description>
    <link>https://dev.to/glnds</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%2F497890%2Fb61a0570-76f9-4aee-abf4-8903ac8c0dd9.jpg</url>
      <title>DEV Community: Gert Leenders</title>
      <link>https://dev.to/glnds</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/glnds"/>
    <language>en</language>
    <item>
      <title>A Hidden Gem: Two Ways to Improve AWS Fargate Container Launch Times</title>
      <dc:creator>Gert Leenders</dc:creator>
      <pubDate>Thu, 27 Oct 2022 18:30:36 +0000</pubDate>
      <link>https://dev.to/aws-heroes/a-hidden-gem-two-ways-to-improve-aws-fargate-container-launch-times-51fo</link>
      <guid>https://dev.to/aws-heroes/a-hidden-gem-two-ways-to-improve-aws-fargate-container-launch-times-51fo</guid>
      <description>&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;p&gt;There’s a little gem hidden away on GitHub about boosting Fargate launch times. Kudos to &lt;a href="https://twitter.com/mreferre"&gt;Massimo Re Ferrè&lt;/a&gt;, the author of the &lt;a href="https://github.com/aws/containers-roadmap/issues/696#issuecomment-1286261454"&gt;Github comment in question&lt;/a&gt;. With this post, I want to bring his comment to your attention. Feel free to just read the original posting, this blog post is a shorter version that zooms into the core problem and solutions.&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;On AWS Fargate, each containerized workload, Amazon ECS Task or Kubernetes Pod, runs on its own single-use single-tenant instance that’s not reused after the workload finishes.&lt;/strong&gt; The container images required to run a workload on AWS Fargate are downloaded for every Amazon ECS Task or Kubernetes Pod. This process is in contrast to multi-tenant instances like Amazon ECS Container Instances or Kubernetes Nodes, where a container image may already exist on a host from a replica of the same workload.&lt;/p&gt;

&lt;p&gt;The use of a single-use single-tenant instance makes image caching not easy to fix on AWS Fargate. However, AWS is working on two alternative approaches to reduce container launch times. &lt;/p&gt;

&lt;h2&gt;
  
  
  Approach 1: Reducing AWS Fargate Startup Times with zstd Compressed Container Images
&lt;/h2&gt;

&lt;p&gt;By default, container image builders compress each container image layer using the gzip compression algorithm.  When a container runtime downloads an image layer, the runtime decompresses the contents into the container runtime storage system.&lt;/p&gt;

&lt;p&gt;Know that container image builders and container runtimes also support an alternative compression algorithm for image layers: &lt;a href="https://github.com/facebook/zstd"&gt;zstd&lt;/a&gt;. Benchmarks show that zstd can achieve higher compression ratios and higher decompression speeds than the gzip compression algorithm. &lt;strong&gt;AWS internal testing of zstd compressed container images on AWS Fargate has shown up to a 27% reduction in Amazon ECS Task or Kubernetes Pod startup times.&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;The reduction in startup time varies by container image, with the larger container images seeing the most significant improvement. Uses cases like machine learning, artificial intelligence, and data analytics traditionally have large container images. Consequently, these workloads could see the most benefit from adopting zstd compression.&lt;/p&gt;

&lt;p&gt;From: &lt;a href="https://aws.amazon.com/blogs/containers/reducing-aws-fargate-startup-times-with-zstd-compressed-container-images/"&gt;Reducing AWS Fargate Startup Times with zstd Compressed Container Images&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Approach 2: Seekable OCI for lazy loading container images
&lt;/h2&gt;

&lt;p&gt;Prior research has shown that container image downloads account for 76% of container startup time, but on average only 6.4% of the data is needed for the container to start doing valuable work.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Lazy_loading"&gt;Lazy loading&lt;/a&gt; is an approach where data is downloaded from the registry in parallel with the application startup.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ka8wr2sG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t9nfy7owwzi64t0x0l6f.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ka8wr2sG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t9nfy7owwzi64t0x0l6f.jpg" alt="Lazy Loading" width="400" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/awslabs/soci-snapshotter"&gt;Seekable OCI (SOCI)&lt;/a&gt; is a technology open-sourced by AWS that enables containers to launch faster by lazily loading the container image. It’s usually not possible to fetch individual files from gzipped tar files. With SOCI, AWS borrowed some of the design principles from &lt;a href="https://github.com/containerd/stargz-snapshotter"&gt;stargz-snapshotter&lt;/a&gt;, but took a different approach. A SOCI index is generated separately from the container image and is stored in the registry as an OCI Artifact and linked back to the container image by OCI Reference Types. This means that the container images do not need to be converted, image digests do not change, and image signatures remain valid.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://github.com/awslabs/soci-snapshotter"&gt;soci-snapshotter&lt;/a&gt; tool is used to create SOCI indices for existing OCI container images and a remote snapshotter. It provides containerd the ability to lazy load images that have been indexed by SOCI.&lt;/p&gt;

&lt;p&gt;From: &lt;a href="https://aws.amazon.com/about-aws/whats-new/2022/09/introducing-seekable-oci-lazy-loading-container-images/"&gt;Introducing Seekable OCI for lazy loading container images&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;While image caching for Fargate is not solved, know that you have these two techniques to your proposal to reduce Fargate launch times!&lt;/p&gt;

&lt;p&gt;Enjoy and until next time!&lt;/p&gt;

</description>
      <category>aws</category>
      <category>cloud</category>
      <category>containerapps</category>
      <category>kubernetes</category>
    </item>
    <item>
      <title>Sustainability and Software Development: Properly Prioritise Your Actions</title>
      <dc:creator>Gert Leenders</dc:creator>
      <pubDate>Thu, 13 Oct 2022 19:24:41 +0000</pubDate>
      <link>https://dev.to/aws-heroes/sustainability-and-software-development-properly-prioritise-your-actions-5el6</link>
      <guid>https://dev.to/aws-heroes/sustainability-and-software-development-properly-prioritise-your-actions-5el6</guid>
      <description>&lt;h3&gt;
  
  
  TL;DR
&lt;/h3&gt;

&lt;p&gt;We should take every possible action to limit our carbon footprint. Nevertheless, prioritise those actions based on impact (see the priority table below).&lt;/p&gt;

&lt;h2&gt;
  
  
  The Sustainable Pillar
&lt;/h2&gt;

&lt;p&gt;In today's world, sustainability should be a concern. Information Technology (IT) goes with that flow, having climate concerns put on most agendas. Regarding cloud computing, it’s nice to see that &lt;a href="https://docs.aws.amazon.com/wellarchitected/latest/sustainability-pillar/sustainability-pillar.html"&gt;AWS&lt;/a&gt;, &lt;a href="https://cloud.google.com/sustainability"&gt;Google Cloud&lt;/a&gt;, and &lt;a href="https://azure.microsoft.com/en-us/explore/global-infrastructure/sustainability/#overview"&gt;Azure&lt;/a&gt; made sustainability part of their strategy.&lt;/p&gt;

&lt;p&gt;As a cloud engineer, the following article was recently brought to my attention: &lt;a href="https://levelup.gitconnected.com/python-is-destroying-the-planet-951e83f22748"&gt;Python is Destroying the Planet&lt;/a&gt;. The article has good content, but I had many concerns after reading it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Context is Everything.
&lt;/h2&gt;

&lt;p&gt;To summarize, the article is about measuring energy efficiency of programming languages and  concludes with an open question. The latter opens the door for people jumping to the wrong conclusions or even worse, taking improper action. 😨&lt;/p&gt;

&lt;p&gt;Based on the article, I came up with the following metaphor.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Let’s say a parcel needs to ship from Belgium to Rome with the lowest carbon footprint. Therefore the package is loaded into a truck. Although it's a hot summer day, the driver - concerned about the planet - pushes himself to the limit. To further reduce the carbon footprint, he turns off the air-conditioning to save some gasoline.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZhGHHGUp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h1sd2yxob299axsd7dpg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZhGHHGUp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h1sd2yxob299axsd7dpg.png" alt="Truck Driver" width="560" height="374"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Although the driver’s intentions are good, I immediately ask myself the following questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Did that parcel have to ship to Rome? Is there any value in doing this? Maybe it’s just an empty box?&lt;/li&gt;
&lt;li&gt;Did the truck take the shortest or fastest route?&lt;/li&gt;
&lt;li&gt;Was the truck loaded at full capacity?&lt;/li&gt;
&lt;li&gt;Were the truck’s tires inflated sufficiently?&lt;/li&gt;
&lt;li&gt;Given the parcel dimensions, what were the other freight options?&lt;/li&gt;
&lt;li&gt;...&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My point? The intentions are correct, but turning of the airconditioning is no more than a drop in the ocean compared to  the outcome of the above questions! The effect of answering those questions could impact a few magnitudes bigger than turning off the airconditioning.&lt;/p&gt;

&lt;h2&gt;
  
  
  Carbon footprint measures for IT prioritized
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;With multiple options available, it’s better to apply the one with the most impact first.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Concerning IT sustainability, I prioritize actions as follows:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The business case&lt;/strong&gt;: There has to be value in the software written to begin with!  For example:

&lt;ul&gt;
&lt;li&gt;There's  no value in a Petabyte data lake without data access&lt;/li&gt;
&lt;li&gt;There's no value in calculated predictions that are applied nowhere&lt;/li&gt;
&lt;li&gt;You get the point ;-)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Energy input&lt;/strong&gt;: is the data center running on green energy? If yes, everything else becomes irrelevant because there’s no carbon footprint. (Yes, a bit simplistic, but again, you get the idea)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Energy output&lt;/strong&gt;: is the residual heat of the data center reused?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Technology&lt;/strong&gt;: Cloud Native, Serverless, CQRS, ...&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Elasticity&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Are things shut down when not in use&lt;/li&gt;
&lt;li&gt;A low baseline and scale-out when needed&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Clean code&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;...&lt;/li&gt;
&lt;li&gt;...&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Programming language&lt;/strong&gt;: is the language used energy efficient?&lt;/li&gt;
&lt;li&gt;...&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It would be wrong to state that the choice of programming language has no impact on carbon footprint. But before digging deeper into that, many other things could yield much more with less effort.&lt;/p&gt;

&lt;h2&gt;
  
  
  To wrap up
&lt;/h2&gt;

&lt;p&gt;When thinking about sustainability, properly prioritize your efforts toward limiting your carbon footprint.&lt;/p&gt;

&lt;p&gt;Running your workloads in the cloud is likely already a step in the right direction because cloud providers have usually a lower carbon footprint and are more energy efficient than typical on-premises alternatives. This is because they invest in efficient power and cooling technology, operate energy-efficient server populations, and achieve high server utilization rates.&lt;/p&gt;

&lt;p&gt;Cloud workloads reduce impact by taking advantage of shared resources, such as networking, power, cooling, and physical facilities. The incentive to run as optimized as possible is also much bigger for those big providers.&lt;/p&gt;

&lt;p&gt;Enjoy and until next time!&lt;/p&gt;

</description>
      <category>devops</category>
      <category>cloud</category>
      <category>aws</category>
    </item>
    <item>
      <title>Understand, Visualize, and Lower CloudWatch Costs</title>
      <dc:creator>Gert Leenders</dc:creator>
      <pubDate>Wed, 22 Jun 2022 19:41:32 +0000</pubDate>
      <link>https://dev.to/aws-heroes/understand-visualize-and-lower-cloudwatch-costs-2206</link>
      <guid>https://dev.to/aws-heroes/understand-visualize-and-lower-cloudwatch-costs-2206</guid>
      <description>&lt;p&gt;In this post, I’ll create awareness on AWS CloudWatch costs and help you better understand what could cause these costs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Logs &amp;amp; Metrics
&lt;/h2&gt;

&lt;p&gt;Whenever you build a service or application, to get insights, logs and metrics are crucial in a setup. In case of trouble, logs are the first place to look.  Besides, metrics enable you to predict events and to get notified as soon as numbers start deviating.&lt;/p&gt;

&lt;p&gt;Often starting small, together with a service grows the amount of logs and metrics. In AWS, metrics and logs are part of AWS CloudWatch.&lt;/p&gt;

&lt;h3&gt;
  
  
  Hide &amp;amp; Seek
&lt;/h3&gt;

&lt;p&gt;Over the years, I've noticed the following regarding CloudWatch cost.  Most of the time, AWS CloudWatch is not the most expensive service on the AWS Bill.  Usually, CloudWatch costs don't even make it to the top three. CloudWatch seems to be a master in disguise in a goody-goody way. Often it ends in the fourth or fifth place on your AWS bills. &lt;strong&gt;That place&lt;/strong&gt; &lt;strong&gt;&lt;em&gt;-just outside the top three-&lt;/em&gt;&lt;/strong&gt; &lt;strong&gt;appears to be the perfect spot to eat up a good portion of your budget without becoming a usual suspect in the next cost-saving round&lt;/strong&gt;. 😓&lt;/p&gt;

&lt;p&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%2F1xtyj784jnq90543zc48.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%2F1xtyj784jnq90543zc48.png" alt="Cash Cow" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm going to be straight; I suspect AWS CloudWatch to be one of AWS’s cash cows. Why? Besides being a master at staying under the radar, CloudWatch also has costly defaults. Take log group retention as an example. The default for log groups to never expire only makes sense to AWS! &lt;strong&gt;My suspicion for CloudWatch being a cash cow is amplified by the fact that it’s damn hard (to nearly impossible) to get useful cost insights&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  CloudWatch Log Group cost distribution
&lt;/h3&gt;

&lt;p&gt;First, regarding CloudWatch Logs, &lt;strong&gt;note that it's not data storage that’s costly. It’s data ingestion that generates costs&lt;/strong&gt;. Your first question about logs: &lt;code&gt;which log groups generate the highest cost?&lt;/code&gt; A good insight isn’t available out of the box, but I figured out an excellent way to do it. &lt;strong&gt;I’ve built a graph showing the log group data ingestion distribution. The graph shows the log groups eating up the most money from left to right&lt;/strong&gt;.&lt;/p&gt;

&lt;p&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%2Fia8k83oirrfcu6l4pmoz.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%2Fia8k83oirrfcu6l4pmoz.png" alt="Log Distribution" width="800" height="238"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Immediately you notice a significant outlier on the far left of the graph. Not a big surprise; in this case, the clear winner is AWS CloudTrail. Outliers like these make it hard to zoom in on other elements. To further drill down in the graph, start disabling the outliers on the graph’s legend to the right.&lt;/p&gt;

&lt;p&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%2F6byfsgsmj16iw9gtmgbs.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%2F6byfsgsmj16iw9gtmgbs.png" alt="Drill down" width="800" height="331"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Setting up the log group data ingestion distribution graph yourself is easy. In CloudWatch, create a new dashboard and add a new widget. &lt;strong&gt;The most important thing is to fill in the following query to build the graph&lt;/strong&gt;:&lt;/p&gt;

&lt;p&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%2Fekngh7wj94t5w8ujk25w.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%2Fekngh7wj94t5w8ujk25w.png" alt="Query" width="800" height="194"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To enhance the contrast between group sizes, you can play around with the graphs period:&lt;/p&gt;

&lt;p&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%2Fg4eahhc1l1ksv2azvru1.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%2Fg4eahhc1l1ksv2azvru1.png" alt="Period" width="800" height="123"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Moving the legend to the right helps to select certain groups.&lt;/p&gt;

&lt;p&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%2Fa7vpzf67yqc38tyiij5a.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%2Fa7vpzf67yqc38tyiij5a.png" alt="Options" width="800" height="223"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The graph visualization allows you to prioritize the log groups optimization.&lt;/strong&gt; Ultimately, the optimization will likely come down to lowering your number of logs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Do you need that many log statements? Challenge yourself!&lt;/li&gt;
&lt;li&gt;Question the log level. Having a DEBUG level is sometimes great but using that log level everywhere all the time is probably overkill&lt;/li&gt;
&lt;li&gt;The CloudWatch log agent is not shy to generate a good amount of logs/costs&lt;/li&gt;
&lt;li&gt;...&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I know, this is kicking in an open door 😄&lt;/p&gt;

&lt;p&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%2F5mixri0ne8tgc1ztwvz1.gif" 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%2F5mixri0ne8tgc1ztwvz1.gif" alt="Open Door" width="480" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  CloudWatch Metrics
&lt;/h2&gt;

&lt;p&gt;If getting logs insights was complex, getting metrics data is even trickier. On top, I have the feeling CloudWatch metrics are an even bigger money pit than logs. &lt;strong&gt;Worse, there’s currently no way to get an insight into CloudWatch Metrics&lt;/strong&gt;. I contacted support asking for a way, but I‘m told it’s impossible.😟&lt;/p&gt;

&lt;p&gt;So all that I can do for now is create awareness about CloudWatch metrics cost. &lt;strong&gt;Remember that metric costs can become expensive very fast&lt;/strong&gt;. For example, at some point, I created  &lt;a href="https://aws.amazon.com/builders-library/implementing-health-checks/" rel="noopener noreferrer"&gt;a deep health check&lt;/a&gt; on a fleet of instances with the help of some custom metrics. I assumed the cost would be negligible, only to discover those deep health checks cost around 900$ a month. I can tell you that health is long gone now. 😉&lt;/p&gt;

&lt;h2&gt;
  
  
  To summarize
&lt;/h2&gt;

&lt;p&gt;My advice is to check your CloudWatch cost at least monthly. Be aware that CloudWatch costs often tend to stay under the radar and try to find a way to get a good insight into your CloudWatch costs.&lt;/p&gt;

&lt;p&gt;Enjoy and until next time!&lt;/p&gt;

</description>
      <category>aws</category>
      <category>devops</category>
      <category>cloud</category>
      <category>cloudskills</category>
    </item>
    <item>
      <title>IT Professionalism: Have You Ever Wondered Why We Ship Shit?</title>
      <dc:creator>Gert Leenders</dc:creator>
      <pubDate>Tue, 22 Feb 2022 18:35:10 +0000</pubDate>
      <link>https://dev.to/glnds/it-professionalism-have-you-ever-wondered-why-we-ship-shit-2c5i</link>
      <guid>https://dev.to/glnds/it-professionalism-have-you-ever-wondered-why-we-ship-shit-2c5i</guid>
      <description>&lt;p&gt;&lt;strong&gt;&lt;em&gt;Warning: This article contains strong language that may offend some readers. Please blame Uncle Bob.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If the sentence "Don't Ship Shit" doesn't ring a bell, then be sure to watch &lt;a href="https://youtu.be/LmRl0D-RkPU?t=2111"&gt;Uncle Bob's talk about professionalism and delivering quality software&lt;/a&gt; first.&lt;/p&gt;

&lt;p&gt;The particular episode of Uncle Bob's talk I like to discuss in this post is the one about the two sets of ears picking up the tagline:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"I expect that we will not ship shit"&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Bob pictures this like this: while the ear of the programmer is yelling at you saying this is insane, the ear of the normal human is saying this is completely reasonable. &lt;strong&gt;Basically, Bob states that programmers believe it's impossible to deliver quality software while meeting deadlines unless they ship shit.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Without any doubt, Uncle Bob is a great speaker, and the &lt;a href="(https://youtu.be/LmRl0D-RkPU?t=2111)"&gt;Voxxed CERN 2019 Keynote&lt;/a&gt; is an excellent presentation. The story is so recognizable, making the talk so enjoyable. Yet, at the same time, it's also painful because it's so true. &lt;strong&gt;As developers, we know we're often cutting corners so big that it results in poor-quality software. The boundary between cutting corners and crappy software is thin&lt;/strong&gt;. On the other hand, business seems unaware of these shortcuts and assumes developers always deliver top-notch applications and services 😦&lt;/p&gt;

&lt;p&gt;I want to elaborate a bit more on Bob's talk: &lt;strong&gt;I think they're actually two kinds of shit: Shit by Design and Shit by Incompetence.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Shit by Design
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Shit by design: shit caused by overcutting corners and being too indulgent.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Bad design driven by wrong estimates
&lt;/h3&gt;

&lt;p&gt;I can't repeat it enough: &lt;a href="https://www.element7.io/2021/06/the-quirks-of-software-effort-estimation/"&gt;estimations should be accurate but not precise&lt;/a&gt;. Also, estimates are non-negotiable. You should feel offended if someone questions your estimates!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don't cave under pressure to make silly estimates!&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Bad design by bureaucratic meddling
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Business defines the functionals, IT defines the non-functionals&lt;/strong&gt;.&lt;br&gt;
Compare writing software with buying a car. As a customer, you can decide upon a wide variety of options. However, a customer can't choose to leave out the airbag or seatbelt to save some dollars. Manufacturers don't offer that choice because the law doesn't allow or to protect customers against themselves (in case somebody is still to be convinced those things are a lifesaver in case of an accident) 😓&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don’t let businesses decide on the non-functionals. IT will feel the pain of those when they are not properly executed. Security can be compared with a car's seatbelt, it's not optional.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Bad design by feature stuffing
&lt;/h3&gt;

&lt;p&gt;Designing a system without knowing RTO and RPO inevitably results in over- or under engineering. Besides, software quality assurance is not a one-off. &lt;strong&gt;&lt;a href="https://www.element7.io/2020/06/sprint-planning-how-to-use-rto-rpo-to-prevent-feature-stuffing/"&gt;Continuously use your SLOs as a defense shield against feature stuffing and to reserve enough time for the non-functionals&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The key takeaway: be more assertive as a developer. No one expects you to take shortcuts so big that they ruin quality and SLOs!&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Shit by Incompetence
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Shit by Incompetence: people not being aware of the mess they're making.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In Bob's words: we don't know shit. 😄&lt;/p&gt;

&lt;p&gt;There is nothing as dangerous as the &lt;a href="https://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect"&gt;Dunning–Kruger effect&lt;/a&gt;: failing in self-assessment and overestimating your abilities. Personally. I like Socrates' saying: &lt;a href="https://en.wikipedia.org/wiki/I_know_that_I_know_nothing"&gt;I know that I know nothing&lt;/a&gt;. That mindset is a good starter and half the battle!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In a nutshell: don't over- or underestimate your skills and be assertive! That's the best defense against shipping poor quality software.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Enjoy and until next time!&lt;/p&gt;

</description>
      <category>programming</category>
      <category>beginners</category>
      <category>agile</category>
      <category>testing</category>
    </item>
    <item>
      <title>Improving Resiliency using Immutable Infrastructure</title>
      <dc:creator>Gert Leenders</dc:creator>
      <pubDate>Mon, 31 Jan 2022 11:48:16 +0000</pubDate>
      <link>https://dev.to/aws-heroes/improving-resiliency-using-immutable-infrastructure-5gjo</link>
      <guid>https://dev.to/aws-heroes/improving-resiliency-using-immutable-infrastructure-5gjo</guid>
      <description>&lt;p&gt;The reason for writing a post about resiliency and immutable infrastructure originates from the following question recently asked to me:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Just read your comments about building AMIs. &lt;strong&gt;Why do you think it is best to do everything on compile time?&lt;/strong&gt; We decided to work the other way around. We mostly deploy the standard images provided by AWS and do all the customization as post-install config with Ansible.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Compile-time vs. Runtime aka Baking vs. Frying
&lt;/h2&gt;

&lt;p&gt;To explain why I prefer doing things at compile-time, we need to look at the possibilities for system provisioning first. &lt;strong&gt;Generally, you have two options for system provisioning: bake all configuration into a system before launch (baking) or add configuration after launching, called frying.&lt;/strong&gt; Often you use a mixture of both, where parts of the system are baked, and parts are fried.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Towards developers, I often compare the concepts of baking and frying with compile-time vs. runtime or early vs. late binding.&lt;/strong&gt; That terminology is easier to understand for developers because most of them are familiar with those concepts and their benefits and drawbacks.&lt;/p&gt;

&lt;h3&gt;
  
  
  Mitigating Unpredictably
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;The main reason to prefer baking, early binding, or compile-time is simple: it avoids unpredictability.&lt;/strong&gt; Whenever things are being done at runtime or whenever you use late binding, there is a chance of unexpected behavior, potentially breaking things.&lt;/p&gt;

&lt;p&gt;For example, imagine the trivial case where &lt;code&gt;yum update&lt;/code&gt; is executed in &lt;a href="https://cloudinit.readthedocs.io/en/latest/"&gt;cloud-init&lt;/a&gt; on an EC2 Instance. Executing simple code while booting can potentially break because of unpredictable behavior. While it can look like a good idea to run &lt;code&gt;yum update&lt;/code&gt; during initialization to keep package versions evergreen. It will become clear it wasn't when you end up without healthy instances Sunday at 8 am, just because some yum dependency was temporarily unavailable. 😅&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--o-8xom_U--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y60u7v1rcmyig2foxpdq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--o-8xom_U--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y60u7v1rcmyig2foxpdq.png" alt="Image description" width="542" height="742"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Need for Speed
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Besides stability, there's a second benefit of baking: speed.&lt;/strong&gt; Replacement and scale-out events will likely finish faster using baked artifacts because those require fewer steps during startup.&lt;/p&gt;

&lt;p&gt;Especially in the case of scaling out, velocity is critical. When scaling is slow, there's a bigger chance to overload a service until resources can't come up anymore. &lt;a href="https://www.element7.io/2021/01/the-curious-case-of-autoscaling/"&gt;Think about premature starvation due to resource exhaustion and fail fast&lt;/a&gt; whenever scaling is involved. Keep in mind: a pre-built immutable artifact always wins the race to spin up over a post-build playbook.&lt;/p&gt;

&lt;h2&gt;
  
  
  Immutable Infrastructure
&lt;/h2&gt;

&lt;p&gt;Doing everything at compile-time ideally results in what is called "Immutable infrastructure." If you are not familiar with the concept or you want a quick refresher. I recommend first reading Martin Fowler's &lt;a href="https://martinfowler.com/bliki/ImmutableServer.html"&gt;Immutable Server&lt;/a&gt;. Drilling down further from that article will bring you to the &lt;a href="https://martinfowler.com/bliki/PhoenixServer.html"&gt;PhoenixServer&lt;/a&gt;, an interesting concept linked to immutable infrastructure.&lt;/p&gt;

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

&lt;blockquote&gt;
&lt;p&gt;It is a good idea to virtually burn down your servers at regular intervals. A server should be like a phoenix, regularly rising from the ashes.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Furthermore, I want to emphasize that &lt;a href="https://martinfowler.com/bliki/SnowflakeServer.html"&gt;Snowflake servers&lt;/a&gt; are to be avoided. To say it in Martin's words: they're good for a ski resort, bad for a data center. The problem with a snowflake server is that it's difficult to reproduce. Should you run into problems, it's hard to fire up a new server to support the same functionality. &lt;strong&gt;New resources that come up need to be exact copies and predictable.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Immutable infrastructure and Infrastructure as Code (IaC)
&lt;/h3&gt;

&lt;p&gt;I repeat myself saying I'm a fan of both Immutable infrastructure and Infrastructure as Code. Assure not to switch things up, &lt;strong&gt;Infrastructure as Code can facilitate building Immutable Infrastructure, but it's not a necessity.&lt;/strong&gt;&lt;/p&gt;

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

&lt;p&gt;Even in case everything is installed manually without using Infrastructure as Code, Immutable infrastructure can be achieved as long as you "bake" the manual install steps into a machine image. Follow the same baking procedure whenever changes are made. It's maybe not ideal, but sometimes it's the best option if time is a constraint.&lt;/p&gt;

&lt;p&gt;In any case, it is crucial to reflect your installation procedure in your Recovery Time Objective (RTO). If a setup or update is time-consuming, this should increase your Recovery Time Objective.&lt;/p&gt;

&lt;h2&gt;
  
  
  Embrace Chaos (aka Resilience) Engineering
&lt;/h2&gt;

&lt;p&gt;Adopting a new strategy like Immutable Infrastructure requires extra effort and perseverance at the start. Be aware it's easy to fall into old habits. I regularly see people login into instances making changes using some "&lt;a href="https://www.element7.io/2021/01/keep-up-with-the-times-forget-ssh-welcome-aws-session-manager/"&gt;last resort remote access&lt;/a&gt;". That is something you really want to avoid. For that reason, I also advise embracing Chaos Engineering. It will help to get quick feedback about violations against Immutable Infrastructure. By shortening instance lifetime, people will feel the pain of manual changes after a week or two instead of several months, which is far more desirable. 😉 Start using AWS Fault Injector, Chaos Monkey, or &lt;a href="https://www.element7.io/2021/04/aws-ec2-resilience-engineering-the-easy-way/"&gt;simply put a max lifetime on your autoscaling group&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Enjoy and until next time!&lt;/p&gt;

</description>
      <category>cloud</category>
      <category>devops</category>
      <category>beginners</category>
      <category>aws</category>
    </item>
    <item>
      <title>One-Click Set Up: Querying AWS ALB and VPC Flow Logs Made Easy</title>
      <dc:creator>Gert Leenders</dc:creator>
      <pubDate>Wed, 12 Jan 2022 18:55:31 +0000</pubDate>
      <link>https://dev.to/aws-heroes/one-click-set-up-querying-aws-alb-and-vpc-flow-logs-made-easy-3b2j</link>
      <guid>https://dev.to/aws-heroes/one-click-set-up-querying-aws-alb-and-vpc-flow-logs-made-easy-3b2j</guid>
      <description>&lt;p&gt;Let's face it, as soon as you get in trouble with an application or infrastructure, logs are your first resort. To have the right logs at hand, VPC Flow Logs should be enabled when a VPC is part of an infrastructure. On top, a load balancer is most likely the second most common component of a setup, and it's advised to have access logging enabled on those.&lt;/p&gt;

&lt;p&gt;Because these two log streams are often quite verbose, ingesting them cost-efficiently means offloading the log data to S3 instead of CloudWatch. ALB logs even don't offer a choice, those are stored on AWS S3 anyway. The tradeoff of storing logs on S3? It makes querying harder. As an answer, AWS created AWS Athena to facilitate querying structured S3 data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Out-of-the-box ALB and Flow Log queries
&lt;/h2&gt;

&lt;p&gt;Last year, &lt;a href="https://aws.amazon.com/about-aws/whats-new/2021/04/amazon-vpc-flow-logs-announces-out-of-box-integration-with-amazon-athena/"&gt;AWS released Flow Logs Athena integration&lt;/a&gt;. Taking away the pain of the Athena VPC Flow setup. A similar counterpart to easily query ALB logs is sadly missing for the moment... Well, until now! 😉&lt;/p&gt;

&lt;p&gt;In the background, the AWS Athena Flow log integration turned out to be a vanilla CloudFormation template that bootstraps some  Athena resources. I simply enhanced the template adding &lt;a href="https://aws.amazon.com/premiumsupport/knowledge-center/athena-analyze-access-logs/"&gt;Athena ALB log integration following AWS best practices&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To allow your account to easily query ALB and VPC Flow Logs, all you need to do is deploy &lt;a href="https://github.com/element7-io/aws-samples/blob/main/cfn-athena-logs.yaml"&gt;this CloudFormation template&lt;/a&gt;. The details of the template are described below.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here's the result:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--L7M48I5K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w3gqkszarx54lq5ufkeg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--L7M48I5K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w3gqkszarx54lq5ufkeg.png" alt="Overview" width="880" height="606"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zcIpdsYT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hd9xdmxh0tuf9jzv1fs9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zcIpdsYT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hd9xdmxh0tuf9jzv1fs9.png" alt="Queries" width="880" height="487"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The CloudFormation Log Stack in Detail
&lt;/h2&gt;

&lt;p&gt;The stack parameters:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;EnvironmentName&lt;/strong&gt;: to support multiple environments (DTAP). Examples: &lt;code&gt;dev&lt;/code&gt; or &lt;code&gt;prod&lt;/code&gt; &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Context&lt;/strong&gt;: The ALB log context, could be something like an application or account name.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;FlowLogsLocation&lt;/strong&gt;: the S3 location of the flow logs. Format: &lt;code&gt;s3://doc-example-bucket/prefix/AWSLogs/{account\_id}/vpcflowlogs/{region\_code}/&lt;/code&gt; &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AlbLogsLocation&lt;/strong&gt;: the S3 location of the ALB logs. Format: &lt;code&gt;s3://your-alb-logs-directory/AWSLogs/(account\_id}/elasticloadbalancing/{region\_code}/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;InitialPartitionDays&lt;/strong&gt;: the number of days (in the past) of log data that will be partitioned on setup.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The most essential resources in the stack are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An Athena Database&lt;/li&gt;
&lt;li&gt;An Athena workgroup&lt;/li&gt;
&lt;li&gt;An Athena Partitioned Table for the VPC Flow Logs&lt;/li&gt;
&lt;li&gt;An Athena Partitioned Table for ALB logs&lt;/li&gt;
&lt;li&gt;A Partitioner that will partition the log data for x amount of days in the past on setup&lt;/li&gt;
&lt;li&gt;A partitioner to daily partition new log data&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  A word on Partitioning Data in Athena
&lt;/h2&gt;

&lt;p&gt;By partitioning Athena Tables, you can restrict the amount of data scanned by each Athena query, &lt;strong&gt;thus improving performance and reducing cost&lt;/strong&gt;. You can partition your data by any key. A common practice is to partition the log data based on time. In this case, the data is partitioned by year, month and day, because it probably makes the most sense.&lt;/p&gt;

&lt;p&gt;To verify if a table is correctly partitioned you can run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;show&lt;/span&gt; &lt;span class="n"&gt;partitions&lt;/span&gt; &lt;span class="n"&gt;vpcflowlogs_non_prod&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gvusSCm6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ldf73p7x4oeup4dvldaj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gvusSCm6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ldf73p7x4oeup4dvldaj.png" alt="Partitions" width="744" height="712"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enjoy querying your logs and until next time!&lt;/p&gt;

</description>
      <category>cloud</category>
      <category>aws</category>
      <category>productivity</category>
      <category>devops</category>
    </item>
    <item>
      <title>How-to Use Static Stability to Design a Resilient Architecture</title>
      <dc:creator>Gert Leenders</dc:creator>
      <pubDate>Thu, 23 Dec 2021 08:26:49 +0000</pubDate>
      <link>https://dev.to/aws-heroes/how-to-use-static-stability-to-design-a-resilient-architecture-17p9</link>
      <guid>https://dev.to/aws-heroes/how-to-use-static-stability-to-design-a-resilient-architecture-17p9</guid>
      <description>&lt;h3&gt;
  
  
  TL;DR
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;Building a resilient architecture, it could help to separate systems along the control and data plane boundary. Once separated, focus on the data plane for targeting a higher availability. Because of its relative simplicity, a data plane is much better suited for High Availability than a control plane. Finally, introduce static stability by preparing yourself for impairments before they happen. Don't rely on reacting to impairments as they happen, it's less effective. A statically stable design is achieved once the overall system keeps working, even when a dependency becomes impaired!&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;Very recently, while browsing some online AWS documentation, I landed on a page about &lt;a href="https://aws.amazon.com/builders-library/static-stability-using-availability-zones/" rel="noopener noreferrer"&gt;Static stability using Availability Zones&lt;/a&gt;. Although that page had nothing to do with what I was looking after, I found the title quite intriguing. I had never heard about the concept before. Triggered, I decided to read the paper. It turned out to be one of the more interesting papers I've read in a while. The remainder of this post is a brief rehash of the paper, focussed on the core concept and supplemented with my thoughts.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Important note: although the paper originates from AWS, the concepts are not limited to the AWS Ecosystem but are broadly applicable in system design.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Before we start
&lt;/h3&gt;

&lt;p&gt;Because static stability is all about resilience, I need once more to rant a little on the importance of &lt;a href="https://docs.aws.amazon.com/wellarchitected/latest/reliability-pillar/disaster-recovery-dr-objectives.html" rel="noopener noreferrer"&gt;RTO and RPO&lt;/a&gt; first. I find it hard to understand that sometimes systems are being designed without knowing their recovery objectives. It seems impossible to make a great design without knowing these. A design that doesn't consider the recovery objectives from the start will inevitably result in over-or underengineering.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Always sort out the recovery objectives first before starting a system design!&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Static Stability?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;In a statically stable design, the overall system keeps working even when a dependency becomes impaired.&lt;/strong&gt; Perhaps the system doesn’t see any updated information that its dependency was supposed to have delivered. &lt;strong&gt;However, everything it was doing before the dependency became impaired continues to work despite the impaired dependency.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before we drill further down, we first need to talk about Availability Zones, because on AWS, availability zones are a main pillar of statically stable designs. Therefore a quick refresher of the definition of an Availably Zone: &lt;strong&gt;"an Availability Zone is one or more discrete data centers with redundant power, networking, and connectivity in an AWS Region".&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Over the years, when building systems on top of Availability Zones, AWS has learned to be ready for impairments before they happen&lt;/strong&gt;. A less effective approach might be to deploy to multiple Availability Zones with the expectation that, should there be an impairment within one Availability Zone, the service will scale up in other Availability Zones and be restored to full health. &lt;strong&gt;This approach is less effective because it relies on reacting to impairments as they happen, rather than being prepared for those impairments before they happen. In other words, it lacks static stability.&lt;/strong&gt; In contrast, a more effective, statically stable service would over-provision its infrastructure to the point where it would continue operating correctly without having to launch anything new, even if an Availability Zone were to become impaired.&lt;/p&gt;

&lt;p&gt;However, understanding static stability itself is only half the story. To properly apply the pattern to a system design, you need to understand a second concept: control and data planes.&lt;/p&gt;

&lt;p&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%2Ff0thpbk6ujd78k58ygwa.jpeg" 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%2Ff0thpbk6ujd78k58ygwa.jpeg" alt="Control Plane"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What is a Control and Data plane?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;A control plane is the machinery involved in making changes to a system&lt;/strong&gt; (adding resources, deleting resources, modifying resources) and getting those changes propagated to wherever they need to go to take effect. &lt;strong&gt;A data plane, in contrast, is the daily business of those resources, that is, what it takes for them to function.&lt;/strong&gt; Furthermore, It's crucial to understand that the data plane is usually far simpler than its control plane. &lt;strong&gt;As a result of its relative simplicity, a data plane is much better suited for targeting a higher availability than a control plane.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Putting it all together
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Separate systems along the control and data plane boundary
&lt;/h3&gt;

&lt;p&gt;The concepts of control planes, data planes, and static stability are broadly applicable in various system designs. Suppose you're able to decompose a system into its control plane and data plane. In that case, it might be a helpful conceptual tool for designing highly available services for several reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It's typical for the availability of the data plane to be even more critical to the success of the customers of a service than the control plane.&lt;/li&gt;
&lt;li&gt;It's typical for the data plane to operate at a higher volume (often by orders of magnitude) than its control plane. Thus, it's better to keep them separate so that each can be scaled according to its own relevant scaling dimensions.&lt;/li&gt;
&lt;li&gt;AWS found over the years that a system's control plane tends to have more moving parts than its data plane, so it's statistically more likely to become impaired for that reason alone.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Putting those considerations altogether, it seems a best practice to separate systems along the control and data plane boundary.&lt;/p&gt;

&lt;p&gt;Now, let's zoom in on some examples of Static Stable Designs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Design 1: Static Stability using an Active-Active setup on Availability Zones
&lt;/h3&gt;

&lt;p&gt;A common example of an active-active design on AZ's is a load-balanced HTTPS service. The diagram below shows a public-facing Load Balancer providing an HTTPS service. The load balancer's target is an Auto Scaling group that spans three Availability Zones. This is an example of active-active high availability using Availability Zones.&lt;/p&gt;

&lt;p&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%2Fzbj33szscxvfobxd8dl0.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%2Fzbj33szscxvfobxd8dl0.png" alt="Active-Active setup"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In the event of an Availability Zone impairment, this design requires no action.&lt;/strong&gt; The instances in the impaired Availability Zone will start failing health checks, and the Load Balancer will shift traffic away from them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Design 2: Static Stability using an Active-standby on Availability Zones
&lt;/h3&gt;

&lt;p&gt;The next diagram shows an Amazon RDS database. In this case, the RDS database setup spans multiple Availability Zones. In a multi-AZ setup Amazon RDS puts the standby candidate in a different Availability Zone from the primary node. In this setup, when the Availability Zone with the primary node becomes impaired, the stateful service does nothing with the infrastructure. In the background, RDS will manage the failover and then repoint the DNS name to the new primary in the working Availability Zone.&lt;/p&gt;

&lt;p&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%2F10pacbzzpgjx4fc0acxd.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%2F10pacbzzpgjx4fc0acxd.png" alt="Active-standby"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;These two patterns have in common that both of them had already provisioned the capacity they’d need in the event of an Availability Zone impairment well in advance of any actual impairment.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  The principle of independent Availability Zones
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;A third way to use the principle of independent Availability Zones is to design a packet flow to stay within an Availability Zone rather than crossing boundaries.&lt;/strong&gt; Keeping network traffic local to the Availability Zone is worth exploring in more detail. The following diagram illustrates a highly available external service, shown in orange, that depends on another, internal service, shown in green. A straightforward design treats both of these services as consumers of independent EC2 Availability Zones. &lt;br&gt;
Each of the orange and green services is fronted by a Load Balancer, and each service has a well-provisioned fleet of backend hosts spread across three Availability Zones. One highly available regional service calls another highly available regional service. This is a simple design, and for many of the services we’ve built, it's a good design.&lt;/p&gt;

&lt;p&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%2F54dnrwqyck3m2q6yi83y.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%2F54dnrwqyck3m2q6yi83y.png" alt="HA Service"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Suppose, however, that the green service is a foundational service. That is, suppose it is intended not only to be highly available but also, itself, to serve as a building block for providing Availability Zone independence. In that case, you might instead design it as three instances of a zone-local service, on which we follow Availability Zone-aware deployment practices.&lt;/strong&gt; The following diagram illustrates the design in which a highly available regional service calls a highly available zonal service.&lt;/p&gt;

&lt;p&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%2Fif3zjau9c9mj1ty38mgl.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%2Fif3zjau9c9mj1ty38mgl.png" alt="Zone local"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The reasons to design a building-block service to be Availability Zone independent comes down to simple arithmetic.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In a system where one highly available regional service calls another highly available regional service and a request is sent through the system, then with some simplifying assumptions, the chance of the request avoiding the impaired Availability Zone is 2/3 * 2/3 = 4/9. That is, the request has worse than even odds of steering clear of the event.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In contrast, if you built the green service to be a zonal service&lt;/strong&gt;, then the hosts in the orange service can call the green endpoint in the same Availability Zone. With this architecture, &lt;strong&gt;the chances of avoiding the impaired Availability Zone are 2/3&lt;/strong&gt;. If N services are a part of this call path, then these numbers generalize to (2/3)^N for N regional services versus remaining constant at 2/3 for N zonal services!&lt;/p&gt;

&lt;p&gt;I hope you enjoyed reading about the concept of static stability and the principles of independent AZ's as much as I did. 😉&lt;/p&gt;

&lt;p&gt;Kudos to &lt;a href="https://aws.amazon.com/builders-library/authors/becky-weiss/" rel="noopener noreferrer"&gt;Becky Weiss&lt;/a&gt; and &lt;a href="https://aws.amazon.com/builders-library/authors/mike-furr/" rel="noopener noreferrer"&gt;Mike Furr&lt;/a&gt;, the authors of the original AWS paper about Static Stability.&lt;/p&gt;

&lt;p&gt;Until next time!&lt;/p&gt;

</description>
      <category>aws</category>
      <category>architecture</category>
      <category>devops</category>
      <category>cloud</category>
    </item>
    <item>
      <title>AWS RDS Backup Dilemma: Why It is Hard to Do Good on RTO and RPO Simultaneously</title>
      <dc:creator>Gert Leenders</dc:creator>
      <pubDate>Thu, 09 Dec 2021 20:11:56 +0000</pubDate>
      <link>https://dev.to/aws-heroes/aws-rds-backup-dilemma-why-it-is-hard-to-do-good-on-rto-and-rpo-simultaneously-24pl</link>
      <guid>https://dev.to/aws-heroes/aws-rds-backup-dilemma-why-it-is-hard-to-do-good-on-rto-and-rpo-simultaneously-24pl</guid>
      <description>&lt;h2&gt;
  
  
  Objectives and Disaster recovery
&lt;/h2&gt;

&lt;p&gt;Because a disaster event can potentially take down a workload, your objective for Disaster Recovery should be bringing your workload back up or avoiding downtime altogether. &lt;strong&gt;A recovery strategy itself is most often built upon two objectives.&lt;/strong&gt; RTO and RPO:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Recovery time objective (RTO)&lt;/strong&gt; is the maximum acceptable delay between the interruption of service and restoration of service. This determines what is considered an acceptable time window when service is unavailable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Recovery point objective (RPO)&lt;/strong&gt; is the maximum acceptable amount of time since the last data recovery point. This determines what is considered an acceptable loss of data between the last recovery point and the interruption of service.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  (Database) Backups
&lt;/h2&gt;

&lt;p&gt;Needless to say, a vast majority of software projects still contain some kind of database in their setup. That persistent data store is often also one of the main subjects in the disaster recovery strategy. Backups are the answer to this issue. &lt;strong&gt;In the context of AWS RDS, there are two options for doing Database backups:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;RDS DB snapshots&lt;/strong&gt;: a storage volume snapshot of your DB instance, backing up the entire DB instance and not just individual databases. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;RDS Recovery Point in Time&lt;/strong&gt;: this allows you to restore a DB instance to a specific point in time, creating a new DB instance.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Dilemma
&lt;/h2&gt;

&lt;p&gt;So far the introduction, to make my point, we need to set some objectives first. I don't want to push it to the extreme, so let's put some reasonable figures for RTO and RPO:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;RTO: 30 mins, preferably less&lt;/li&gt;
&lt;li&gt;RPO: 1h, preferably less&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;No questions asked, the less data we lose when recovering, the better. With this in mind, "Recovery Point in Time" always seems the better option.&lt;/strong&gt; But is it? Have you ever tried doing a "Point in Time recovery"? Although offering better RPO, is there any difference regarding RTO? While not all that obvious, yes there is! &lt;strong&gt;Point in Time recovery requires more time to restore your data.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  "Recovery Point in Time" behind the scenes.
&lt;/h3&gt;

&lt;p&gt;To understand why a point in time restore is slower, we need to know how it works. &lt;strong&gt;To do its point-in-time magic, regular snapshots are taken from time to time. On top of that, to prevent losing as little data as possible, a &lt;a href="https://dev.mysql.com/doc/refman/8.0/en/point-in-time-recovery-binlog.html"&gt;binary log&lt;/a&gt; containing all operations (aka oplog or operations log) is stored (on AWS S3).&lt;/strong&gt; So whenever you run a Point in Time recovery, there's added time to replay the operations log on top of the regular snapshot restore time. Of course, the extra time will depend on the age of the snapshot and the number of average manipulations that you run on the database. &lt;strong&gt;But inevitably, it will take you extra time.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So here's your dilemma: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Do you choose regular DB snapshots offering a likely lower RPO but faster RTO" vs. "Do you choose Point in time restore offering better RPO but slower RTO?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;No, you can't have the best RPO without paying a price for it.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What have I learned?
&lt;/h2&gt;

&lt;p&gt;In my case, it's okay to lose some data, and in fact, my service can live with an RPO of 1 hour. On the other hand, the better our RTO, the happier business will be in case of a catastrophe. &lt;br&gt;
&lt;strong&gt;Those objectives made us drop "Recovery Point in Time Restore" and daily backup instead of just hourly snapshots. This new approach will offer us a one-hour RPO with the best possible RTO.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;After all, testing the Disaster Recovery Plan to sort out all those assumptions taught me a lot 😉&lt;/p&gt;

&lt;h3&gt;
  
  
  A small update: DB Snapshot Restore uses lazy loading
&lt;/h3&gt;

&lt;p&gt;After reading this blog, fellow AWS Hero &lt;a href="https://aws.amazon.com/developer/community/heroes/renato-losio/"&gt;Renato Losio&lt;/a&gt; pointed out another factor to consider regarding RTO when an RDS Snapshot restore is performed: &lt;a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_RestoreFromSnapshot.html"&gt;Lazy loading&lt;/a&gt;. It is something I was completely unaware of, although it’s all in docs:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You can create a new DB instance by restoring from a DB snapshot. You can use the restored DB instance as soon as its status is &lt;code&gt;available&lt;/code&gt;. However, the DB instance continues to load data in the background. This is known as lazy loading. Furthermore, If you access data that hasn't been loaded yet, the DB instance immediately downloads the requested data from Amazon S3, and then continues loading the rest of the data in the background.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;There’s even a way to  diminish these effects:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;To help mitigate the effects of lazy loading on tables to which you require quick access, you can perform operations that involve full-table scans, such as &lt;code&gt;SELECT *&lt;/code&gt;. This allows Amazon RDS to download all of the backed-up table data from S3.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;From: &lt;a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_RestoreFromSnapshot.html"&gt;https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_RestoreFromSnapshot.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Kudos to Renato for making me aware of this!&lt;/p&gt;

&lt;p&gt;Enjoy and until next time!&lt;/p&gt;

</description>
      <category>aws</category>
      <category>cloud</category>
      <category>architecture</category>
      <category>devops</category>
    </item>
    <item>
      <title>AWS re:Invent 2021 recap by a DevTools Hero</title>
      <dc:creator>Gert Leenders</dc:creator>
      <pubDate>Mon, 06 Dec 2021 11:02:05 +0000</pubDate>
      <link>https://dev.to/aws-heroes/aws-reinvent-2021-recap-by-a-devtools-hero-147e</link>
      <guid>https://dev.to/aws-heroes/aws-reinvent-2021-recap-by-a-devtools-hero-147e</guid>
      <description>&lt;p&gt;With another amazing re:Invent edition behind us, It's time for a little recap. This edition was also my first as an AWS Hero. Looking back, I must say AWS knows how to please its community members. This year AWS even gave us our own special AWS Hero Lounge! Kudos AWS for the overall support and pampering. It was crazy. &lt;/p&gt;

&lt;p&gt;Before I start my recap, I want to say that even with all the nasty Covid-19 restrictions, I really enjoyed this year re:Invent. Personally, I find it hard to 'virtually' attend conferences. Being at a conference in person,  feeling the vibes and atmosphere, is kind of a must for me.&lt;/p&gt;

&lt;p&gt;So here's my first piece of advice: if you feel comfortable with it, I would strongly recommend attending re:Invent &lt;strong&gt;in person&lt;/strong&gt;.  All the great sessions are just a tiny part of the conference's value. What makes attending re:Invent stand out for me are all the AWS experts hanging around. The technical knowledge and expertise of all the people you can talk to at the conference are mind-blowing. It's a great place to pick some brains 😛&lt;/p&gt;

&lt;h2&gt;
  
  
  Content wise
&lt;/h2&gt;

&lt;p&gt;Before jumping into the list of the newly announced stuff I like the most. I must stress that such a list is very personal and heavily influenced by someone's background. Having a Developer background myself and a strong interest in DevOps and Security is reflected in my list. On top of that, the list also matches the services I primarily work with daily.&lt;/p&gt;

&lt;p&gt;All that said, here we go.&lt;/p&gt;

&lt;h3&gt;
  
  
  Application Integration
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/about-aws/whats-new/2021/12/amazon-sqs-dead-letter-queue-management-experience-queues/"&gt;Amazon SQS Enhances Dead-letter Queue Management Experience For Standard Queues&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://aws.amazon.com/about-aws/whats-new/2021/11/aws-lambda-partial-batch-response-sqs-event-source/"&gt;AWS Lambda now supports partial batch response for SQS as an event source&lt;/a&gt; With this feature, when messages on an SQS queue fail to process, Lambda marks a batch of records in a message queue as partially successful and allows reprocessing of only the failed records.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Containers / Compute / Serverless
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://beabetterdev.com/2021/11/21/aws-releases-lambda-function-urls-finally/"&gt;AWS Releases Lambda Function URLs finally...NOT&lt;/a&gt;. I guess it's still only a matter of time before this one gets out.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://aws.amazon.com/about-aws/whats-new/2021/11/amazon-ecr-cache-repositories/"&gt;Amazon ECR announces pull through cache repositories&lt;/a&gt;. This new feature allows you to automatically sync images from publicly accessible registries. Yes, I was waiting on that one ;-)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://aws.amazon.com/about-aws/whats-new/2021/11/aws-compute-optimizer-resource-efficiency-metrics/"&gt;AWS Compute Optimizer now offers resource efficiency metrics&lt;/a&gt;. AWS Compute Optimizer now helps you quickly identify and prioritize top optimization opportunities through two new sets of dashboard-level metrics: savings opportunity and performance improvement opportunity.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://aws.amazon.com/about-aws/whats-new/2021/11/aws-compute-optimizer-enhanced-infrastructure-metrics-ec2-instances/"&gt;AWS Compute Optimizer now offers enhanced infrastructure metrics, a new feature for EC2 recommendations&lt;/a&gt;. AWS Compute Optimizer now offers enhanced infrastructure metrics, a paid feature that when activated, enhances your Amazon EC2 instance and Auto Scaling group recommendations by capturing monthly or quarterly utilization patterns.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Database
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://aws.amazon.com/about-aws/whats-new/2021/12/amazon-dynamodb-standard-infrequent-access-table-class/"&gt;Amazon DynamoDB announces the new Amazon DynamoDB Standard-Infrequent Access table class, which helps you reduce your DynamoDB costs by up to 60 percent&lt;/a&gt; Another cool feature to help bringing those bills down effortless. 👌&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Developer Tools
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://aws.amazon.com/about-aws/whats-new/2021/12/aws-cloud-development-kit-cdk-generally-available/"&gt;AWS Cloud Development Kit (AWS CDK) v2&lt;/a&gt; and  &lt;a href="https://aws.amazon.com/about-aws/whats-new/2021/12/aws-construct-hub-availability/"&gt;Construct Hub&lt;/a&gt; are now generally available&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://aws.amazon.com/about-aws/whats-new/2021/12/aws-amplify-studio/"&gt;Introducing AWS Amplify Studio&lt;/a&gt;: a visual development environment that offers frontend developers new features to accelerate UI development with minimal coding.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/about-aws/whats-new/2021/12/aws-sdk-swift-developer-preview/"&gt;AWS SDK for Swift (Developer Preview)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/about-aws/whats-new/2021/12/aws-sdk-kotlin-developer-preview/"&gt;AWS SDK for Kotlin (Developer Preview)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/about-aws/whats-new/2021/12/aws-sdk-rust-developer-preview/"&gt;AWS SDK for Rust (Developer Preview)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Management &amp;amp; Governance
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://aws.amazon.com/about-aws/whats-new/2021/11/amazon-cloudwatch-metrics-insights-preview/"&gt;Introducing Amazon CloudWatch Metrics Insights&lt;/a&gt;. As a fast, flexible, SQL based query engine, Metrics Insights enables you to identify trends and patterns across millions of metrics in real time and helps you use these insights to reduce time to resolution.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://aws.amazon.com/about-aws/whats-new/2021/11/amazon-cloudwatch-rum-applications-client-side-performance/"&gt;Introducing Amazon CloudWatch RUM for monitoring applications’ client-side performance&lt;/a&gt;. Amazon CloudWatch RUM is a real-user monitoring capability that helps you identify and debug issues in the client-side on web applications and enhance end user’s digital experience.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://aws.amazon.com/about-aws/whats-new/2021/11/amazon-cloudwatch-evidently-feature-experimentation-safer-launches/"&gt;Introducing Amazon CloudWatch Evidently for feature experimentation and safer launches&lt;/a&gt;. This is a new Amazon CloudWatch capability that makes it easy for developers to introduce experiments and feature management in their application code. CloudWatch Evidently may be used for two similar but distinct use-cases: implementing dark launches, also known as feature flags, and A/B testing.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://aws.amazon.com/about-aws/whats-new/2021/12/amazon-virtual-private-cloud-vpc-announces-ip-address-manager-ipam/"&gt;Amazon Virtual Private Cloud (VPC) announces IP Address Manager (IPAM) to help simplify IP address management on AWS&lt;/a&gt; Using IPAM, you can automate IP address assignment to VPCs, eliminating the need to use spreadsheet-based or homegrown IP planning applications, which can be hard to maintain and time-consuming. This automation helps remove delays in on-boarding new applications or growing existing applications, by enabling you to assign IP addresses to your VPCs in seconds. IPAM also automatically tracks critical IP address information, including its AWS account, Amazon VPC, and routing and security domain, eliminating the need to manually track or do bookkeeping for IP addresses.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://aws.amazon.com/about-aws/whats-new/2021/11/aws-chatbot-management-resources-slack/"&gt;AWS Chatbot now supports management of AWS resources in Slack (Preview)&lt;/a&gt;. This feature allows you to use AWS Chatbot to manage AWS resources and remediate issues in AWS workloads by running AWS CLI commands from Slack channels.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Security
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://aws.amazon.com/about-aws/whats-new/2021/12/aws-shield-advanced-application-layer-ddos-mitigation/"&gt;AWS Shield Advanced introduces automatic application-layer DDoS mitigation&lt;/a&gt;. AWS Shield Advanced now automatically protects web applications by blocking application layer (Layer 7) DDoS events with no manual intervention needed by you or the AWS Shield Response Team (SRT)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://aws.amazon.com/about-aws/whats-new/2021/12/amazon-vpc-network-access-analyzer/"&gt;Amazon Virtual Private Cloud (VPC) announces Network Access Analyzer to help you easily identify unintended network access&lt;/a&gt; Amazon VPC Network Access Analyzer is a new feature that enables you to identify unintended network access to your resources on AWS. Using Network Access Analyzer, you can verify whether network access for your Virtual Private Cloud (VPC) resources meets your security and compliance guidelines &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://aws.amazon.com/about-aws/whats-new/2021/11/amazon-inspector-continual-vulnerability-management/"&gt;AWS announces the new Amazon Inspector for continual vulnerability management&lt;/a&gt; This is a big one. In a nutshell the new Inspector provides:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Continual, automated assessment scans&lt;/strong&gt;—replaces periodic, manual scanning.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automated resource discovery&lt;/strong&gt; – once enabled, the new Amazon Inspector automatically discovers all running Amazon EC2 instances and Amazon ECR repositories.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;New support for container-based workloads&lt;/strong&gt;—workloads are now assessed on both EC2 and container infrastructure.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integration with AWS Organizations—&lt;/strong&gt;allowing security and compliance teams to enable and take advantage of Amazon Inspector across all accounts in an organization.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Removal of the stand-alone Amazon Inspector scanning agent&lt;/strong&gt;—assessment scanning now uses the widely deployed AWS Systems Manager agent, eliminating the need for a separate agent installation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Improved risk scoring&lt;/strong&gt; —a highly contextualized risk score is now generated for each finding making it easier to identify the most critical vulnerabilities to address as a priority.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integration with Amazon EventBridge&lt;/strong&gt; —integrate with event management and workflow systems such as Splunk and Jira. And, you can trigger automated remediation.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Integration with AWS Security Hub&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Storage
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://aws.amazon.com/about-aws/whats-new/2021/11/amazon-s3-glacier-instant-retrieval-storage-class/"&gt;Announcing the new Amazon S3 Glacier Instant Retrieval storage class.  The lowest cost archive storage with milliseconds retrieval.&lt;/a&gt;
This new Glacier archive storage class delivers the lowest cost storage for long-lived data that is rarely accessed and requires milliseconds retrieval. 
In fact, in combination with the &lt;a href="https://aws.amazon.com/about-aws/whats-new/2021/11/s3-intelligent-tiering-archive-instant-access-tier/"&gt;Amazon S3 Intelligent-Tiering storage class this automatically save up to 68%&lt;/a&gt; for data not accessed in the last 90 days. Really nice 💪&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://aws.amazon.com/about-aws/whats-new/2021/11/amazon-s3-object-ownership-simplify-access-management-data-s3/"&gt;Amazon S3 Object Ownership can now disable access control lists to simplify access management for data in S3&lt;/a&gt;. This new S3 Object Ownership setting, &lt;em&gt;'Bucket owner enforced'&lt;/em&gt;, disables access control lists (ACLs), simplifying access management for data stored in S3. When you apply this bucket-level setting, every object in an S3 bucket is owned by the bucket owner, and ACLs are no longer used to grant permissions.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://aws.amazon.com/about-aws/whats-new/2021/11/aws-backup-amazon-s3-backup/"&gt;Announcing preview of AWS Backup for Amazon S3&lt;/a&gt;. This allows you to create a single policy in AWS Backup to automate the protection of application data stored in S3 alone.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/about-aws/whats-new/2021/11/amazon-s3-event-notifications-amazon-eventbridge-build-advanced-serverless-applications/"&gt;Amazon S3 Event Notifications with Amazon EventBridge help you build advanced serverless applications faster&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Yeah, I'm sure I missed at least a few announces 😉&lt;/p&gt;

&lt;p&gt;Enjoy an until next time!&lt;/p&gt;

</description>
      <category>aws</category>
      <category>security</category>
      <category>devops</category>
    </item>
    <item>
      <title>Ransomware Mitigation: The New Vault Lock for AWS Backup</title>
      <dc:creator>Gert Leenders</dc:creator>
      <pubDate>Fri, 05 Nov 2021 16:06:05 +0000</pubDate>
      <link>https://dev.to/aws-heroes/ransomware-mitigation-the-new-vault-lock-for-aws-backup-3f89</link>
      <guid>https://dev.to/aws-heroes/ransomware-mitigation-the-new-vault-lock-for-aws-backup-3f89</guid>
      <description>&lt;p&gt;Very recently, &lt;a href="https://aws.amazon.com/about-aws/whats-new/2021/10/aws-backup-backup-protection-aws-backup-vault-lock/"&gt;AWS announced Vault Lock for AWS backup&lt;/a&gt;. This new feature enables the protection of backups from accidental or malicious actions.  Behind the scenes, this extra safeguard is made possible by storing backups using a Write-Once-Read-Many (WORM) model. &lt;br&gt;
Additionally, using a simple setting, you can now also prevent users from deleting backups or changing their retention periods, providing an additional layer of data protection!&lt;/p&gt;

&lt;p&gt;The main reason to rehash this? Unique features like this seem to stay under the radar way too often. Secondly, if you already use AWS Backup, then enabling this extra protection is almost effortless.&lt;/p&gt;

&lt;p&gt;Here's an example of AWS Backup Vault using Locks in CloudFormation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;  &lt;span class="na"&gt;SomeBackupVault&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;Type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;AWS::Backup::BackupVault&lt;/span&gt;
    &lt;span class="na"&gt;DeletionPolicy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Retain&lt;/span&gt;
    &lt;span class="na"&gt;UpdateReplacePolicy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Retain&lt;/span&gt;
    &lt;span class="na"&gt;Properties&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;BackupVaultName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;SomeBackupVault&lt;/span&gt;
      &lt;span class="na"&gt;Notifications&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;BackupVaultEvents&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;BACKUP_JOB_FAILED&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;BACKUP_JOB_EXPIRED&lt;/span&gt;
        &lt;span class="na"&gt;SNSTopicArn&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;!Ref&lt;/span&gt; &lt;span class="s"&gt;AlertSnsTopic&lt;/span&gt;
      &lt;span class="na"&gt;LockConfiguration&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;ChangeableForDays&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;
        &lt;span class="na"&gt;MaxRetentionDays&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;180&lt;/span&gt;
        &lt;span class="na"&gt;MinRetentionDays&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;14&lt;/span&gt;

  &lt;span class="na"&gt;SomeBackupPlan&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;Type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;AWS::Backup::BackupPlan&lt;/span&gt;
    &lt;span class="na"&gt;Properties&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;BackupPlan&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;BackupPlanName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;SomeBackupPlan&lt;/span&gt;
        &lt;span class="na"&gt;BackupPlanRule&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;RuleName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Daily14DaysRetention&lt;/span&gt;
            &lt;span class="na"&gt;TargetBackupVault&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;!Ref&lt;/span&gt; &lt;span class="s"&gt;SomeBackupVault&lt;/span&gt;
            &lt;span class="na"&gt;ScheduleExpression&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;cron(0&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;2&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;*&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;*&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;?&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;*)"&lt;/span&gt;
            &lt;span class="na"&gt;StartWindowMinutes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;60&lt;/span&gt;
            &lt;span class="na"&gt;Lifecycle&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;DeleteAfterDays&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;14&lt;/span&gt;

  &lt;span class="na"&gt;TagBasedBackupSelection&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;Type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;AWS::Backup::BackupSelection&lt;/span&gt;
    &lt;span class="na"&gt;Properties&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;BackupSelection&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;SelectionName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;TagBasedBackupSelection&lt;/span&gt;
        &lt;span class="na"&gt;IamRoleArn&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;!Sub&lt;/span&gt; &lt;span class="s"&gt;arn:${AWS::Partition}:iam::${AWS::AccountId}:role/service-role/AWSBackupDefaultServiceRole&lt;/span&gt;
        &lt;span class="na"&gt;ListOfTags&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
         &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;ConditionType&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;STRINGEQUALS&lt;/span&gt;
           &lt;span class="na"&gt;ConditionKey&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;backup&lt;/span&gt;
           &lt;span class="na"&gt;ConditionValue&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;daily&lt;/span&gt;
      &lt;span class="na"&gt;BackupPlanId&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;!Ref&lt;/span&gt; &lt;span class="s"&gt;SomeBackupPlan&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The new properties to enable a Vault lock are under the &lt;code&gt;LockConfiguration&lt;/code&gt; key of the &lt;code&gt;AWS::Backup::BackupVault&lt;/code&gt; resource:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ChangeableForDays: specifies the number of days before the lock date. For example, setting ChangeableForDays to 30 on Jan. 1, 2022 at 8pm UTC will set the lock date to Jan. 31, 2022 at 8pm UTC. &lt;strong&gt;AWS Backup enforces a 72-hour cooling-off period before Vault Lock takes effect and becomes immutable. Therefore, you must set ChangeableForDays to 3 or greater.&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;MaxRetentionDays: specifies the maximum retention period that the vault retains its recovery points.&lt;/li&gt;
&lt;li&gt;MinRetentionDays: specifies the minimum retention period that the vault retains its recovery points.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;From: &lt;a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-backup-backupvault-lockconfigurationtype.htm"&gt;AWS::Backup::BackupVault LockConfigurationType&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want to go more in-depth on this feature, check out: &lt;a href="https://aws.amazon.com/blogs/storage/enhance-the-security-posture-of-your-backups-with-aws-backup-vault-lock/"&gt;Enhance the security posture of your backups with AWS Backup Vault Lock&lt;/a&gt;. You also find a step-by-step walkthrough to enable this feature using the AWS Web Console on that post.&lt;/p&gt;

&lt;p&gt;Enjoy an until next time!&lt;/p&gt;

</description>
      <category>cloud</category>
      <category>security</category>
      <category>aws</category>
    </item>
    <item>
      <title>AWS API Gateway Best Practices in-depth</title>
      <dc:creator>Gert Leenders</dc:creator>
      <pubDate>Mon, 14 Jun 2021 15:30:01 +0000</pubDate>
      <link>https://dev.to/aws-heroes/aws-api-gateway-best-practices-in-depth-4l0n</link>
      <guid>https://dev.to/aws-heroes/aws-api-gateway-best-practices-in-depth-4l0n</guid>
      <description>&lt;h2&gt;
  
  
  Best Practices
&lt;/h2&gt;

&lt;p&gt;Forgive me, the &lt;a href="https://en.wikipedia.org/wiki/Bart_Simpson" rel="noopener noreferrer"&gt;Bart Simpson&lt;/a&gt; in me couldn't resist using 'Best Practices' once again. Sure, there's a lot to say &lt;a href="https://www.satisfice.com/blog/archives/5164" rel="noopener noreferrer"&gt;to stamp out “best practice”&lt;/a&gt; and I agree with most arguments in the article. Framing something as a best practice is subjective, and it could give the impression of being arrogant. But, as grown-ups, I'm convinced most of us know how to deal with the term and see why it's used. So pick the practices you agree on, which you see as 'best' practices yourself.&lt;/p&gt;

&lt;h2&gt;
  
  
  A front  door: The importance of API Gateway
&lt;/h2&gt;

&lt;p&gt;I have the feeling that the importance of API Gateway in a setup is sometimes overlooked. AWS wrote down the practices themselves (also using the term 'Best practices 😉). But IMHO, their &lt;a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/security-best-practices.html" rel="noopener noreferrer"&gt;documentation&lt;/a&gt; is a tad too brief. Also, the documentation lacks a 'WHY' in general.&lt;/p&gt;

&lt;h3&gt;
  
  
  The 'WHY'
&lt;/h3&gt;

&lt;p&gt;Assuming the vast majority of API Gateways are public-facing, it's easy to picture an API Gateway as a front door. One of the characteristics of a front door is access control: who to let in and how many to let it (at once). &lt;/p&gt;

&lt;p&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%2F4o2512zlg1dag8q5tmgq.jpeg" 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%2F4o2512zlg1dag8q5tmgq.jpeg" alt="Front door"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Nowadays, a front door camera even provides a track record of everyone that came across your door, logging all rejected and allowed entrance calls. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;That being said, API Gateway is a front door, treat it like one!&lt;/strong&gt; It's begging for attention security-wise.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Importance of Logs.
&lt;/h2&gt;

&lt;p&gt;People less familiar with security, easily miss the importance of logs. But whoever encountered a security breach will endorse their significance. In case something gets compromised, investigation often starts with looking at access logs. &lt;strong&gt;That is why every public endpoint (Web Server, Load Balancer, API Gateways, ...) should have access logs enabled. If you would ask me, access logs should be mandatory, non-negotiable.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Knowing this, I find it hard to understand why AWS Security hub only recommends &lt;a href="https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-standards-fsbp-controls.html#apigateway-1-remediation" rel="noopener noreferrer"&gt;API logs to be enabled&lt;/a&gt;. I have no clue why access logs didn't make it to the &lt;a href="https://aws.amazon.com/about-aws/whats-new/2021/06/aws-security-hub-adds-16-new-controls-to-its-foundational-securi/" rel="noopener noreferrer"&gt;Foundational Security Best Practices standard for CSPM&lt;/a&gt; 😟. I hope AWS will settle this in the next iteration.&lt;/p&gt;

&lt;h3&gt;
  
  
  Access Log Retention Period
&lt;/h3&gt;

&lt;p&gt;As a retention period for access logs, I recommend at least one year. To save costs, you could only retain them in CloudWatch for one month. After 30 days, you could transfer them to something like S3. &lt;/p&gt;

&lt;p&gt;If a year sounds long, notice that breaches sometimes stay under the radar for quite some time. To tackle this, ensure your track record is long enough to allow successful investigation in case of trouble.&lt;/p&gt;

&lt;p&gt;For the ones using CloudFormation and AWS SAM, here's the IaC:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;  &lt;span class="na"&gt;ApiAccessLogGroup&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;Type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;AWS::Logs::LogGroup&lt;/span&gt;
    &lt;span class="na"&gt;Properties&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;LogGroupName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;!Sub&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;servicename-api-${environment}-ApiGateway-cfn"&lt;/span&gt;
      &lt;span class="na"&gt;RetentionInDays&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;30&lt;/span&gt;

  &lt;span class="na"&gt;SomeServiceGateway&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;Type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;AWS::Serverless::Api&lt;/span&gt;
    &lt;span class="na"&gt;Properties&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;Name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;!Sub&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Someservice&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;API&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;GW&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;-&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;${environment}"&lt;/span&gt;
      &lt;span class="na"&gt;StageName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;v1"&lt;/span&gt;
      &lt;span class="na"&gt;EndpointConfiguration&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;REGIONAL&lt;/span&gt;
      &lt;span class="na"&gt;TracingEnabled&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;True&lt;/span&gt;
      &lt;span class="na"&gt;MethodSettings&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;LoggingLevel&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;INFO&lt;/span&gt;
          &lt;span class="na"&gt;MetricsEnabled&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;True&lt;/span&gt;
          &lt;span class="na"&gt;DataTraceEnabled&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;True&lt;/span&gt;
          &lt;span class="na"&gt;ResourcePath&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/*"&lt;/span&gt;
          &lt;span class="na"&gt;HttpMethod&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;*"&lt;/span&gt;
      &lt;span class="na"&gt;AccessLogSetting&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;DestinationArn&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;!GetAtt&lt;/span&gt; &lt;span class="s"&gt;ApiAccessLogGroup.Arn&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Protecting an Unauthorized API Gateway
&lt;/h2&gt;

&lt;p&gt;Unauthenticated API routes are open to the world. Therefore it's recommended to limit their use. It’s important to protect these unauthenticated API's against common risks, such as denial-of-service attacks or consumer errors.&lt;/p&gt;

&lt;h3&gt;
  
  
  AWS WAF
&lt;/h3&gt;

&lt;p&gt;Applying AWS WAF to API Gateway helps to protect an application from SQL injection and cross-site scripting attacks. &lt;strong&gt;It's your first line of defense.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  AWS CloudFront as traffic absorber
&lt;/h3&gt;

&lt;p&gt;In case of a denial of service attack on an unauthenticated API, it’s possible to exhaust API throttling limits, Lambda concurrency, or DynamoDB provisioned read capacity on an underlying table. Putting an AWS CloudFront distribution in front of the API endpoint with an appropriate time-to-live configuration may help absorb traffic in a DoS attack without changing the underlying solution for fetching the data.&lt;/p&gt;

&lt;p&gt;See: "&lt;a href="https://aws.amazon.com/blogs/compute/operating-lambda-building-a-solid-security-foundation-part-2/" rel="noopener noreferrer"&gt;Operating Lambda: Building a solid security foundation – Part 2&lt;/a&gt;" for more information.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use API keys and Throttling
&lt;/h3&gt;

&lt;p&gt;API Gateway allows throttling when API keys are used. &lt;/p&gt;

&lt;p&gt;Use API Keys for unauthenticated API's when possible and never trust consumers 😉. Needless to say that negotiated contracts with (API) consumers change over time.  Often these changes aren't briefed. Or maybe a consumer's business just grows, together with the requests he's sending you. But even without any reason, if a consumer sends you a few hundred thousand requests instead of the few hundreds he promised to... who will feel the pain? You or him?&lt;/p&gt;

&lt;p&gt;With this in mind, design (your API Gateway) for error. The last thing you want is a drowned service due to a consumer's error. &lt;strong&gt;&lt;a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-request-throttling.html" rel="noopener noreferrer"&gt;Throttling&lt;/a&gt; should be enabled by default on your API Gateway. It will prevent you from resource exhaustion, or even worse, scaling to the moon (together with your AWS bill). If a consumer breaks his quota, he should get a &lt;code&gt;429 Too Many Requests&lt;/code&gt; for coloring outside the lines. Let him feel the pain, not you!&lt;/strong&gt;&lt;/p&gt;

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

&lt;p&gt;Both throttling and logging are easy to enable but can be a real-lifesaver. Forewarned is forearmed.&lt;/p&gt;

&lt;p&gt;Enjoy and until next time!&lt;/p&gt;

</description>
      <category>aws</category>
      <category>security</category>
      <category>cloud</category>
      <category>devops</category>
    </item>
    <item>
      <title>The Quirks of Software Effort Estimation</title>
      <dc:creator>Gert Leenders</dc:creator>
      <pubDate>Mon, 07 Jun 2021 17:46:38 +0000</pubDate>
      <link>https://dev.to/glnds/the-quirks-of-software-effort-estimation-1f10</link>
      <guid>https://dev.to/glnds/the-quirks-of-software-effort-estimation-1f10</guid>
      <description>&lt;p&gt;One of the most complex parts of Software Development is effort estimation. Over the years, I encountered some interesting concepts and laws regarding this topic that I would like to share. Being aware of these mechanics helped me to interpret and make estimates.&lt;/p&gt;

&lt;p&gt;Here we go...&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Accuracy vs. Precision
&lt;/h2&gt;

&lt;p&gt;Probably the most important topic on the list.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Precision&lt;/strong&gt; is how close measure values are to each other, basically how many decimal places are at the end of a given measurement. &lt;br&gt;
&lt;strong&gt;Accuracy&lt;/strong&gt; is how close a measure value is to the true value. &lt;/p&gt;

&lt;p&gt;Precision is independent of accuracy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Estimates should be accurate, not precise.&lt;/strong&gt; It’s fine to say something will take two to six weeks. Most likely that's accurate, although not precise. Being more precise often leads to being less accurate. I challenge you to make a significant accurate estimate with minute precision 😉&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--L5TyaBD7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3e5mizuizbiw7tkiu9iw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--L5TyaBD7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3e5mizuizbiw7tkiu9iw.png" alt="Accuracy"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The "Scotty Principle"
&lt;/h2&gt;

&lt;p&gt;From &lt;a href="https://lifehacker.com/how-to-inflate-tasks-and-extend-due-dates-1455424470"&gt;How to Inflate Tasks and Extend Due Dates&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you're not a Star Trek fan, you may not be familiar with the Scotty Principle, but it's fairly simple. When asked how long a job will take, estimate the time required to complete the job, add about 25%-50% onto that estimate, and commit to the longer estimate. Then, when you deliver ahead of schedule (or something else happens that throws you off, and you're forced to deliver on schedule instead of ahead), you're a miracle worker who really knows how to get the job done.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;On top of that, the Scotty Principle is often amplified as it echoes through every level it passes&lt;/strong&gt; (Developer -&amp;gt; Project Manager -&amp;gt; ... -&amp;gt; Sales). This is because every level is unaware of the buffers added by others. Everyone in the chain can apply this principle on top of each other. So besides the developer, the project leader and sales guy can also add an extra 25% to 50%. Being unaware of additional safety nets, each creates its own on top of the others. &lt;/p&gt;

&lt;p&gt;In the end, a one-week job could end up estimated as an entire month. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--peCeh_bz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/inueqjzrtg205wtfapm9.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--peCeh_bz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/inueqjzrtg205wtfapm9.jpeg" alt="Software estimates"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Parkinson's law
&lt;/h2&gt;

&lt;p&gt;From &lt;a href=""&gt;Wikipedia, Parkinson's law&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Parkinson's law is the adage that "work expands so as to fill the time available for its completion".&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Take a minute to sponge this 😰. &lt;strong&gt;If you combine the Scotty Principle with Parkinson's law, the result is a zero-sum game.&lt;/strong&gt; It's even worse! Due to Parkinson's law you somehow managed to eat up every buffer to finish just in time... what did you do with all that extra time 😏 !? &lt;/p&gt;

&lt;h2&gt;
  
  
  4. Unfounded Optimism
&lt;/h2&gt;

&lt;p&gt;From: Software Estimation: Demystifying the Black Art&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Optimism assails software estimates from all sources. On the developer side of the project, Microsoft Vice President Chris Peters observed that "You never have to fear that estimates created by developers will be too pessimistic because developers will always generate a too-optimistic schedule". In a study of 300 software projects, &lt;strong&gt;Michiel van Genuchten reported that developer estimates tended to contain an optimism factor of 20% to 30%. Although managers sometimes complain otherwise, developers don't tend to sandbag their estimates—their estimates tend to be too low!&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;What to do with this? Should a manager be so gentle as to add another 30% on top of your estimate to counter this? Maybe he's already doing this (without telling you)?&lt;/p&gt;

&lt;h2&gt;
  
  
  5. The Cone of Uncertainty
&lt;/h2&gt;

&lt;p&gt;From &lt;a href="https://en.wikipedia.org/wiki/Cone_of_Uncertainty"&gt;Wikipedia, Cone of Uncertainty&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In project management, the Cone of Uncertainty describes the evolution of the amount of best-case uncertainty during a project. At the beginning of a project, comparatively little is known about the product or work results, and so estimates are subject to large uncertainty. As more research and development is done, more information is learned about the project, and the uncertainty then tends to decrease, reaching 0% when all residual risk has been terminated or transferred. This usually happens by the end of the project i.e. by transferring the responsibilities to a separate maintenance group.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TVLOd4r---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6n4j8sctmtnpmmxa8am5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TVLOd4r---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6n4j8sctmtnpmmxa8am5.png" alt="Cone of Uncertainty"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Don't underestimate the power of uncertainty. At the start of a project, it could mean your estimate is four times off! So an estimate of one month could be finished in one week or in the worst case, it could take four months!&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Estimates are non-negotiable
&lt;/h2&gt;

&lt;p&gt;I can’t count the times someone immediately replied to my estimate with: “Could you finish it in less time?”&lt;br&gt;
Seriously? Where's your trust!? You ask me for an estimation and now you think I just made something up? &lt;/p&gt;

&lt;p&gt;Replies like those really irk me. Imagine I ask “How tall are you?” and you reply 69.5 inches. Wouldn't it be awkward if I replied “could it be a bit smaller?” 😦. Estimates are like body length measurements, non-negotiable.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;There's a lot to tell about Software Estimation. I would say that it's a science on its own, one which I don't master. Nevertheless, I always keep these six concepts in the back of my mind when making estimations, which helps.&lt;/p&gt;

&lt;p&gt;For further reading, I can recommend: &lt;a href="https://www.oreilly.com/library/view/software-estimation-demystifying/0735605351/"&gt;Software Estimation: Demystifying the Black Art&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enjoy and until next time!&lt;/p&gt;

</description>
      <category>agile</category>
      <category>productivity</category>
      <category>programming</category>
      <category>management</category>
    </item>
  </channel>
</rss>
