<?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: William Collins</title>
    <description>The latest articles on DEV Community by William Collins (@wcollins).</description>
    <link>https://dev.to/wcollins</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%2F917403%2F409cf2b6-5354-427e-9ac2-d54e0bf2050b.jpeg</url>
      <title>DEV Community: William Collins</title>
      <link>https://dev.to/wcollins</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/wcollins"/>
    <language>en</language>
    <item>
      <title>Using Terraform Import Blocks with Alkira</title>
      <dc:creator>William Collins</dc:creator>
      <pubDate>Thu, 13 Jul 2023 16:37:12 +0000</pubDate>
      <link>https://dev.to/aws-builders/using-terraform-import-blocks-with-alkira-2679</link>
      <guid>https://dev.to/aws-builders/using-terraform-import-blocks-with-alkira-2679</guid>
      <description>&lt;p&gt;For many moons, importing existing infrastructure &lt;em&gt;(that is to say, infrastructure running outside of Terraform state)&lt;/em&gt;, has not been a trivial task. Historically, &lt;a href="https://terraform.io"&gt;Terraform&lt;/a&gt; did not generate any configuration. You would have to write the &lt;em&gt;infrastructure-as-code&lt;/em&gt; in a manner that reflects how it was deployed. Then, to make matters not easier, you would fetch the 'ol shovel and dig out the unique &lt;em&gt;resource identifiers&lt;/em&gt; to feed through the command line. Handling a single resource in this manner is pretty simple. Wrangling &lt;strong&gt;20+&lt;/strong&gt; resources like this is not. Last month, &lt;a href="https://github.com/hashicorp/terraform/releases/tag/v1.5.0"&gt;Terraform v1.5.0&lt;/a&gt; was released, offering the ability to use &lt;strong&gt;import blocks&lt;/strong&gt;. Let's test this new feature on my favorite infrastructure provider, &lt;a href="https://alkira.com"&gt;Alkira&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fOgUFGdW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vk2fi4oewh4joe26ubbc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fOgUFGdW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vk2fi4oewh4joe26ubbc.png" alt="Intro" width="800" height="469"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why is this Useful?
&lt;/h2&gt;

&lt;p&gt;This feature shifts &lt;em&gt;import&lt;/em&gt; from a &lt;strong&gt;CLI driven&lt;/strong&gt; approach to &lt;em&gt;configuration-driven&lt;/em&gt; and &lt;em&gt;plannable&lt;/em&gt; actions for adopting existing resources. Here are the key takeaways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Configuration-Driven:&lt;/strong&gt; You can now declare imports within your Terraform configuration files using an import block, making the process more streamlined and part of the initial planning.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Plannable Action:&lt;/strong&gt; Terraform treats importing as part of a standard plan. Running terraform plan will show a summary of the resources that Terraform intends to import, along with other planned changes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Preservation of existing CLI command:&lt;/strong&gt; The existing terraform import CLI command remains unchanged and can still be used separately.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Support for Generating Configuration for Imported Resources:&lt;/strong&gt; This feature, used in conjunction with the import block, enables templating of configuration when importing resources. A new flag &lt;strong&gt;-generate-config-out=PATH&lt;/strong&gt; is added to terraform plan. When this flag is set, Terraform generates an HCL configuration for any resource included in an import block that doesn't already have an associated configuration, writing it to a new file at the specified PATH.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  A Common Scenario
&lt;/h2&gt;

&lt;p&gt;In this scenario, I'll build an &lt;strong&gt;AWS VPC&lt;/strong&gt; and connect it to Alkira using the &lt;a href="https://registry.terraform.io/providers/alkiranet/alkira/latest/docs/resources/connector_aws_vpc"&gt;alkira_connector_aws_vpc&lt;/a&gt; resource. This is a pretty common scenario I see with our customers. They begin a &lt;em&gt;proof-of-concept&lt;/em&gt; for a particular use case and do most of the testing via Alkira's excellent user interface. Instead of building a new environment for &lt;em&gt;production&lt;/em&gt; however, a lot of times, they will want to take the &lt;em&gt;proof-of-concept&lt;/em&gt; to production. From here, they need to &lt;em&gt;import&lt;/em&gt; what has already been built into the appropriate &lt;a href="https://developer.hashicorp.com/terraform/language/state"&gt;Terraform State&lt;/a&gt; file.&lt;/p&gt;

&lt;h3&gt;
  
  
  Building some Infrastructure
&lt;/h3&gt;

&lt;p&gt;I'm going to &lt;em&gt;mock-up&lt;/em&gt; the infrastructure we will import using Terraform.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h3&gt;
  
  
  Importing that Infrastructure Somewhere Else
&lt;/h3&gt;

&lt;p&gt;Now that we have some &lt;em&gt;infrastructure&lt;/em&gt; to work with, along with the &lt;em&gt;resource identifiers&lt;/em&gt;, let's put &lt;em&gt;import blocks&lt;/em&gt; to the test. First, we create an &lt;em&gt;import block&lt;/em&gt; for the Alkira connector in a file called &lt;strong&gt;imports.tf&lt;/strong&gt; in a separate directory. I defined the &lt;em&gt;connector_id&lt;/em&gt; returned from the previous configuration into a new variable called &lt;strong&gt;var.connector_id&lt;/strong&gt;:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Next, we &lt;em&gt;initialize&lt;/em&gt; this separate directory containing the new Terraform configuration. Once everything is initialized, we can run &lt;strong&gt;-generate-config-out=main.tf&lt;/strong&gt; which generates the following:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZlB1Ni_E--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wlldr54gafj6ou5cqb9o.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZlB1Ni_E--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wlldr54gafj6ou5cqb9o.gif" alt="Import" width="800" height="637"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;This is a great &lt;em&gt;feature&lt;/em&gt; that saves time. If I had to guess, as more functionality and polish is added, you'll see &lt;em&gt;modules&lt;/em&gt; popping up that leverage &lt;em&gt;import blocks&lt;/em&gt; and provide a simplified way to import larger swaths of &lt;em&gt;infrastructure&lt;/em&gt;. Some tools exist out there to do this today. Last year, I wrote about one such tool - &lt;a href="https://wcollins.io/posts/2022/importing-infrastructure-with-azure-terrafy/"&gt;Azure Terrafy&lt;/a&gt;. The difference is that since this is now integrated with the Terraform configuration and planning process, it can keep all of the logic in the &lt;em&gt;HashiCorp&lt;/em&gt; ecosystem. No messing around with fetching &lt;em&gt;binaries&lt;/em&gt; or needing to do any &lt;em&gt;third-party&lt;/em&gt; tricks.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>networking</category>
      <category>terraform</category>
    </item>
    <item>
      <title>AWS DC Summit - Recap</title>
      <dc:creator>William Collins</dc:creator>
      <pubDate>Tue, 20 Jun 2023 18:57:49 +0000</pubDate>
      <link>https://dev.to/aws-builders/aws-dc-summit-recap-1l73</link>
      <guid>https://dev.to/aws-builders/aws-dc-summit-recap-1l73</guid>
      <description>&lt;p&gt;What fits somewhere in between &lt;a href="https://reinvent.awsevents.com/"&gt;re:Invent&lt;/a&gt; and &lt;a href="https://aws.amazon.com/events/community-day/"&gt;Community Day&lt;/a&gt; events? That would be the &lt;a href="https://aws.amazon.com/events/summits"&gt;AWS Summits&lt;/a&gt;! This year, I got to experience a double dose of fun by representing &lt;a href="https://alkira.com"&gt;Alkira&lt;/a&gt; at our booth and presenting at the &lt;strong&gt;AWS Community Developer Lounge&lt;/strong&gt;. I may be biased, but I believe the &lt;em&gt;Alkira&lt;/em&gt; team is the best in the world.&lt;/p&gt;

&lt;p&gt;It was a blast getting to talk &lt;em&gt;about cloud networking&lt;/em&gt; with event attendees while getting a glimpse of how the &lt;em&gt;public sector&lt;/em&gt; is adapting to change. And, for my first time &lt;em&gt;presenting&lt;/em&gt; at a &lt;em&gt;Summit&lt;/em&gt;, I thought it fitting to do a live demo. Why not pull in some advanced concepts and do it all live with semi-flaky internet and see how it goes? &lt;a href="https://en.wikipedia.org/wiki/Leeroy_Jenkins"&gt;Leeroy Jenkins&lt;/a&gt; would be proud.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AFH4e8wh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9gadh43202p2dqi7e86t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AFH4e8wh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9gadh43202p2dqi7e86t.png" alt="Intro" width="800" height="177"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Highlights
&lt;/h2&gt;

&lt;p&gt;My favorite highlights included:&lt;/p&gt;

&lt;h3&gt;
  
  
  Team Alkira
&lt;/h3&gt;

&lt;p&gt;Whether it was the many engaging conversations we had with event attendees at the booth, the unplanned &lt;em&gt;team-building exercise&lt;/em&gt; of scooting through the &lt;strong&gt;D.C.&lt;/strong&gt; bike lanes or seeing the &lt;a href="https://www.mlb.com/nationals"&gt;Washington Nationals&lt;/a&gt; get smashed, I wouldn't pick any other team to do it with. What made this &lt;em&gt;event&lt;/em&gt; great was the fantastic questions we got from event attendees. As it turns out, great questions lead to great conversations!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cvUJlFPn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/orqai6a5ncw319e80p79.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cvUJlFPn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/orqai6a5ncw319e80p79.png" alt="Team Alkira" width="800" height="156"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Keynote
&lt;/h3&gt;

&lt;p&gt;At the keynote, we got to hear from &lt;a href="https://www.cia.gov/stories/story/cia-names-first-chief-technology-officer/"&gt;the CIA's first CTO, Nand Mulchandani&lt;/a&gt;. Keeping your ears open will teach you something new every day. For me, it was that researchers at the CIA created the lithium-iodine battery. I guess this shouldn't come as a surprise, given the need for long-lasting battery power and the nature of surveillance.&lt;/p&gt;

&lt;h3&gt;
  
  
  Modular Data Center
&lt;/h3&gt;

&lt;p&gt;Back in &lt;em&gt;February&lt;/em&gt; AWS announced their &lt;a href="https://aws.amazon.com/blogs/publicsector/announcing-aws-modular-data-center-u-s-department-defense-joint-warfighting-cloud-capability/"&gt;Modular Data Center for U.S. Department of Defense Joint Warfighting Cloud Capability&lt;/a&gt;. This only available to government customers under the &lt;a href="https://aws.amazon.com/blogs/publicsector/aws-selected-for-u-s-department-of-defense-joint-warfighting-cloud-capability-contract/"&gt;JWCC Contract&lt;/a&gt; and is currently supported in the AWS GovCloud &lt;em&gt;(US-West)&lt;/em&gt; and &lt;em&gt;(US-East)&lt;/em&gt; regions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2keCsARH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gzzmfq9lt70gczy89a6f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2keCsARH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gzzmfq9lt70gczy89a6f.png" alt="Modular Data Center" width="800" height="274"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You could rely on limited &lt;em&gt;infrastructure&lt;/em&gt;. You could also procure, build, and provision &lt;em&gt;infrastructure&lt;/em&gt; yourself. Why not just deploy a self-contained and modular data center? In isolated environments, it can securely store, analyze, and interpret &lt;em&gt;petabytes&lt;/em&gt; of data in real-time. I got to walk through one of these at the &lt;em&gt;summit&lt;/em&gt; and my &lt;strong&gt;nerd&lt;/strong&gt; senses were tingling.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Snowblade Announcement
&lt;/h3&gt;

&lt;p&gt;Want compute and storage amongst other hybrid services in remote locations, including &lt;strong&gt;Denied, Disrupted, Intermittent, and Limited (DDIL)&lt;/strong&gt; environments? If you are a &lt;em&gt;(JWCC) contract customer&lt;/em&gt;, take a look at &lt;a href="https://aws.amazon.com/about-aws/whats-new/2023/06/aws-snowblade-us-defense-jwcc-customers/"&gt;AWS Snowblade&lt;/a&gt;. This &lt;em&gt;tech&lt;/em&gt; extends AWS infrastructure to the &lt;em&gt;tactical edge&lt;/em&gt; and meets &lt;em&gt;U.S. Military Ruggedization Standards (MIL-STD-810H)&lt;/em&gt;. Snowblade is available in the AWS GovCloud (US-West) region.&lt;/p&gt;

&lt;h3&gt;
  
  
  Presenting in the &lt;em&gt;Dev Lounge&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;Through the amazing &lt;a href="https://aws.amazon.com/developer/community/community-builders/"&gt;AWS Community Builders&lt;/a&gt; program, I got to present in the &lt;em&gt;Dev Lounge&lt;/em&gt;. Many folks wanting to enter &lt;em&gt;tech&lt;/em&gt; seem to go the &lt;em&gt;software engineering&lt;/em&gt; route by default. &lt;strong&gt;Serverless&lt;/strong&gt; and &lt;strong&gt;AI/ML&lt;/strong&gt; are also newer and much more shiny than &lt;em&gt;networking&lt;/em&gt;. Throughout my time in tech, there appears to be a waning interest in &lt;em&gt;network engineering&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;One of my goals in the &lt;em&gt;community&lt;/em&gt; is to show that &lt;em&gt;networking&lt;/em&gt; is equally exciting in the cloud, especially when paired with awesome tools like &lt;em&gt;Terraform&lt;/em&gt;. In this &lt;em&gt;Dev Chat&lt;/em&gt;, I started with some theory and real-world problems and then ran a &lt;em&gt;live demonstration&lt;/em&gt; on how you could solve some of those problems by combining the power of AWS &lt;a href="https://aws.amazon.com/transit-gateway/"&gt;Transit Gateway&lt;/a&gt; and &lt;em&gt;Terraform&lt;/em&gt;. The slides and code I ran for the demo can be found &lt;a href="https://github.com/wcollins/aws-summit-dc-2023"&gt;here.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--usmpZ8gB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q764brkzooiksiwqt09r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--usmpZ8gB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q764brkzooiksiwqt09r.png" alt="Dev Lounge" width="800" height="397"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Properly designed and executed &lt;strong&gt;network and security&lt;/strong&gt; is the solid foundation on which many of the newer and &lt;em&gt;trendy&lt;/em&gt; technologies run atop. If you drive a Ferrari, you can reach your destination quickly &lt;em&gt;(I wish I had a Ferrari)&lt;/em&gt;. If the highway isn't in place, however, and you were driving on rugged terrain, can you imagine what the experience would be like? Imagine also if an optimal interconnection of highways didn't exist between you and your destination.&lt;/p&gt;
&lt;/blockquote&gt;

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

&lt;p&gt;This AWS Summit was a whirlwind of learning, engagement, and networking - literally and figuratively! Representing &lt;a href="https://alkira.com"&gt;Alkira&lt;/a&gt; and having the opportunity to educate attendees on our product led to many deeper discussions around the state of networking in the cloud. It was a blast to discuss cloud networking, interact with various individuals, and offer a different perspective on a field often perceived as a &lt;strong&gt;thing I want to get out of the way&lt;/strong&gt;.&lt;/p&gt;

</description>
      <category>awscommunitybuilders</category>
      <category>cloudnative</category>
    </item>
    <item>
      <title>Can ChatGPT Terraform Simple Networking In AWS?</title>
      <dc:creator>William Collins</dc:creator>
      <pubDate>Wed, 29 Mar 2023 12:42:54 +0000</pubDate>
      <link>https://dev.to/aws-builders/can-chatgpt-terraform-simple-networking-in-aws-3241</link>
      <guid>https://dev.to/aws-builders/can-chatgpt-terraform-simple-networking-in-aws-3241</guid>
      <description>&lt;p&gt;Usually, when it comes to &lt;em&gt;technology&lt;/em&gt;, my grandmother doesn't know much because she doesn't care. What is the cloud? How to install a new browser on her laptop? What is 2FA? I might be speaking &lt;em&gt;French&lt;/em&gt; to her as I discuss these things. Yet, she knows what &lt;a href="https://openai.com/blog/chatgpt"&gt;ChatGPT&lt;/a&gt; is. This shows the vast amount of publicity, hype, and polarization that has ensued since &lt;em&gt;November 2022&lt;/em&gt;. I tend to avoid AI fear-mongering and focus more on, &lt;strong&gt;how could a tool like this help enhance my daily grind&lt;/strong&gt;? Can &lt;em&gt;ChatGPT&lt;/em&gt; write &lt;a href="https://www.terraform.io/"&gt;Terraform&lt;/a&gt; as elegantly as a poem written from the perspective of Samuel L. Jackson in &lt;em&gt;Pulp Fiction&lt;/em&gt;? Let's take it for a spin on &lt;a href="https://aws.amazon.com/"&gt;AWS&lt;/a&gt; using &lt;em&gt;infrastructure-as-code&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create a VPC and Two Subnets
&lt;/h2&gt;

&lt;p&gt;Let's ease in gently. Just like when my wife says she is making cookies, I tell myself I will keep things simple and only have one. My first request for &lt;em&gt;ChatGPT&lt;/em&gt; is a simple one:  &lt;strong&gt;Create a VPC and two subnets in AWS using Terraform&lt;/strong&gt;.&lt;/p&gt;

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

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Observations&lt;/strong&gt;&lt;br&gt;
That was pretty seamless. I provided little detail in my first &lt;em&gt;request&lt;/em&gt;, but ChatGPT filled in all the required arguments added tags for the &lt;em&gt;Name&lt;/em&gt; of each resource, and even put my subnets in separate availability zones.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Does it Work?
&lt;/h3&gt;

&lt;p&gt;Whenever the cookies come out of the oven, I am overcome with a sense of responsibility to test them out before anyone else eats any &lt;em&gt;(maybe I run this test 3 or 4 times depending on the cookie)&lt;/em&gt;. Like those cookies, &lt;em&gt;ChatGPT&lt;/em&gt; isn't getting any favors from me. Let's test:&lt;/p&gt;

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

&lt;h2&gt;
  
  
  Updating our Request
&lt;/h2&gt;

&lt;p&gt;I'm always down for a good conversation when I'm eating cookies. Let's talk a little more to &lt;em&gt;ChatGPT&lt;/em&gt; and request an update to our &lt;em&gt;Name&lt;/em&gt; tags for our resources:&lt;/p&gt;

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

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Captivating Conversation&lt;/strong&gt;&lt;br&gt;
Asking &lt;em&gt;ChatGPT&lt;/em&gt; to update &lt;em&gt;Name&lt;/em&gt; tags was successful. Not only did I get the updated code, but comments were added to the code file to show what changes were made. This conversational style is very intuitive. If I don't get what I need, or maybe the output clues me into something additional I need to add, I need but ask. This &lt;strong&gt;generative pretrained transformer&lt;/strong&gt; is starting to win my heart over, just like cookies do.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Going Beyond Basics
&lt;/h2&gt;

&lt;p&gt;At some point &lt;em&gt;(usually around Christmas / New Year's)&lt;/em&gt;, I realize I have been eating way too many cookies. The &lt;em&gt;cookies&lt;/em&gt; have failed me. Let's add more logic to see if &lt;em&gt;ChatGPT&lt;/em&gt; fails me too. Since &lt;em&gt;ChatGPT&lt;/em&gt; offered up handling &lt;em&gt;availability zones&lt;/em&gt; without me asking, let's see what happens if I throw the &lt;a href="https://developer.hashicorp.com/terraform/language/meta-arguments/count"&gt;count Meta-Argument&lt;/a&gt; in the mix?&lt;/p&gt;

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

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Too Many Cookies&lt;/strong&gt;&lt;br&gt;
Anyone who has spent time writing Terraform would likely have spotted the problem before running the code. The 'count' Meta-Argument in Terraform works using an &lt;em&gt;incrementing counter&lt;/em&gt;. With &lt;em&gt;ChatGPT&lt;/em&gt; knowing all the "answers" and providing the availability zones as part of the configuration, it also decided to &lt;em&gt;increment&lt;/em&gt; them in the same manner used with &lt;strong&gt;cidr_block&lt;/strong&gt; and &lt;strong&gt;Name&lt;/strong&gt; tag. Using this logic, it produced &lt;strong&gt;us-east-11&lt;/strong&gt;, &lt;strong&gt;us-east-12&lt;/strong&gt;, and &lt;strong&gt;us-east-13&lt;/strong&gt; which are not availability zones in AWS, thus causing my configuration to crash and burn. Time to go on a diet?&lt;/p&gt;
&lt;/blockquote&gt;

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

&lt;p&gt;It is hard not to be impressed. The value goes beyond simply providing lines of code. With each update to my request, &lt;strong&gt;ChatGPT&lt;/strong&gt; provided a clear explanation as to why it modified the logic in the manner that it did. Since I began experimenting in &lt;em&gt;January&lt;/em&gt;, I have found many ways to get &lt;em&gt;ChatGPT&lt;/em&gt; to produce wrong &lt;em&gt;(sometimes laughable)&lt;/em&gt; code or configuration. Network gear, general-purpose programming, and infrastructure-as-code are complex things, though. Numerous complications, variables, versioning, and interpretation require adjusted expectations.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>awscommunitybuilders</category>
      <category>terraform</category>
      <category>chatgpt</category>
    </item>
    <item>
      <title>Evolution of AWS Site-to-Site VPN - Part 2</title>
      <dc:creator>William Collins</dc:creator>
      <pubDate>Mon, 06 Feb 2023 13:01:59 +0000</pubDate>
      <link>https://dev.to/aws-builders/evolution-of-aws-site-to-site-vpn-part-2-22fi</link>
      <guid>https://dev.to/aws-builders/evolution-of-aws-site-to-site-vpn-part-2-22fi</guid>
      <description>&lt;p&gt;In &lt;a href="https://wcollins.io/posts/2022/evolution-of-aws-site-to-site-vpn-part-1/"&gt;Part 1&lt;/a&gt;, we talked about the origins of the &lt;a href="https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html"&gt;Site-to-Site VPN Service&lt;/a&gt; in AWS. As consumers began to scale in the early days, they faced tunnel sprawl, performance constraints, and the need for a simplified design. AWS responded with &lt;a href="https://aws.amazon.com/transit-gateway/"&gt;Transit Gateway&lt;/a&gt;. How did &lt;em&gt;Transit Gateway&lt;/em&gt; simplify architecture leading to smoother operations, better network performance, and a scalable blueprint for the future network?&lt;/p&gt;

&lt;h2&gt;
  
  
  Pre Transit Gateway
&lt;/h2&gt;

&lt;p&gt;Security teams in the early days would often balk at the idea of using &lt;a href="https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html"&gt;VPC peering&lt;/a&gt; without having a centralized transit hub &lt;em&gt;(where the hybrid connectivity was landed)&lt;/em&gt;. Since &lt;em&gt;VPC&lt;/em&gt; couldn't do any advanced packet forwarding natively, many designs would do transitive routing on the customer gateway. Traffic patterns looked something like this:&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;Observations&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In this design, the tunnels exist from the customer gateway all the way to the VPC. In this &lt;em&gt;one-to-one&lt;/em&gt; relationship, there is no intelligent way to manage the complexity of incremental connections as you grow. Traffic also exits &lt;em&gt;AWS&lt;/em&gt; even when the destination is another VPC which is inefficient. Also, since one tunnel is actively forwarding traffic at a time, you are limited to &lt;strong&gt;~ 1.25 Gbps&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Transit VPC
&lt;/h3&gt;

&lt;p&gt;To solve some of the shortcomings with VPC peering and tunneling to each VPC directly, &lt;a href="https://docs.aws.amazon.com/whitepapers/latest/aws-vpc-connectivity-options/transit-vpc-option.html"&gt;Transit VPC&lt;/a&gt; was born. This solution deploys a &lt;em&gt;hub-and-spoke&lt;/em&gt; design that reminds me of my data center networking days when we connected sites to data centers with all the glory of active/standby and &lt;em&gt;boxes&lt;/em&gt; everywhere. Want to connect another network? Deploy another few boxes! Sometimes this is unavoidable, but any opportunity I get not to manage additional appliances or agents, I take it.&lt;/p&gt;

&lt;p&gt;When I prototyped this design for the first time, we used &lt;a href="https://aws.amazon.com/marketplace/pp/prodview-b75wijpubtr3k"&gt;Cisco CSRs&lt;/a&gt; deployed in a &lt;em&gt;Transit VPC&lt;/em&gt;. This acted as the hub, and each spoke VPC's VGW had two tunnels to the CSRs with BGP running over IPsec. Since VGW doesn't support ECMP, this gives us active/standby out of the box. This design does perform transitive routing in the hub which keeps spoke-to-spoke traffic in the cloud.&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;Appliance Sprawl&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In this design, you are responsible for provisioning the appliances (across multiple availability zones in a given VPC). This means you have to do the routine software upgrades along with the emergency firefighting when new CVEs are uncovered. Also, running this design at scale is problematic. As the number of VPCs grow, the number of appliances grow. Imagine the above diagram with 60 VPCs attached.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Enter Transit Gateway
&lt;/h2&gt;

&lt;p&gt;AWS &lt;a href="https://docs.aws.amazon.com/vpc/latest/tgw/what-is-transit-gateway.html"&gt;Transit Gateway &lt;em&gt;(TGW)&lt;/em&gt;&lt;/a&gt; works as a managed distributed router, enabling you to attach multiple VPCs in a &lt;em&gt;hub + spoke&lt;/em&gt; architecture. These VPCs have reachability to each other &lt;em&gt;(with the TGW doing the transitive routing)&lt;/em&gt;. All traffic remains on the global AWS backbone. The service is &lt;em&gt;regionally&lt;/em&gt; scoped; however, you can route between transit gateways in different AWS regions using &lt;em&gt;Inter-Region Peering&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;You connect various &lt;em&gt;network types&lt;/em&gt; to TGW with the appropriate attachments. The various attachment types can be found &lt;a href="https://docs.aws.amazon.com/vpc/latest/tgw/what-is-transit-gateway.html"&gt;here.&lt;/a&gt; Since we are talking about the evolution of &lt;em&gt;site-to-site VPN&lt;/em&gt; design, we would use the &lt;a href="https://docs.aws.amazon.com/vpc/latest/tgw/tgw-vpn-attachments.html"&gt;TGW VPN Attachments&lt;/a&gt; to terminate our VPNs and &lt;a href="https://docs.aws.amazon.com/vpc/latest/tgw/tgw-vpc-attachments.html"&gt;TGW VPC Attachments&lt;/a&gt; for connecting VPCs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Simplified Connectivity
&lt;/h3&gt;

&lt;p&gt;Keeping things simple has a lot of benefits. This includes reducing the number of tunnels you have to manage while getting &lt;em&gt;more&lt;/em&gt; from them. Sometimes you find that &lt;em&gt;less is more&lt;/em&gt;, especially knowing that someone has to do operations!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ludwig Mies van der Rohe&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Ludwig was a German-American architect who adopted the motto &lt;strong&gt;less is more&lt;/strong&gt; to describe the aesthetic of minimalist architecture. In the network, a design should be as simple as possible while meeting requirements.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When using &lt;em&gt;Virtual Private Gateway (VGW)&lt;/em&gt;, we know the tunnel spans from the customer gateway to redundant &lt;em&gt;public endpoints&lt;/em&gt; in different AZs. With this new design, tunnels would land directly on the transit gateway. This also enables us to leverage a single &lt;em&gt;VPN connection&lt;/em&gt; for all of our VPCs back to on-premises. We can also use &lt;a href="https://en.wikipedia.org/wiki/Equal-cost_multi-path_routing"&gt;ECMP&lt;/a&gt; to aggregate the bandwidth of both tunnels in the connection.&lt;/p&gt;

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

&lt;h3&gt;
  
  
  Accelerated Connections
&lt;/h3&gt;

&lt;p&gt;When using transit gateway, you can enable acceleration when adding the &lt;em&gt;TGW attachment&lt;/em&gt;. An accelerated connection uses &lt;a href="https://aws.amazon.com/global-accelerator/"&gt;AWS Global Accelerator&lt;/a&gt; to route traffic from your on-premises network to the closest AWS edge location. Your traffic is then optimized once it lands on AWS's global network. Let's examine using acceleration with TGW versus no acceleration with VGW:&lt;/p&gt;

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

&lt;h3&gt;
  
  
  When to Accelerate
&lt;/h3&gt;

&lt;p&gt;If the sites being connected are close to a given AWS region where your resources exist, you will see similar performance between both of these options. As distance increases, additional hops over the public internet are introduced, which can increase latency and impact reliability.&lt;/p&gt;

&lt;p&gt;This is where acceleration shines. It works by building accelerators that enable you to attach redundant &lt;em&gt;anycast&lt;/em&gt; addresses from the edge network. These addresses act as your entrypoint to the VPN tunnel endpoints and then proxies packets at the edge to applications running in a given AWS region.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How much improvement?&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;AWS boasts up to &lt;strong&gt;60% better performance for internet traffic&lt;/strong&gt; when using Global Accelerator. You can learn more about how this is accomplished along with the criteria for measurement &lt;a href="https://aws.amazon.com/blogs/networking-and-content-delivery/achieve-up-to-60-better-performance-for-internet-traffic-with-aws-global-accelerator/"&gt;here.&lt;/a&gt; &lt;/p&gt;
&lt;/blockquote&gt;

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

&lt;p&gt;Understanding your organization's goals and how the network needs to support them is no trivial task. This is where &lt;strong&gt;&lt;em&gt;"it depends"&lt;/em&gt;&lt;/strong&gt; rears its proverbial ugly head. In the world of cloud networking, complexity, data transfer, and compounding cost, it pays to think through the design and weigh the trade-offs. One thing is certain -- AWS's site-to-site VPN and other adjacent services have evolved, providing the means to construct high-performing networks with a global scale and amazing user experience.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>cloudnetworking</category>
    </item>
    <item>
      <title>AWS re:Invent 2022 - Recap</title>
      <dc:creator>William Collins</dc:creator>
      <pubDate>Tue, 06 Dec 2022 14:20:08 +0000</pubDate>
      <link>https://dev.to/aws-builders/aws-reinvent-2022-recap-3j2k</link>
      <guid>https://dev.to/aws-builders/aws-reinvent-2022-recap-3j2k</guid>
      <description>&lt;p&gt;As far as &lt;em&gt;tech conferences&lt;/em&gt; are concerned, it's hard to find one as exciting as &lt;a href="https://reinvent.awsevents.com/" rel="noopener noreferrer"&gt;AWS re:Invent&lt;/a&gt;. Whether it's anticipation for new product announcements or connecting in person with the community, there is something electrifying about being at &lt;em&gt;ground zero&lt;/em&gt;. And if you can make the trip, you will get a lot of great exercise too! I hit close to &lt;strong&gt;100K steps&lt;/strong&gt; or approx. &lt;strong&gt;43 miles&lt;/strong&gt; according to my &lt;em&gt;Fitbit&lt;/em&gt;. What were some of my favorite highlights from &lt;strong&gt;re:Invent 2022&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%2Fxticewycw57n1bg81u2w.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%2Fxticewycw57n1bg81u2w.png" alt="Intro" width="800" height="231"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Community
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/in/jasonrobertdunn/" rel="noopener noreferrer"&gt;Jason Dunn&lt;/a&gt; put on a spectacular event for the &lt;strong&gt;AWS Community Builders&lt;/strong&gt;. Intros were made to various members of the AWS team, community managers, topic leaders, developer advocates, and &lt;em&gt;DevRel&lt;/em&gt; leadership. Even the legend, &lt;a href="https://aws.amazon.com/blogs/aws/author/jbarr/" rel="noopener noreferrer"&gt;Jeff Barr&lt;/a&gt;, was there. The food was hot, the SWAG was hotter, and the conversation and &lt;em&gt;networking&lt;/em&gt; was off the chain. These types of events are where major opportunities happen. Want to become a &lt;em&gt;Community Builder&lt;/em&gt;? Check out our &lt;a href="https://aws.amazon.com/developer/community/community-builders/" rel="noopener noreferrer"&gt;page&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Attendance
&lt;/h2&gt;

&lt;p&gt;There were over &lt;strong&gt;60K&lt;/strong&gt; in attendance this year, and all the sessions I attended were excellent. You can find most of the events already available on the &lt;a href="https://www.youtube.com/@AWSEventsChannel" rel="noopener noreferrer"&gt;AWS Events&lt;/a&gt; YouTube channel.&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%2Fmugjmsk6qssnomo7titu.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%2Fmugjmsk6qssnomo7titu.gif" alt="Timelapse" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Network Announcements
&lt;/h2&gt;

&lt;p&gt;My favorite category, &lt;strong&gt;Networking &amp;amp; Content Delivery&lt;/strong&gt;, saw a few new product launches. Let's dig in!&lt;/p&gt;

&lt;h3&gt;
  
  
  VPC Lattice
&lt;/h3&gt;

&lt;p&gt;Want consistent network policy and traffic management across instances, containers, and serverless? A new full managed service called &lt;a href="https://aws.amazon.com/vpc/lattice/" rel="noopener noreferrer"&gt;VPC Lattice&lt;/a&gt; is now in &lt;em&gt;preview&lt;/em&gt;. This feels like a &lt;em&gt;service-mesh "lite"&lt;/em&gt; aimed at scaling &lt;em&gt;service-to-service&lt;/em&gt; connections while incorporating some &lt;em&gt;zero-trust&lt;/em&gt;. Having visibility into &lt;em&gt;service-to-service&lt;/em&gt; interactions is important.&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%2Fv3wgcn3xsmbe49xwvja7.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%2Fv3wgcn3xsmbe49xwvja7.png" alt="VPC Lattice" width="800" height="317"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Pricing
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://aws.amazon.com/vpc/lattice/pricing/" rel="noopener noreferrer"&gt;VPC Lattice Pricing&lt;/a&gt; is broken down into three components that ultimately decide how much that final bill will increase.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Per hour&lt;/strong&gt; charge for each running service (that runs on instances, containers, or serverless). The price will differ per &lt;em&gt;region&lt;/em&gt;, but for &lt;em&gt;US East&lt;/em&gt; it is &lt;strong&gt;$0.0250/hr&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Per GB&lt;/strong&gt; charge for each gigabyte of data running through each service. Again, the price for &lt;em&gt;US East&lt;/em&gt; is &lt;strong&gt;$0.0250/GB&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Requests&lt;/strong&gt; made to to each service are priced at a &lt;strong&gt;$0.10&lt;/strong&gt; &lt;em&gt;per 1 million requests&lt;/em&gt; rate. You begin getting charged once you exceed the &lt;em&gt;always free tier&lt;/em&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Services are heavily restricted and controlled during &lt;em&gt;Preview&lt;/em&gt; periods. &lt;em&gt;VPC Lattice&lt;/em&gt; is only available in &lt;strong&gt;US West&lt;/strong&gt; &lt;em&gt;(Oregon)&lt;/em&gt; as of right now. You can get on the waitlist &lt;a href="https://pages.awscloud.com/AmazonVPCLattice-Preview.html" rel="noopener noreferrer"&gt;here.&lt;/a&gt; Preview is available for up to 5 AWS accounts at a time.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Verified Access
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;VPNs&lt;/em&gt; are getting a lot of hate these days, and &lt;em&gt;ZTNA&lt;/em&gt; products are getting a lot of love. I'm not surprised to see AWS release &lt;a href="https://aws.amazon.com/verified-access/" rel="noopener noreferrer"&gt;Verified Access&lt;/a&gt; for secure access to corporate applications. Like the bulk of &lt;em&gt;ZTNA&lt;/em&gt; products on the market today, &lt;em&gt;Verified Access&lt;/em&gt; uses conditions based on &lt;em&gt;identity data&lt;/em&gt; and &lt;em&gt;device posture&lt;/em&gt; for application access.&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%2F4e7d31syrcpz58m5n757.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%2F4e7d31syrcpz58m5n757.png" alt="Verified Access" width="800" height="317"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Pricing
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://aws.amazon.com/verified-access/pricing/" rel="noopener noreferrer"&gt;Verified Access&lt;/a&gt; is broken down into two components that make up the final bill.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Application Hours&lt;/strong&gt; is an hourly charge for associated applications, which comes in at &lt;strong&gt;$0.27/hr&lt;/strong&gt; &lt;em&gt;for 1-148800 app-hours&lt;/em&gt;. If you surpass &lt;em&gt;148800 app-hours&lt;/em&gt;, this is reduced to &lt;strong&gt;$0.20/hr&lt;/strong&gt;. Each partial application hour is rounded up and billed for the whole hour.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GB of data processed&lt;/strong&gt; is a &lt;strong&gt;$0.02&lt;/strong&gt; per GB charge that gets processed for all data flowing between users and applications while using the service.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Visit &lt;a href="https://aws.amazon.com/service-terms/" rel="noopener noreferrer"&gt;Service Terms&lt;/a&gt; to learn more about the terms and conditions for all release types. Remember, &lt;em&gt;Preview&lt;/em&gt; releases are not intended for production! You can check &lt;a href="https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services/" rel="noopener noreferrer"&gt;here&lt;/a&gt; to see if new services are available in a given region.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Other Big Announcements
&lt;/h2&gt;

&lt;p&gt;This year seemed bigger than ever, and if I had to pick one category that commanded a lot of attention, it was &lt;em&gt;data management&lt;/em&gt;. Nobody says this as elegantly as the CEO:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Adam Selipsky&lt;/strong&gt;&lt;br&gt;
"To unlock the full power, the full value of data, we need to make it easy for the right people and applications to find, access and share the right data when they need it — and to keep data safe and secure."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  DataZone
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://aws.amazon.com/datazone/" rel="noopener noreferrer"&gt;DataZone&lt;/a&gt; &lt;em&gt;aggregates&lt;/em&gt; data sources, sets up a data catalog of sorts, and allows you to define a taxonomy. You can then govern access to data in one place. Let's face it, &lt;em&gt;data&lt;/em&gt; is heavy, hard to manage, and time-consuming to make sense of. Anything that streamlines and simplifies administration is &lt;em&gt;winning&lt;/em&gt;.&lt;/p&gt;

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

&lt;p&gt;Wherever there is &lt;em&gt;data&lt;/em&gt;, security is not far behind. What happens when you combine &lt;em&gt;data lakes&lt;/em&gt; and &lt;em&gt;security&lt;/em&gt;? You get a purpose-built data lake for security-related data and name it &lt;a href="https://aws.amazon.com/about-aws/whats-new/2022/11/amazon-security-lake-preview/" rel="noopener noreferrer"&gt;Security Lake&lt;/a&gt;. On the surface, this looks pretty valuable as it appears to aggregate data from the cloud and on-premises security infrastructure and solutions and normalize it with the &lt;a href="https://github.com/ocsf" rel="noopener noreferrer"&gt;Open Cybersecurity Schema Framework (OCSF)&lt;/a&gt;. In this long history of &lt;em&gt;security&lt;/em&gt; and &lt;em&gt;data&lt;/em&gt;, gathering tons of &lt;em&gt;data&lt;/em&gt; was never a problem. Normalizing, understanding, and contriving value is.&lt;/p&gt;

&lt;h3&gt;
  
  
  CloudWatch - Internet Monitor
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;CloudWatch&lt;/em&gt; got a new feature called &lt;a href="https://aws.amazon.com/about-aws/whats-new/2022/11/amazon-cloudwatch-internet-monitor-preview/" rel="noopener noreferrer"&gt;Internet Monitor&lt;/a&gt; which enables you to continually monitor &lt;em&gt;internet&lt;/em&gt; availability and performance metrics. The monitoring happens through your VPC, CloudFront distributions, and Workspaces directories. The goal is to arm operations with insight into how internet issues impact the performance of applications hosted in AWS and &lt;em&gt;end-users&lt;/em&gt; accessing those applications.&lt;/p&gt;

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

&lt;p&gt;As always, &lt;strong&gt;re:Invent&lt;/strong&gt; did not disappoint. There was a lot of &lt;em&gt;post-pandemic&lt;/em&gt; excitement that was pretty contagious, and it was great to catch up with folks I hadn't seen in a while or had never met in &lt;em&gt;real-life&lt;/em&gt;. When you get that many &lt;em&gt;builders&lt;/em&gt; together, you know some magic is bound to happen.&lt;/p&gt;

</description>
      <category>mentalhealth</category>
      <category>learning</category>
      <category>spanish</category>
    </item>
    <item>
      <title>Evolution of AWS Site-to-Site VPN - Part 1</title>
      <dc:creator>William Collins</dc:creator>
      <pubDate>Tue, 22 Nov 2022 15:25:03 +0000</pubDate>
      <link>https://dev.to/aws-builders/evolution-of-aws-site-to-site-vpn-part-1-2hj3</link>
      <guid>https://dev.to/aws-builders/evolution-of-aws-site-to-site-vpn-part-1-2hj3</guid>
      <description>&lt;p&gt;The necessity for &lt;em&gt;protocols&lt;/em&gt; to keep communication secure has been around since the dawn of the internet. The first ever &lt;em&gt;VPN&lt;/em&gt; was jointly developed by a vendor consortium &lt;em&gt;(which included Microsoft)&lt;/em&gt; in &lt;strong&gt;&lt;em&gt;1996&lt;/em&gt;&lt;/strong&gt;, and came in the form of &lt;a href="https://en.wikipedia.org/wiki/Point-to-Point_Tunneling_Protocol"&gt;Point-to-Point Tunneling Protocol&lt;/a&gt;. Although many are skeptical about the value of VPNs in &lt;em&gt;2022&lt;/em&gt; and beyond, customer consumption of cloud provider &lt;em&gt;VPN&lt;/em&gt; services have paved the way for additional features and exponential scale.&lt;/p&gt;

&lt;p&gt;What impact do innovations like &lt;a href="https://aws.amazon.com/transit-gateway/"&gt;Transit Gateway&lt;/a&gt; and &lt;a href="https://docs.aws.amazon.com/vpn/latest/s2svpn/accelerated-vpn.html"&gt;Accelerated VPN Connections&lt;/a&gt; have on design complexity, network performance, and operations? In this blog, I will look back at the first time I deployed a &lt;em&gt;site-to-site&lt;/em&gt; VPN and then examine what is possible today when thinking through network design. This is going to be &lt;em&gt;two&lt;/em&gt; parts.&lt;/p&gt;

&lt;h2&gt;
  
  
  My First Experience
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html"&gt;Site-to-Site VPN&lt;/a&gt; in AWS is a fully managed and highly available service. This comes in the form of two endpoints on the AWS side (public IP addresses in different AZs per one VPN connection). This service is charged &lt;em&gt;hourly&lt;/em&gt; per connection &lt;em&gt;(plus data transfer charges)&lt;/em&gt;. My first experience connecting &lt;em&gt;on-premises&lt;/em&gt; to &lt;strong&gt;AWS&lt;/strong&gt; looked something like this:&lt;/p&gt;

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

&lt;p&gt;This was long before the public cloud had disrupted enterprise infrastructure. In this case, we had a single &lt;em&gt;VPC&lt;/em&gt; that required connectivity back to on-premises. Since the application being &lt;em&gt;developed&lt;/em&gt; wasn't production, we set up a single &lt;em&gt;VPN&lt;/em&gt; connection to a single physical router in the Data Center. This was easy work since, as &lt;em&gt;network engineers&lt;/em&gt;, we pushed &lt;em&gt;VPNs&lt;/em&gt; like &lt;em&gt;weights&lt;/em&gt;. And we had an existing &lt;em&gt;B2B&lt;/em&gt; process in place, so our paperwork + process was ready. Somewhere along the way, though, this application went into production.&lt;/p&gt;

&lt;h3&gt;
  
  
  Making it Highly Available
&lt;/h3&gt;

&lt;p&gt;Pre &lt;em&gt;Transit Gateway&lt;/em&gt;, you would typically see a Virtual Private Gateway and VPN connection from each &lt;em&gt;VPC&lt;/em&gt; back to &lt;em&gt;on-premises&lt;/em&gt; devices. If you follow best practices and want the highest availability possible in this scenario, you will also have redundant devices on-premises. This means you would end up with &lt;strong&gt;2x VPN connections&lt;/strong&gt;, which totals &lt;strong&gt;4x VPN tunnels&lt;/strong&gt; per VPC. Once the application went past &lt;em&gt;QA&lt;/em&gt;, to meet our requirements for &lt;em&gt;Tier 0&lt;/em&gt; infrastructure, we needed &lt;em&gt;high availability&lt;/em&gt;.&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;Traffic Forwarding&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;One question I could always count on getting from &lt;em&gt;developers&lt;/em&gt; when we would onboard this design was: "Since we have four tunnels here, why can't we forward traffic on all of them?" The simple answer is that you can override defaults and forward traffic across all tunnels &lt;strong&gt;to AWS&lt;/strong&gt; from on-premises; however, the VGW will always select a single tunnel for return traffic.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Growth, Scale, and Operations
&lt;/h3&gt;

&lt;p&gt;At some point, &lt;strong&gt;Digital Transformation&lt;/strong&gt; &lt;em&gt;(you may have heard of it)&lt;/em&gt; caused crazy fast growth. And with that growth came more VPCs. And with those VPCs came the necessity for connectivity back to on-premises. Say we add just two additional VPCs using the above methodology, and we end up with &lt;strong&gt;6x VPN connections&lt;/strong&gt;, bringing us to &lt;strong&gt;12x VPN tunnels&lt;/strong&gt; to manage.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--d03xeP01--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nbn3xjf5qr8ovkyitxc0.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--d03xeP01--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nbn3xjf5qr8ovkyitxc0.gif" alt="Multi VPC" width="880" height="567"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How much growth?&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The above example is &lt;strong&gt;single region&lt;/strong&gt; with only &lt;strong&gt;3 VPCs&lt;/strong&gt;. The reality for many organizations using &lt;em&gt;AWS&lt;/em&gt; is much larger. What would this design look like if we had &lt;strong&gt;50 VPCs&lt;/strong&gt;? What happens when we need to include &lt;em&gt;multi-region&lt;/em&gt; for DR capabilities? How does it impact operations when an application has performance issues, and the network is getting blamed?&lt;/p&gt;
&lt;/blockquote&gt;

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

&lt;p&gt;As we onboard more &lt;em&gt;VPCs&lt;/em&gt;, it becomes apparent that the above design does not easily scale. Bandwidth is limited, tunnels increase exponentially, and operations will have limited success in diagnosing network problems &lt;em&gt;(or proving the network is not the problem)&lt;/em&gt;. In &lt;em&gt;Part 2&lt;/em&gt; we will dive into how &lt;a href="https://aws.amazon.com/about-aws/whats-new/2018/11/introducing-aws-transit-gateway/"&gt;Transit Gateway&lt;/a&gt; and &lt;a href="https://docs.aws.amazon.com/vpn/latest/s2svpn/accelerated-vpn.html"&gt;Accelerated VPN Connections&lt;/a&gt; take this from an operational &lt;em&gt;misstep&lt;/em&gt; to an enterprise &lt;em&gt;success story&lt;/em&gt;.&lt;/p&gt;

</description>
      <category>awscommunitybuilders</category>
      <category>aws</category>
      <category>cloud</category>
    </item>
    <item>
      <title>Calculating Cost like a DevOps Boss with Infracost and AWS</title>
      <dc:creator>William Collins</dc:creator>
      <pubDate>Wed, 05 Oct 2022 11:59:05 +0000</pubDate>
      <link>https://dev.to/aws-builders/calculating-cost-like-a-devops-boss-with-infracost-and-aws-160</link>
      <guid>https://dev.to/aws-builders/calculating-cost-like-a-devops-boss-with-infracost-and-aws-160</guid>
      <description>&lt;p&gt;Blowing out &lt;em&gt;cloud spend&lt;/em&gt; is an easy thing to do. This &lt;a href="https://www.mckinsey.com/capabilities/mckinsey-digital/our-insights/unlocking-value-four-lessons-in-cloud-sourcing-and-consumption" rel="noopener noreferrer"&gt;McKinsey Report&lt;/a&gt; notes that &lt;strong&gt;80% of enterprises consider managing cloud spend a challenge&lt;/strong&gt;. I recently presented at the &lt;a href="https://circle.cloudsecurityalliance.org/kansas-city/home" rel="noopener noreferrer"&gt;Cloud Security Alliance&lt;/a&gt; in Kansas City and had the opportunity to network with some tremendous &lt;em&gt;DevOps&lt;/em&gt; and &lt;em&gt;Security&lt;/em&gt; professionals. One excellent side conversation somehow transitioned to a deep discussion on better ways to understand cost implications in the era of &lt;em&gt;infrastructure-as-code&lt;/em&gt;. Shouldn't cost be someone else's problem?&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%2Fn5gej5xl2wbf8u2huqtw.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%2Fn5gej5xl2wbf8u2huqtw.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Cost is a Shared Responsibility
&lt;/h2&gt;

&lt;p&gt;As many organizations continue shifting workloads to &lt;em&gt;the cloud&lt;/em&gt;, the cost impacts the bottom line. The responsibility of &lt;em&gt;cost-management&lt;/em&gt; now transcends the &lt;em&gt;CIO&lt;/em&gt; and &lt;em&gt;accounting&lt;/em&gt; straight down to individual &lt;em&gt;engineers&lt;/em&gt;. If this sounds scary, fear not. It is an incredible opportunity in the making.&lt;/p&gt;

&lt;h3&gt;
  
  
  Where do Engineers Work?
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;Engineers&lt;/em&gt; do not work in spreadsheets, nor do they work with accounting software. Most software engineers work &lt;em&gt;day-to-day&lt;/em&gt; in &lt;a href="https://en.wikipedia.org/wiki/Version_control" rel="noopener noreferrer"&gt;version control&lt;/a&gt;. Furthermore, the centralized teams managing &lt;em&gt;cloud infrastructure&lt;/em&gt; more broadly live in this world as well. &lt;em&gt;Version Control&lt;/em&gt; often employs an approval process before a &lt;em&gt;pull request&lt;/em&gt; is merged, and infrastructure is provisioned. What if you could see the cost impact right here? Yes, right where &lt;strong&gt;you, the engineer&lt;/strong&gt; live? This is what &lt;a href="https://www.infracost.io/" rel="noopener noreferrer"&gt;Infracost&lt;/a&gt; does.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;p&gt;First, follow the instructions found &lt;a href="https://github.com/infracost/actions" rel="noopener noreferrer"&gt;here&lt;/a&gt; to download and authenticate &lt;em&gt;Infracost&lt;/em&gt;. This includes creating an &lt;em&gt;org&lt;/em&gt; inside the platform, which is where you can fetch the &lt;strong&gt;API key&lt;/strong&gt;. Then we need a quick way to spin up some small &lt;em&gt;AWS&lt;/em&gt; instances and then quickly dial them up to more expensive options.&lt;/p&gt;

&lt;h2&gt;
  
  
  AWS Configuration
&lt;/h2&gt;

&lt;p&gt;I'll be using the following Terraform configuration to build the &lt;a href="https://aws.amazon.com/" rel="noopener noreferrer"&gt;AWS&lt;/a&gt; infrastructure. I'll keep the &lt;em&gt;dynamic&lt;/em&gt; portions of the configuration in a separate &lt;strong&gt;locals block&lt;/strong&gt; so we can easily adjust for testing.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h2&gt;
  
  
  Let's Test via CLI
&lt;/h2&gt;

&lt;p&gt;First, let's do a &lt;em&gt;terraform plan&lt;/em&gt; against the following criteria:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h3&gt;
  
  
  Running a Cost Estimate
&lt;/h3&gt;

&lt;p&gt;Now, let's run a cost estimate with &lt;em&gt;Infracost&lt;/em&gt; and provision an instance:&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%2F9x64clyv9kax8ea2o580.gif" 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%2F9x64clyv9kax8ea2o580.gif" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once this is done, we can check out the results on the &lt;em&gt;Infracost&lt;/em&gt; portal:&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%2Fmtf4v9w4viytfaddbnam.gif" 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%2Fmtf4v9w4viytfaddbnam.gif" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Running a Cost Diff
&lt;/h3&gt;

&lt;p&gt;Bigger and more expensive is better, right? Let's update our configuration with a few changes. Let's switch that &lt;strong&gt;t2.micro&lt;/strong&gt; to an &lt;strong&gt;m5.24xlarge&lt;/strong&gt;, and let's see how much it would cost to provision four of them:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;This time, we will tweak the command to generate a diff:&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%2Fxrqjgaw6l9mb5h7ohvfr.gif" 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%2Fxrqjgaw6l9mb5h7ohvfr.gif" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once we navigate back to the portal, we can see the cost change. I have gone from a monthly cost of &lt;strong&gt;$9.27&lt;/strong&gt; up to a panic-inducing &lt;strong&gt;$13,449&lt;/strong&gt;. Maybe I don't need the &lt;strong&gt;m5.24xlarge&lt;/strong&gt; instances for this testing!&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%2Ffbl6l53n83oyrcbqch40.gif" 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%2Ffbl6l53n83oyrcbqch40.gif" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Testing with GitHub Actions
&lt;/h2&gt;

&lt;p&gt;In the spirit of &lt;em&gt;shifting-left&lt;/em&gt;, let's have a go with &lt;a href="https://docs.github.com/en/actions" rel="noopener noreferrer"&gt;GitHub Actions&lt;/a&gt; running against every &lt;em&gt;pull request&lt;/em&gt;. A lot of spending happens outside production, so this is an excellent way to control spending right at the source. If something doesn't get deployed, it can't cost you anything.&lt;/p&gt;

&lt;h3&gt;
  
  
  GitHub Actions Workflow
&lt;/h3&gt;

&lt;p&gt;By default, it will execute the typical Terraform &lt;em&gt;init&lt;/em&gt; and &lt;em&gt;plan&lt;/em&gt;. Then it will run &lt;strong&gt;terraform show -json plan.tfplan&lt;/strong&gt; and save the output to &lt;strong&gt;plan.json&lt;/strong&gt;. Then, &lt;em&gt;Infracost&lt;/em&gt; can run its calculations. This will be populated in the &lt;em&gt;conversation&lt;/em&gt; log along with everything else being tested as part of the pipeline.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h3&gt;
  
  
  Creating a Pull Request
&lt;/h3&gt;

&lt;p&gt;Once we create any &lt;em&gt;pull request&lt;/em&gt;, the workflow will run and populate the cost details. At this point in the &lt;em&gt;workflow&lt;/em&gt;, multiple approvals can be added. Three sets of eyes are better than one when spending so much with the click of a button! You can find the supported CICD platforms in the &lt;em&gt;Infracost&lt;/em&gt; &lt;a href="https://www.infracost.io/docs/integrations/cicd/" rel="noopener noreferrer"&gt;documentation&lt;/a&gt;.&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%2Fylohzslk08409nedmnqc.gif" 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%2Fylohzslk08409nedmnqc.gif" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;Understanding &lt;em&gt;TCO&lt;/em&gt; in the cloud is a deep topic that spans a whole organization. It can be easy to keep provisioning &lt;a href="https://aws.amazon.com/ec2/instance-types/" rel="noopener noreferrer"&gt;EC2 instances&lt;/a&gt; when you are disconnected from the &lt;em&gt;cost&lt;/em&gt;. The ability to see the cost in the &lt;em&gt;pipeline&lt;/em&gt; is a fantastic way to practice &lt;em&gt;due diligence&lt;/em&gt; on the &lt;em&gt;technical&lt;/em&gt; side of responsibility.&lt;/p&gt;

&lt;p&gt;Arming &lt;em&gt;engineers&lt;/em&gt; with the right &lt;em&gt;tooling&lt;/em&gt; and &lt;em&gt;knowledge&lt;/em&gt; will help drive cost-conscientious decisions. Small steps like this, along with driving &lt;a href="https://aws.amazon.com/blogs/training-and-certification/aws-partners-learn-how-to-establish-continuous-governance-and-management-at-scale/" rel="noopener noreferrer"&gt;continuous governance&lt;/a&gt; strategically, are significant steps in getting control of &lt;em&gt;cloud spend&lt;/em&gt;.&lt;/p&gt;

</description>
      <category>awscommunitybuilders</category>
      <category>aws</category>
      <category>terraform</category>
      <category>costmanagement</category>
    </item>
    <item>
      <title>The Best Terraform Feature Yet?</title>
      <dc:creator>William Collins</dc:creator>
      <pubDate>Tue, 06 Sep 2022 14:36:11 +0000</pubDate>
      <link>https://dev.to/aws-builders/the-best-terraform-feature-yet-24f5</link>
      <guid>https://dev.to/aws-builders/the-best-terraform-feature-yet-24f5</guid>
      <description>&lt;p&gt;&lt;strong&gt;Optional&lt;/strong&gt; attributes for object type constraints is almost here! I've been waiting for this feature to come along for a while. I have tested it extensively in &lt;strong&gt;-alpha&lt;/strong&gt;, and I can confidently confirm that it is a &lt;strong&gt;game changer&lt;/strong&gt;. This feature is long in the making, being discussed as far back as &lt;a href="https://github.com/hashicorp/terraform/issues/19898"&gt;this thread&lt;/a&gt; in &lt;strong&gt;2018&lt;/strong&gt;. Today, it is now in &lt;a href="https://github.com/hashicorp/terraform/releases/tag/v1.3.0-beta1"&gt;beta&lt;/a&gt;, so the official release could be any day now. Let's demonstrate how this is useful and build some common &lt;a href="https://registry.terraform.io/providers/hashicorp/aws/latest"&gt;AWS infrastructure&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why it is Useful
&lt;/h2&gt;

&lt;p&gt;Before this feature, you could resort to using &lt;strong&gt;tricks&lt;/strong&gt; to make arguments in &lt;em&gt;object variables&lt;/em&gt; optional. This usually included providing a &lt;strong&gt;null&lt;/strong&gt; value for optional parameters and then doing some fancy &lt;strong&gt;lookup&lt;/strong&gt; or &lt;strong&gt;conditional&lt;/strong&gt; like so:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Now, we can make that individual attribute optional without any &lt;em&gt;hackery&lt;/em&gt; involved. The first thing to know here is that when setting &lt;strong&gt;optional(string)&lt;/strong&gt; without a &lt;em&gt;default value&lt;/em&gt; as shown below, the &lt;em&gt;default value&lt;/em&gt; is &lt;strong&gt;null&lt;/strong&gt;.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;While having the &lt;em&gt;default value&lt;/em&gt; automatically set to &lt;strong&gt;null&lt;/strong&gt; is helpful, it only solves half of the problem. What happens if we have a scenario where we still want to provide a value in the logic, even if one isn't supplied at &lt;em&gt;runtime&lt;/em&gt;? Then we can set a &lt;em&gt;default value&lt;/em&gt; with a second argument like this:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h2&gt;
  
  
  Building some Infrastructure in AWS
&lt;/h2&gt;

&lt;p&gt;This feature comes in handy when building &lt;em&gt;complex data types&lt;/em&gt;. Let's look at something as simple as building an &lt;strong&gt;AWS VPC&lt;/strong&gt;. Your organization &lt;em&gt;could&lt;/em&gt; be using &lt;a href="https://docs.aws.amazon.com/organizations/latest/userguide/services-that-can-integrate-ipam.html"&gt;VPC IPAM&lt;/a&gt; but may still need the option to pass in &lt;em&gt;custom&lt;/em&gt; CIDRs at runtime. Or, other &lt;em&gt;standard defaults&lt;/em&gt; may need to be set if not provided at runtime. Take the following example:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;If only the &lt;em&gt;cidr_block&lt;/em&gt; attribute is provided at runtime, then the &lt;em&gt;IPAM&lt;/em&gt; attributes will be nullified. This simplifies our resource configuration as follows:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h2&gt;
  
  
  Test it Yourself!
&lt;/h2&gt;

&lt;p&gt;Want to start testing? Grab &lt;a href="https://github.com/hashicorp/terraform/releases/tag/v1.3.0-beta1"&gt;v1.3.0-beta1&lt;/a&gt; and setup your &lt;strong&gt;versions.tf&lt;/strong&gt; like this:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


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

&lt;p&gt;&lt;strong&gt;AWS VPC&lt;/strong&gt; is a simple example. This feature really shines when building reusable &lt;em&gt;infrastructure-as-code&lt;/em&gt; for &lt;a href="https://aws.amazon.com/network-firewall/?whats-new-cards.sort-by=item.additionalFields.postDateTime&amp;amp;whats-new-cards.sort-order=desc"&gt;Network Firewall&lt;/a&gt; or even &lt;a href="https://docs.aws.amazon.com/vpc/latest/userguide/vpc-network-acls.html"&gt;Network ACLs&lt;/a&gt;. Anything that simplifies &lt;strong&gt;something&lt;/strong&gt; and reduces or eliminates any &lt;strong&gt;hacks&lt;/strong&gt; required to reach a logical outcome is super valuable. Great work finally driving this one home &lt;a href="https://www.hashicorp.com/"&gt;HashiCorp&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>awscommunitybuilders</category>
      <category>aws</category>
      <category>terraform</category>
    </item>
  </channel>
</rss>
