<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Brandon Damue on Medium]]></title>
        <description><![CDATA[Stories by Brandon Damue on Medium]]></description>
        <link>https://medium.com/@dbrandonbawe?source=rss-8b8d692b1f3d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Lieiz31vaQ4Vshh0DmXYvQ@2x.jpeg</url>
            <title>Stories by Brandon Damue on Medium</title>
            <link>https://medium.com/@dbrandonbawe?source=rss-8b8d692b1f3d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 23:23:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dbrandonbawe/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Architecting the Future: Building Production-Ready GenAI Bots on AWS]]></title>
            <link>https://medium.com/@dbrandonbawe/architecting-the-future-building-production-ready-genai-bots-on-aws-2d9f4d18d789?source=rss-8b8d692b1f3d------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d9f4d18d789</guid>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[rags]]></category>
            <dc:creator><![CDATA[Brandon Damue]]></dc:creator>
            <pubDate>Tue, 03 Feb 2026 18:50:52 GMT</pubDate>
            <atom:updated>2026-02-03T18:50:52.550Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_dnvFxwSC0JZKTYwQYPY1w.png" /></figure><p>When you listen to expert’s in AI talk about the future, most of them say AI is not going to replace everyone but it is for sure going to make those who don’t know how to use AI obsolete while those who have learned how to use it will thrive. What does that mean for you as someone who is a software engineer, DevOps engineer, SRE or other related roles? It means learning how to use AI beyond the basics is a survival mechanism. Saying that it is a survival mechanism might sound like I am blowing things out of proportion (I hope I am) but it just might be the case that I am not.</p><p>This article is about building a GenAI chat application on AWS which as you might already know is not the only way to use AI but as things stand is the most widely use form of AI. All that aside, let’s cut to the chase starting with an architecture diagram of the Application we will be building.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*199UMxe7tyRJ3B-UvkbVpA.png" /></figure><p>You can view this a three tier architecture with a frontend, middleware and backend layers. This three way split enforces the principle of separation of concerns offering you benefits such as reduced complexity, allowing you to build an application that is more maintainable and the ability to scale components independently as need arises.</p><p>Here is a list of service used for this project. For each service I will give a little bit of detail of how it is intended for us for this particular application architecture.</p><ul><li><strong><em>CloudFront</em></strong>: CloudFront sits just in front of the chat applications user interface or frontend. In case you are wondering what CloudFront does, it is a CDN service by AWS used to cache data closer to where your users are to reduce latency and improve application performance for faster access. This data (mostly static content like HTML, CSS, JS and image files) is cached in edge locations which are data centres that are globally positioned near end-users. We are aware that most of the content in a GenAI chatbot is dynamic content generated by the language model at inference time. CloudFront also optimizes this process because it routes requests from the user through the edge location to a backend via the AWS global network backbone rather than the public internet which avoids congestion that exists on the internet. To protect the application that the CloudFront distribution points to from common web vulnerabilities, we can use an AWS WAF protection pack (web ACL).</li><li><strong><em>Amplify</em></strong>: For our use case, Amplify is used for hosting the Chatbot UI. I chose to use Amplify Hosting to host the ChatUI because it allows zero-config deployments for Next.js application. This allows you to get the ball rolling fast and also gives you more time to focus on other parts of your application. In a project such as this, you get things going fast by making use of a ready-made open source AI chatbot template. If I end up implementing this project, I won’t spend time building a ChatUI from scratch because I have ready-made ones like <a href="https://vercel.com/templates/next.js/nextjs-ai-chatbot">this one</a> made built with <a href="https://nextjs.org/">Next.js</a> by Vercel.</li><li><strong><em>API Gateway</em></strong>: It sits between the Chat UI and Amazon Lex. You can view it as the bridge between the frontend and the backend. In our use case API gateway, it provides a secure endpoint for user requests flowing to the backend from the public internet and you can integrate with an authentication service like Amazon Cognito user pools to add an authentication feature to the application. As a summary, API gateway handled input validation, traffic management through throttling and rate limiting and also some CORS support.</li><li><strong><em>Amazon Lex</em></strong>: Amazon Lex is the service that powers the conversational interface of our GenAI chatbot. It is a service for building conversational interfaces using voice and text. In this architecture, Lex is responsible for understanding user input and generating appropriate responses. It uses advanced natural language understanding (NLU) to process user input and can be integrated with other AWS services to enhance its capabilities. For instance, you can connect Lex to AWS Lambda functions to execute business logic or fetch data from other services.</li><li><strong><em>Lambda</em></strong>: AWS Lambda is used to run backend code in response to events. In this architecture, Lambda functions serve multiple purposes. One key role is as the fulfillment Lambda function connected to Amazon Lex, which executes specific tasks based on user interactions, such as querying a database or processing data. Additionally, other Lambda functions are part of a Step Functions workflow designed for ingesting and refining data that comes into the knowledge S3 bucket. This workflow ensures that data is processed efficiently and is ready for use by the chatbot, enhancing its ability to provide accurate and relevant responses. As you probably know already, Lambda allows you to run code without provisioning or managing servers, making it a cost-effective and scalable solution for handling backend logic.</li><li><strong><em>Redis Cache</em></strong>: In this architecture, Redis is used as an in-memory data store to cache frequent responses, significantly improving the application’s performance and reducing costs. By caching responses that have been processed previously, Redis allows the application to quickly retrieve these responses without having to reprocess the same data. This reduces the computational load on the backend systems and minimizes the latency experienced by users. When a user makes a request, the application first checks the Redis cache to see if a response for that request already exists. If it does, the cached response is returned immediately, providing a faster user experience. If not, the application processes the request, generates a response, and stores it in the Redis cache for future use. This caching mechanism is particularly beneficial for handling repetitive queries or frequently accessed data, ensuring that users receive quick responses while optimizing resource utilization.</li><li><strong><em>RDS for PostgreSQL with PGVector</em></strong>: In this architecture, Amazon RDS is used to manage a PostgreSQL database with the PGVector extension. This setup allows for the storage and management of vector embeddings, which are crucial for performing similarity searches during inference time. Vector embeddings are representations of data in a continuous vector space, often used in AI applications to capture semantic meaning. By using PGVector, you can efficiently store and query these embeddings, enabling the chatbot to perform tasks such as finding similar phrases or concepts based on user input. RDS provides automated backups, patching, and scaling, ensuring that your database is reliable and performant. This choice of database is particularly beneficial for applications that require advanced search capabilities and the ability to handle complex queries involving vector data.</li><li><strong><em>S3</em></strong>: In this architecture, Amazon S3 serves primarily as the knowledge bucket where files are ingested and further processed into chunks that are used to make text embeddings. Here, the S3 bucket plays a crucial role in enabling RAG by providing a scalable and reliable storage solution for large datasets. In a RAG architecture, S3 is used to store vast amounts of unstructured data, such as documents, articles, and other text sources. This data is then processed to create embeddings, which are stored in a database like RDS with PGVector for efficient similarity searches.</li><li><strong><em>CloudWatch &amp; Xray</em></strong>: AWS CloudWatch and X-Ray are used together to monitor and enhance the application’s performance and health. CloudWatch provides insights into resource utilization, application metrics, and operational health by setting up alarms, visualizing logs, and creating dashboards to monitor the chatbot’s performance. Meanwhile, X-Ray complements this by tracing requests as they travel through the application, offering a detailed view of the application’s architecture and identifying bottlenecks or performance issues. Together, CloudWatch and X-Ray ensure that the application runs smoothly and efficiently, providing a comprehensive monitoring solution.</li><li><strong><em>Secrets Manager</em></strong>: It is used to securely store and manage sensitive information such as API keys, access keys, and database credentials. It provides a centralized and secure way to manage secrets, ensuring that sensitive data is protected and only accessible to authorized services and applications. Secrets Manager automatically rotates secrets, eliminating the need for manual updates and reducing the risk of exposure. By integrating with IAM, it controls access to secrets, ensuring that only authorized users and applications can retrieve them. This enhances the security of the application by safeguarding critical information and simplifying secret management.</li><li><strong><em>VPC Endpoints</em></strong>: Data exchanges between different services are routed through VPC endpoints, ensuring that the data does not traverse the public internet. VPC endpoints provide a secure and private connection between your VPC and AWS services, allowing data to flow directly within the AWS network. Using VPC endpoints offers several benefits. Firstly, it enhances security by keeping data within the AWS network, reducing exposure to potential threats on the public internet. Secondly, it improves performance by minimizing latency, as data does not have to travel through external networks. Lastly, it can reduce costs associated with data transfer over the internet, as traffic remains within the AWS infrastructure. This setup ensures that your application maintains high levels of security, reliability, and efficiency.</li></ul><p>The architecture of this chatbot application is designed to incorporate both synchronous and asynchronous elements, optimizing for real-time interaction and efficient processing. On the synchronous side, the user-facing components, such as the chat UI, Amazon Lex, and API Gateway, handle requests and responses in real-time. This ensures that users experience immediate feedback during their interactions with the chatbot, maintaining a seamless conversational flow. Conversely, the backend processes leverage asynchronous operations to enhance scalability and resource efficiency. Services like AWS Lambda and Amazon S3 operate independently, processing events and storing data without requiring immediate responses. This asynchronous design allows the system to handle large volumes of data and complex workflows, such as data ingestion and refinement, without impacting the real-time user experience. By balancing synchronous and asynchronous operations, the architecture effectively supports both the immediacy of user interactions and the robustness of backend processing.</p><h3>Conclusion</h3><p>The architecture we’ve talked about in this article is just a starting point, kind of like a blueprint for building a GenAI chatbot in the real world. It’s a solid foundation, but when you’re ready to take it to the next level, you’ll need to think about a few more things. Real-world applications often come with their own set of challenges, like specific business needs, how big you want to scale, keeping everything secure, and making sure it plays nice with other systems you might already have. By using this setup as your base, you can tweak and adjust it to fit exactly what you need, making sure your chatbot is not only up and running but also ready to handle whatever comes its way. This way, you’re not just building something that works today, but something that’s ready for the future too.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d9f4d18d789" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Microsoft Entra ID: What you need to know]]></title>
            <link>https://medium.com/@dbrandonbawe/microsoft-entra-id-what-you-need-to-know-8853a363c9d1?source=rss-8b8d692b1f3d------2</link>
            <guid isPermaLink="false">https://medium.com/p/8853a363c9d1</guid>
            <category><![CDATA[entra-id]]></category>
            <category><![CDATA[active-directory]]></category>
            <category><![CDATA[access-control]]></category>
            <category><![CDATA[azure]]></category>
            <dc:creator><![CDATA[Brandon Damue]]></dc:creator>
            <pubDate>Mon, 09 Jun 2025 15:23:08 GMT</pubDate>
            <atom:updated>2025-06-09T15:23:08.720Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FmJkocn5uzQG7jlK_YAWvw.png" /></figure><p>Microsoft has been an industry leader in organizational user and object directory services with their Active Directory suite of services. Prior to the prevalence of cloud services, organizations have hosted their directory solutions primarily on-prem.</p><p>Many organizations are now moving these solutions to the cloud and many more have them running in a hybrid configuration (i.e. both on-prem and in the cloud).The purpose of this article is go over Entra ID, the new service organizations are using for identity and access management. Rather than starting this discussion (if I can call it that as I am the only one talking) with what it is, we are going to go in the opposite direction to begin with what it is not. Walk with me!</p><h3>What is it not?</h3><p>A lot of people think Entra ID is the cloud version of Active Directory Domain Services but it is not. Well, Microsoft is to be blamed for this confusion as Entra ID used to be known as <em>Azure Active Directory</em>.</p><p>If Entra ID is not the cloud version of Active Directory, what is it then? As stated in this <a href="https://learn.microsoft.com/en-us/entra/fundamentals/whatis">Microsoft Learn documentation</a> for Entra ID, <em>it is a cloud-based identity and access management service that an organization can use to make it possible for its employees to access external resources such, as the Azure portal, Microsoft 365 apps</em> (an aside: I recently learned that Office 365 and Microsoft 365 do not refer to the exact same suite of applications. I had always assumed they did) <em>and a wide range of SaaS (Software as a Service) applications</em>. Entra ID also helps organization manage access to internal line of business applications and other applications and services existing within the organizations intranet.</p><p>Check out <a href="https://learn.microsoft.com/en-us/entra/fundamentals/compare">this article</a> that compares Active Directory Domain Service to Microsoft Entra ID so how they differ.</p><h3>Entra ID Licensing</h3><p>When you subscribe to any Microsoft Online Business service such as Microsoft 365, you automatically gain access to the free tier (license) of Entra ID. If you need additional features other than those offered in the free tier, you can upgrade to Entra Premium P1 or Premium P2 licenses. Here is what you get depending on the Entra ID license you decide to subscribe to:</p><ul><li>The free tier provides you with user and group management, the ability to sync your cloud environment with your on-prem directory, self-service password change for cloud users, Single Sign-On (SSO) across Azure and popular SaaS applications.</li><li>With the Entra ID P1 license, you get everything offered in the free tier plus: the ability for hybrid users to access resources that are in the cloud as well as those on-prem. With it also comes the support for advanced administration which includes dynamic membership groups, Microsoft identity Manager, self-service group management, cloud write-backs capabilities which allows on-prem users to use self-service password reset.</li><li>When you upgrade to the Premium P2 license, you get all the features that come with the free and Premium P1 license. In addition to these features, you get: Microsoft Entra ID Protection that allows you to use risk-based conditional access policies as well as Privileged Identity Management, an offering that makes it possible for you to discover, restrict, monitor administrators, their access to resources and to provide just-in-time access when needed.</li></ul><p>To see a complete list of all the free and premium features that Entra ID offers, you can go <a href="https://learn.microsoft.com/en-us/entra/fundamentals/whatis">here</a> to learn more.</p><h3>Entra Authentication</h3><p>I believe it goes without saying that authenticating user credentials when they try to sign into a device or application is the core feature of any identity and access management solution. In the case of Entra ID, it does more than just authenticate user credentials during sign-in processes. Entra ID also offers security features such as:</p><ul><li>Self-service Password Reset which allows users to be able to reset their passwords if their account is locked or they forget their password.</li><li>Multi-Factor Authentication (MFA)</li><li>Write-back of password changes to on-prem environments</li><li>Enforcing password policies and</li><li>Passwordless Authentication made possible by tools such as Windows Hello for Business which enables users to sign into a device or application without a password but with their biometrics (facial recognition and fingerprints)</li></ul><p>With these components of authentication, Entra ID makes the sign in process more convenient for end-users.</p><h3>Role Based Access Control (RBAC) in Entra ID</h3><p>When using Entra ID, you can grant granular access to your admins following the famous Principle of Least Privilege that calls for only granting the access required for completing a task no less, no more.</p><p>When it comes to RBAC in Entra ID, the key concepts you need to have a solid understanding of are:</p><h3>Role Types</h3><p>In Entra ID you can use either a built-in role (roles created by Microsoft that you can’t modify) or a custom role that you create to handle a specific use case. Built-in roles come with a fixed set of permissions that you can’t change. Microsoft keeps adding to their list of built-in roles to account for more use cases as they come up.</p><p>If there is a task that a role needs to be assigned for and all the permissions required for this task is not fully covered by a built-in role, you can create a custom role with permissions that you specify. This allows for more granular control over what a particular role can do. To be able to create a custom role, you need to create a role definition which is essentially a collection of permissions listing the create, update or delete operations that can be performed on an Entra resource.</p><h3>Role Assignment</h3><p>As you might have already guessed, role assignment is basically attaching a role definition (sometimes just called a role) to an entity usually called a security principal (which is nothing but a fancy name for a user, a group or an application) at a particular scope (where the permissions apply) so that they can gain access to something. This makes access control more convenient for administrator as all you have to do to grant access is to add a role assignment and then remove it when this access needs to be revoked.</p><p>Before you are able to perform a role assignment, a scope has to be defined. The three levels of scope that can be specified are: Tenant, administrative unit and Entra resource scope. When you specify the scope as Tenant or administrative unit, you are essentially applying the permissions to everything within the container (tenant or administrative unit) except the container itself. When you scope a role to a resource you are applying permissions to everything about that resource. It is also worth noting that scopes are structured in a parent-child type relationship which allows the child scope to automatically inherit the permissions granted to its parent.</p><p>Accept my apologize if I lost you when I started talking about tenants and administrative units. The tenant is this case refers to your entire Entra ID package while the administrative unit refers to just a part (subsection) of your Entra ID tenant.</p><p>It is worth noting that using built-in roles in Entra is free, if you want to create custom roles you need have the Entra Premium P1 license or higher. With the free tier, you can only assign the built-in roles directly to users. When you upgrade one level up to the Premium P1 license, you get the ability to create role-assignable groups that you can add users to and then add roles to the group rather to users directly which makes role assignment a more manageable process. If this is still not enough for your needs, you get the ability to use Privileged Identity Management which makes it possible for you to use just-in-time role assignment to grant access just when it is required and makes roles time-limited rather than permanent. It also goes further to give your more auditing power alongside detailed reporting capabilities.</p><p>To summarize this section, a role assignment has three components: the role definition, the security principal and the scope. You can think of these components are the Who (security principal), the What (role definition) and the Where (scope) of role assignments.</p><h3>Conclusion</h3><p>There is a lot to learn about Entra ID but the truth is that you don’t have to know everything to start using the features it offers to make identity and access management across your organization better. As with almost everything in life and business, start small and then build up from there as need arise.</p><p>If you want to learn more about Entra ID, Microsoft Learn is all you need or at the very least, a really great place to start. Thank you for taking the time to read this and I hope you learned as much as I did while writing it. If you enjoyed it or learned a thing or two, follow me on here, connect with me on <a href="https://www.linkedin.com/in/brandon-damue/">Linkedin</a> or check out my <a href="https://brandondamue.com/">website</a> for more.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8853a363c9d1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What the H*ck is Terraform: An Introduction]]></title>
            <link>https://medium.com/@dbrandonbawe/what-the-h-ck-is-terraform-an-introduction-7cb712b9507d?source=rss-8b8d692b1f3d------2</link>
            <guid isPermaLink="false">https://medium.com/p/7cb712b9507d</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[infrastructure]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <category><![CDATA[iac]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Brandon Damue]]></dc:creator>
            <pubDate>Fri, 17 Jan 2025 17:22:19 GMT</pubDate>
            <atom:updated>2025-01-17T17:22:19.036Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*31Tttgw7kfcPrskF6JCx5w.png" /></figure><p>I have been absent from sharing my learnings for quite some time. My first article of 2025 is also my first after a four month writing hiatus. Isn’t it a nice coincidence that my first article of the new year is on a new technology (new in the sense that I haven’t done much with it before) that I am currently diving deep into? If you are new to Terraform as well, don’t worry because I got you. The aim of this article is to give you a soft-landing introduction to Terraform. Let’s glide into it!</p><p>Terraform is an open-source, cloud-agnostic (meaning you can use Terraform to provision and manage infrastructure on different cloud platforms) infrastructure as code tool that enables you to safely and predictably provision and manage infrastructure in the cloud.</p><p>If you’ve ever had to do a task such as creating a couple of Amazon EC2 instances with security groups and other configurations by having to click around in the AWS management console, you can attest to how tedious that might have been. Terraform makes carrying out such tasks a breeze. Before we go any further, here are some of the benefits of using Terraform to keep you interested and inspire you to consider using it the next time you are building out infrastructure in the cloud. These benefits include:</p><ul><li>Terraform templates can be source controlled that is you can use GitHub, BitBucket and related technologies to keep track of the different versions of your Terraform templates.</li><li>It offers multi-cloud support (cloud-agnostic) with over 100 providers including Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform (GCP)</li><li>Has separate plan and apply stages so you can verify changes to your infrastructure before they happen (more on this later).</li><li>Offers a public registry of modules that make provisioning common groups of resources easy.</li><li>It is stateful and keeps track of all infrastructure it provisions.</li></ul><p>Now it’s time to dive deeper. In this section of the article, we will explore Terraform’s CLI tool, Terraform Configuration, the HashiCorp Configuration Language (HCL) and Terraform providers.</p><h3>Terraform CLI Tool</h3><p>Terraform is written in GoLang and packaged as a single binary which makes installing it a breeze. You can download the binaries for the open-source version of Terraform by clicking <a href="https://developer.hashicorp.com/terraform/install?product_intent=terraform">here</a>. Make sure you are downloading the binary that matches the OS of the computer you want to install Terraform on.</p><p>Once Terraform is installed, it comes with a list of commands and subcommands you can use to provision and make changes to your infrastructure. The CLI has three main commands:</p><ul><li>terraform init</li><li>terraform plan</li><li>terraform apply</li></ul><p>Time to look at each one in detail.</p><p>terraform init: This command initializes a working directory containing Terraform configuration files. This is the first command that you should run after writing a new Terraform configuration or cloning an existing one from version control. Running this command multiple times does not negatively affect your project as it skips the re-initializing process unless in scenarios where changes have been made to your configuration.</p><p>terraform plan: The command lets you preview the changes Terraform is going to make to your infrastructure when you run terraform apply. It essentially shows you a detailed execution plan of the resources that will created, modified or destroyed. This helps you verify that the proposed changes tie with what you expect to happen when you apply the changes. There is no need to run this command when you are sure that what you have written in your configuration file will run exactly as expected.</p><p>terraform apply: As the name suggests, this is the command you run when you want to apply the changes made to your configuration files. It is the command that actually creates or modifies your infrastructure. When you run the command without the optional -auto-approve flag, it requires that you manually confirm that you want to have the proposed changes applied by typing yes in the interactive terminal.</p><p>💡 Terraform’s official documentation recommends that you only use -auto-approve when you are sure that no one is going to make changes to your infrastructure outside of your Terraform workflow. Doing this minimizes the risks of configuration drift and unpredictable changes.</p><p>In addition to these three primary commands, there are also subcommands that the Terraform CLI offers. You can read about them in the <a href="https://developer.hashicorp.com/terraform">official documentation</a>.</p><h3>Providers</h3><p>Terraform uses a plugin architecture to manage all of the resource providers that it supports so no providers are included when you first install Terraform. You declare which providers you need to use in a configuration file and they are installed from the <a href="https://registry.terraform.io/browse/providers?product_intent=terraform">Terraform registry</a> when you run the terraform init command. This registry is the main directory of publicly available Terraform providers, and hosts providers for most major infrastructure platforms such as AWS, Microsoft Azure, GCP, Alibaba Cloud, and others.</p><p>Each provider has its own documentation, describing its resource types and their arguments. This documentation is included in the registry.</p><h3>Terraform Configuration and HashiCorp Configuration Language</h3><p>A <em>Terraform configuration</em> is a complete document in the Terraform language that tells Terraform how to manage a given collection of infrastructure. The Terraform files you work with to manage your infrastructure use the .tf file extension. The Terraform language (aka HCL), is designed to be both human-readable and machine-friendly.</p><p>HCL allows you to treat your infrastructure as code and serves as your system’s “living documentation”. The main goal of the Terraform language according to the official documentation is declaring resources, which represent infrastructure objects. All other language features exist only to make the definition of resources more flexible and convenient.</p><p>The language is declarative, describing an intended goal rather than the steps to reach that goal. Here is the syntax of the Terraform language as seen in the official documentation:</p><pre>resource &quot;aws_vpc&quot; &quot;main&quot; {<br>  cidr_block = var.base_cidr_block<br>}<br><br>&lt;BLOCK TYPE&gt; &quot;&lt;BLOCK LABEL&gt;&quot; &quot;&lt;BLOCK LABEL&gt;&quot; {<br>  # Block body<br>  &lt;IDENTIFIER&gt; = &lt;EXPRESSION&gt; # Argument<br>}</pre><p>As seen in the syntax, the language consists only of a few basic elements: <em>Blocks</em>, <em>Arguments</em>, and <em>Expressions</em>.</p><blockquote><strong>Blocks</strong> are containers for other content and usually represent the configuration of some kind of object, like a resource. Blocks have a <em>block type,</em> can have zero or more <em>labels,</em> and have a <em>body</em> that contains any number of arguments and nested blocks. Most of Terraform’s features are controlled by top-level blocks in a configuration file.</blockquote><blockquote><strong>Arguments</strong> assign a value to a name. They appear within blocks.</blockquote><blockquote><strong>Expressions</strong> represent a value, either literally or by referencing and combining other values. They appear as values for arguments, or within other expressions.</blockquote><h3>Conclusion</h3><p>If you are a business that is looking to do more with Terraform, HashiCorp also provides enterprise versions of Terraform that provide additional features for collaboration, infrastructure policy, and governance.</p><p>If it is the case that I succeeded in scratching your curiosity’s itch about Terraform with this article, I implore you to follow me, connect with me on LinkedIn, and keep an eye out as I will be putting out more articles on Terraform and related technologies. Until then, you can check out my other articles here, and don’t stop going after your goals and ideals.</p><h3>References</h3><ul><li><a href="https://developer.hashicorp.com/terraform">Terraform Official Documentation</a></li><li><a href="https://registry.terraform.io/?product_intent=terraform">Terraform Registry</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7cb712b9507d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Destructuring a CloudFormation Template]]></title>
            <link>https://medium.com/@dbrandonbawe/destructuring-a-cloudformation-template-7042a59fa0ca?source=rss-8b8d692b1f3d------2</link>
            <guid isPermaLink="false">https://medium.com/p/7042a59fa0ca</guid>
            <category><![CDATA[cloudformation]]></category>
            <category><![CDATA[cloudformation-template]]></category>
            <category><![CDATA[iac]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Brandon Damue]]></dc:creator>
            <pubDate>Fri, 06 Sep 2024 00:01:33 GMT</pubDate>
            <atom:updated>2024-09-06T00:01:33.047Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SpTJXux_lYFEHtGERdickg.png" /></figure><p>There is a LeetCode problem I was working today in which I used JavaScript array destructuring. While working on this problem, I was thinking what AWS service can I destructure (breakdown) to help beginners gain a better understanding? CloudFormation and other services came to mind but I got hooked on unpacking the anatomy of a CloudFormation template. So that’s what has inspired what you are reading right now.</p><p>Before we begin, imagine you have to create a solution that has many different resources in the AWS cloud. Say you want to deploy a three tier application with a web server running on EC2 instances with security groups, load balancers, auto scaling groups amongst others; an application tier with it own fleet of instances, security groups, NACLs and other configurations and then a database tier running on RDS, DynamoDB or any other database service. Imagine how much clicking around you would have to do in the. management console just to create a few of these resources.</p><p>CloudFormation comes to wipe the tears of such tedious and repetitive task from your eyes so to speak. It is an Infrastructure as Code (IaC) tool that enables you to define your infrastructure declaratively using either YAML or JSON. With CloudFormation, you can automate the creation, the updating, and the deletion of your infrastructure and its configurations all in one place. That’s it for the intro. It’s time for the main event!</p><h3>Breaking Down the CloudFormation Template</h3><p>You might have gleaned from the introductory paragraphs that the cornerstone of CloudFormation is the template. This is where you specify the resources you want CloudFormation to create or update. Regardless of whether you choose JSON or YAML, the structure of a CloudFormation template remains the same. Personally, I prefer using YAML because it allows for comments within templates and its indentation style is more readable than JSON with its curly braces.</p><p>Every CloudFormation template has several sections, including: the format version, the document description, parameters, mappings, conditions, transform, resources (the only compulsory section) and the output section. Let’s go over these sections one by one.</p><h3>Format version</h3><p>This refers to the version of the CloudFormation template. The latest template format version is 2010–09–09 and it is also the only valid value at the time of writing.</p><h3>Description</h3><p>This is an optional section where you can leave comments to describe the infrastructure you are creating within the template. It’s your template’s documentation as it informs collaborators on what’s happening within the template without having to look further.</p><h3>Resources</h3><p>The resources section is the only required section of a CloudFormation template, meaning you have to declare at least one infrastructure resource. Each resource is broken down into three parts, a <em>logical ID</em> that is unique within the template, a <em>resource type</em>, and <em>properties</em> for that resource.</p><p>The logical ID is used to describe the resources, and can be referenced in other parts of the template. The resource type is a predefined CloudFormation code for the resource that you’re creating. You’ll need to look this up in the CloudFormation documentation. For example, the resource type of an S3 bucket is “AWS::S3::Bucket”.</p><p>Resource properties are additional options that you can specify for a resource. For example, to create an S3, you can declare resource properties such as the bucket name, access control, replication configurations and more.</p><h3>Parameters</h3><p>When creating some resources, it may not be operationally efficient to hard-code values. For example, when creating an EC2 instance, you might want to allow flexibility in choosing the instance type. By using parameters, you can empower the person deploying the CloudFormation template to select the desired instance type during stack creation. Additionally, parameters can be used to set default values that can be easily overridden during deployment.</p><p>CloudFormation also ships with some predefined parameters called <em>pseudo parameters</em>. For example, you can use the predefined AWS account ID pseudo parameter (AWS::AccountId) to retrieve your account ID or the AWS region pseudo parameter (AWS::Region) to get the AWS region in which a resource has been created. To use pseudo parameters, all you have to do is simply reference them whenever you need them in your template.</p><h3>Mappings</h3><p>Within your template, you might encounter values that are impractical to hard code. For example, consider a CloudFormation template that creates EC2 instances in two AWS regions, using distinct AMIs from each region. If you hard code the ID of any of these AMIs, the creation of EC2 instances will likely fail in one region due to referencing an AMI ID that doesn’t exist in that location. To address this, you can use mappings to associate each AMI ID with its corresponding region.</p><h3>Conditions</h3><p>The conditions section allows you to control which resources are created based on defined conditions. Think of it as an if/else statement. If a specified condition is true, the designated resources will be created. If the condition is false, those resources will not be created or different resources will be provisioned. For instance, you could conditionally create a resource based on whether the stack is intended for production or a test environment.</p><h3>Output</h3><p>The output section is used to define values that you want to make available outside a CloudFormation stack after it has been created. For example, if you have a template creating an EC2 instance, you can use the outputs section to return the public IP address of that instance or the instance ID. These values can then be viewed in the CloudFormation console or imported into another stack, if desired.</p><p>The best way to end this article will be to show you a sample template that creates a web server EC2 instance. This will show you how the different sections come together.</p><pre>AWSTemplateFormatVersion: &quot;2010-09-09&quot;<br>Description: &quot;Creates EC2 Instance with a web server installed with. a security group that allows HTTP&quot;<br>Parameters:<br>    InstanceType:<br>    Description: EC2 Instance type for the web server<br>    Type: String<br>    Default: t2.nano<br>    AllowedValues:<br>    - t2.micro<br>    - t2.small<br>    - t2.nano<br>    ConstraintDescription: Must be a valid instance type<br>Mappings:<br>    RegionMap:<br>        us-east-1:<br>          MyAMI1: ami-0ff8a91507f77f867<br>          MyAMI2: ami-0a584ac55a7631c0c<br>        us-west-1:<br>          MyAMI1: ami-0bdb828fd58c52235<br>          MyAMI2: ami-066ee5fd4a9ef77f1<br>        eu-west-1:<br>          MyAMI1: ami-047bb4163c506cd98<br>          MyAMI2: ami-0a7c483d527806435<br>        ap-southeast-1:<br>          MyAMI1: ami-08569b978cc4dfa10<br>          MyAMI2: ami-0be9df32ae9f92309<br>        ap-northeast-1:<br>          MyAMI1: ami-06cd52961ce9f0d85<br>          MyAMI2: ami-053cdd503598e4a9d<br><br>Resources:<br>    WebServerEc2Instance:<br>        Type: AWS::EC2::Instance<br>        Properties:<br>            InstanceType: !Ref InstancType<br>            SecurityGroups:<br>            - Ref: WebServerSecurityGroup<br>            ImageId: !FindInMap [RegionMap, !Ref &quot;AWS::Region&quot;, MyAMI1 ]<br>            UserData: <br>                Fn::Base64:<br>                Fn::Join:<br>                - &quot;\n&quot;<br>                - - &quot;#!/bin/bash&quot;<br>                  - sudo yum update -y<br>                  - sudo yum install httpd -y<br>                  - sudo /etc/ini.d/httpd start<br>                  - echo &quot;&lt;html&gt;&lt;body&gt;&lt;h1&gt;Brandon&#39;s Web Server&lt;/h1&gt;&quot; &gt; /var/www/html/index.html<br>                  - echo &quot;&lt;/body&gt;&lt;/html&gt;&quot; &gt;&gt; /var/www/html/index.html<br>    WebServerSecurityGroup:<br>        Type: AWS::EC2::SecurityGroup<br>        Properties: <br>            GroupDescription: Enable HTTP access through port 80<br>            SecurityGroupIngress: <br>                - IpProtocol: tcp<br>                  FromPort: 88<br>                  ToPort: 88<br>                  CidrIp: 0.0.0.0/0<br>Outputs:<br>    AZ:<br>        Description: Availability Zone of the newly created EC2 instance<br>        value: !GetAtt WebServerEc2Instance.AvailabilityZone<br>    PublicIp:<br>        Description: Public IP of the EC2 instance<br>        Value: !GetAtt WebServerEc2Instance.PublicIp</pre><p>This CloudFormation template creates a web server EC2 instance in the specified AWS region. The instance type can be customized using the InstanceType parameter. A security group is created to allow HTTP access to the instance. The template also includes a user data script that installs and starts an HTTP server, serving a basic web page.</p><p><strong>Key components:</strong></p><p><strong>Parameters:</strong></p><ul><li>InstanceType: Allows the user to specify the EC2 instance type.</li></ul><p><strong>Mappings: </strong>Associates AMI IDs with different regions.</p><p><strong>Resources:</strong></p><ul><li>WebServerEc2Instance: Creates an EC2 instance with the specified instance type, security group, and AMI.</li><li>WebServerSecurityGroup: Creates a security group allowing HTTP traffic.</li></ul><p><strong>User Data: </strong>Provides a script that installs and configures a web server on the EC2 instance.</p><p><strong>Outputs:</strong> Returns the Availability Zone and public IP address of the created EC2 instance.</p><p>This template demonstrates the use of parameters, mappings, and resources to create a customizable and functional web server environment in AWS.</p><h3>Conclusion</h3><p>We have seen how using CloudFormation makes infrastructure creation an easy and painless process. One of the great advantages of defining infrastructure as code (IaC) is that you can apply the same best practices used in software development to the development and deployment of your cloud infrastructure. This approach can help reduce errors in your templates and allows for easy redeployment to create multiple instances of your infrastructure.</p><p>This is particularly helpful when you have multiple environments, such as development, testing, staging, and production, and need to quickly stand up identical versions of these environments.</p><p>To fully leverage the power of CloudFormation and other IaC tools, I encourage you to continue exploring their features and capabilities. By adopting these practices, you can streamline your infrastructure management and improve the efficiency and reliability of your cloud deployments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7042a59fa0ca" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I cleared the AWS Certified DevOps Engineer — Professional Certification]]></title>
            <link>https://medium.com/@dbrandonbawe/how-i-cleared-the-aws-certified-devops-engineer-professional-certification-8e92c73d46c3?source=rss-8b8d692b1f3d------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e92c73d46c3</guid>
            <dc:creator><![CDATA[Brandon Damue]]></dc:creator>
            <pubDate>Sun, 01 Sep 2024 14:36:50 GMT</pubDate>
            <atom:updated>2024-09-01T14:36:50.875Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ir2Jy0jMIg-g-rMOWnI5mA.png" /></figure><h3>How I cleared the AWS Certified DevOps Engineer — Professional Certification</h3><p>Contrary to “popular” belief that acquiring certifications play just a minute part in being a testament of the expertise an individual has gained in a particular field, I am one of those who can testify to the amount of knowledge and skills gained in the process of preparing for and sitting for certification exams.</p><p>After two months of taking an 87 hour long advanced AWS DevOps course made up of videos, tutorials labs, lab challenges and practice questions on QA (formerly Cloud Academy), I took the certification exam and a few hours after that, I got a congratulatory email with the AWS Certified DevOps Engineer Professional badge.</p><p>As I think back to my preparation for this certification exam, it would be unfair to undermine the amount of insights I got from reading articles and watching YouTube videos of other people writing or talking about their experience. All these inspired me to follow in their footsteps and share my experience as it has the potential to help someone on their certification journey. Stay with me as I share the resources and study tips I used.</p><h3>Resources</h3><ul><li><strong>AWS Certified DevOps Engineer — Professional Official Exam Guide:</strong> This is the first resource on the list not necessarily because it was the most important while I prepared for the exam but because a lot of people undermine its importance. The exam guide is the blueprint that will help you understand what is required of you to become a certified AWS DevOps engineer professional. While preparing for the exam, I found myself going back to this guide to make sure I was learning and paying attention to the right things.</li><li><strong>QA (formerly Cloud Academy):</strong> In the other two AWS certification exams (Solutions Architect Associate and Developer Associate) I have taken, I used Steven Mareek’s Udemy courses which are some of the best resources available online to prepare for those certification exams. As one of the benefits of being an AWS community builder, I have a one year subscription to the QA platform paid in full by AWS in partnership with Community Builder’s program. QA’s advanced AWS DevOps course was the main resource I used in preparing for this exam. I can tell you in all confidence that this was by far the most detailed online course I have ever taken. The instructors took time to explain every concept and service. In addition to that, the course includes detailed lab tutorials and challenges.</li><li><strong>Generative AI Tools (ChatGPT, Gemini, and Meta AI): </strong>Generative AI tools are some of the best tools that are helpful as you prepare for certifications exams and any other type of exam altogether. Depending on whichever one I felt like using on any given day, I used these tools to widen and deepen my understanding of AWS services, tools and DevOps principles.</li></ul><p><strong><em>Disclaimer: No matter how good these GenAI tools are, they still have the tendency to give you wrong information so make sure you use official documentations and sources to verify information that you are not sure of.</em></strong></p><ul><li><strong>AWS White Papers and articles: </strong>When you go through practice test questions for the AWS DevOps Engineer exam, you realize that most of the answers to these questions are solutions that have been architected and well documented in AWS whitepaper and articles. Resources such as these help you understand how different AWS services come together to create robust, maintainable and operationally efficient DevOps solutions.</li><li><strong>Practice Tests: </strong>Even though this is the last resource on this list, it is definitely not the least important. Experience has taught me that when preparing for an exam, practice tests are indispensable. With this in mind, I made sure I went through every practice test I could find several times over.</li></ul><h3>Study Tips</h3><p>You will agree with that no matter the quantity and quality of the resources you have access to, they will not amount to much if you fail to set up a system you will follow to adequately make use of these resources. Here are some of my study tips:</p><ul><li><strong>Setting a goal:</strong> The first step towards achieving anything worthwhile is setting an attainable goal. When you set your goal, you have to turn your back on it and fall to the level of your system. If I lost you there, please give me a second to explain. When you have a goal, the next thing is to create a clear outline and timeline that will aid you in achieving that goal. In my case, I set a two month goal to study for this exam and then I went on to formulate a plan on how I was going to work on achieving the goal from a daily to a weekly and finally a monthly time frame. To create an added sense of urgency, I booked my exam in advance even before I was confidently ready to sit for the exam.</li><li><strong>Studying consistently:</strong> I have witnessed the power of consistency in different areas of my life. It is also a popular belief that consistency is better than intensity. With this in mind, I made sure I studied consistently until my goal was achieved. On days when I had more time and energy, I combined consistency and intensity. They have proven to be a formidable duo.</li></ul><h3>Conclusion</h3><p>Hopefully, something I have mentioned in this article will help you as you prepare for your exam. Goodluck with on your exam, go kill them with success! You can connect with me on <a href="https://www.linkedin.com/in/brandon-damue/">Linkedin</a>. Please share this article with anyone you think it might be helpful to. Ciao!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e92c73d46c3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tutorial: Creating NACLs and Security Groups in the AWS Management Console]]></title>
            <link>https://towardsaws.com/tutorial-creating-nacls-and-security-groups-in-the-aws-management-console-6243b96079ba?source=rss-8b8d692b1f3d------2</link>
            <guid isPermaLink="false">https://medium.com/p/6243b96079ba</guid>
            <category><![CDATA[aws-nacl]]></category>
            <category><![CDATA[nacl]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[tutorial]]></category>
            <dc:creator><![CDATA[Brandon Damue]]></dc:creator>
            <pubDate>Wed, 07 Aug 2024 23:09:48 GMT</pubDate>
            <atom:updated>2024-08-08T01:45:16.891Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9u2iNHAMmQ40FtwEL_OlpQ.png" /></figure><p>I recently wrote an article on Security Groups and Network Access Control Lists and then I thought it will be wise and helpful to follow that up with a tutorial article on how to create NACLs and Security Groups using the AWS management console.</p><p>Without wasting time, let’s get right in.</p><h3>Step 1: Logging into the Management Console</h3><p>I am going to log into the management console using the credentials of an IAM user account I created for performing day to day tasks such as the ones required to complete this article. Incase you don’t know it yet; it is a best practice to only use your root account when necessary and to instead use an IAM user account with the sufficient amount of permissions for everything else.</p><p>To begin this tutorial, navigate to the following link: <a href="https://aws.amazon.com/console/">https://aws.amazon.com/console/</a> and click the <em>Sign in to the Console</em> button at the top right part of the page to get to the login screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4r-m3Cn-Jan4CmY4" /></figure><p>If you have never created an IAM user account I would advise that you log in as the root user of your AWS account, go to the IAM management console, create a user and then grant this new user Full EC2 access. When you do that, log in with that new user to continue with the tutorial.</p><h3>Step 2: Creating A Security Group</h3><p>Since Security Groups are virtual firewalls that control traffic to and from EC2 instances, to create a security group (SG), you have to navigate to the EC2 management console. (You can also this in the VPC console.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yrdBMfiuCXSQySnR" /></figure><p>As shown in the image above, search EC2 in the search bar at the top and then click on the first search result that appears. Clicking that will take you to the EC2 management console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1OES-OaWQ39X3LK0" /></figure><p>On this new web page, scroll down to the Network &amp; Security dropdown on the sidebar on the left of the page and click on Security Groups.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Zf5a88utSFWYBCJb" /></figure><p>You will notice that there is a default security that exist in the default VPC. The goal of this tutorial is to create an SG of our own so, click on the Create Security Group button at the top right corner of the management console and then fill in the following details.</p><p><em>Security group name:</em> CloudTutorialSG</p><p><em>Description:</em> SG for cloud tutorial</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*I4-xaS7fF0RBG0vu" /></figure><p>For any details not specified, maintain the default values or selections. After filling those details, click on the Add rule button under the inbound rule section. Inbound rules determine the traffic that is allowed into the EC2 instance that the SG will eventually be tied to.</p><p>We are going to create two inbound rules. The first one will allow SSH traffic from the IP address of your computer to the EC2 instances that the Security Group will eventually be tied to. The second rule will allow HTTP traffic from anywhere i.e. from all IP addresses on the internet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8UnmC2PwoZMz8tqb" /></figure><p>For the first rule, select SSH for the <em>Type</em> field and My IP for the <em>Source</em> field and then click on <em>Add Rule</em> to create the first rule.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IRERxuKaeudfvFx4" /></figure><p>For the second inbound rule, select HTTP for the Type field and Anywhere-IPv4 for the Source field. Once this is done, scroll to the bottom of the page and click on the Create Security Group button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WkeJOVz3vkQotWuI" /></figure><p>And voila we have successfully created a security group. 🎉🎉🎉</p><h3>Step 3: Creating A NACL</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Q-NK6dl7Pl_oewLj" /></figure><p>In the search bar at the top of the management console, type VPC and then click the first search result that appears.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JQzUgSrhJ314iLoe" /></figure><p>Click on Network ACLs under Security in the left sidebar and click on the Create network ACL on the new page that appears, fill in the following details and then click the Create Network ACL button</p><p><em>Name — optional:</em> CloudTutorialNACL</p><p><em>VPC: Select the default VPC (this is the only option available because we haven’t created a VPC of our own)</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ESBdft63kmgDesL1" /></figure><p>With that, you have created a NACL. We will go on to add an inbound rule and an outbound rule to this NACL. The inbound rule will allow SSH traffic from your computer’s IP address and the outbound rule will allow HTTP traffic to the internet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wAxBGI4Hkd3rRdSe" /></figure><p>From the list of NACLs click on the NACL ID of the NACL we just created and in the inbound rule tab click on the <em>Edit inbound rule</em> button and click on <em>Add New Rule.</em></p><p>Fill in the details as shown below. Go to <a href="https://www.whatismyip.com/">this link</a> to copy your computer’s IP address. Paste this address in the Source field and add /32 to it. When you have filled in all the details, click on Save Changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MZ5ifs2jJrQzAKRO" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uah9KyImiz_lNhyF" /></figure><p>Next up we are going to create an outbound rule that allows HTTP traffic to the internet. Click on the Outbound rules tab and click on the Edit outbound rules button and then click on Add New rule.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UvodLAiqjXHZGc4v" /></figure><p>Fill in the details as shown above and click on Save Changes. With that we have created an outbound rule for our NACL that allows HTTPS traffic to the internet.</p><h3>Step 4: Clean Up</h3><p>Now that we have seen how to create a NACL and a security group, it’s time for clean up 🧼🧼🧼. We are going to delete the security group and NACL that we created starting with the NACL. Navigate to the NACLs page, select the NACL we created and click the Actions dropdown, select Delete network ACL then enter delete in the dialog box that appears and click the delete button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-6GdsUmiqSIfUnGV" /></figure><p>With that out of our way, it is time to delete the Security Group. Navigate to the Security Group page, select the security group we created, click on the Actions dropdown at the top of the page and select Delete security group and click Delete in the dialog box that appears.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*00Xn7uSa8RVmSbhZ" /></figure><p>You can go take a coffee (or your favorite beverage). The job is done. 🎉</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6243b96079ba" width="1" height="1" alt=""><hr><p><a href="https://towardsaws.com/tutorial-creating-nacls-and-security-groups-in-the-aws-management-console-6243b96079ba">Tutorial: Creating NACLs and Security Groups in the AWS Management Console</a> was originally published in <a href="https://towardsaws.com/">Towards AWS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Functions in JavaScript]]></title>
            <link>https://medium.com/@dbrandonbawe/functions-in-javascript-f1a93996d524?source=rss-8b8d692b1f3d------2</link>
            <guid isPermaLink="false">https://medium.com/p/f1a93996d524</guid>
            <category><![CDATA[functional-programming]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[function]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Brandon Damue]]></dc:creator>
            <pubDate>Tue, 23 Jul 2024 14:07:39 GMT</pubDate>
            <atom:updated>2024-07-23T14:07:39.808Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6sFl4DbHLCAVlsTwkWMpKQ.png" /></figure><p>Functions are an integral of every modern programming language as they provide programmers with the ability to write reusable code and get the ball rolling in their projects. JavaScript functions like many other parts of JavaScript have features that are not talked about as much as they should. What I want this article to achieve is to give you a better understanding of JavaScript functions by talking about its cool features. We will begin by talking about the basics (what functions are) to gain a sense of direction and then move on to the different ways you can create a function. We will finish off with interesting concepts like closures and recursion.</p><h3>Function</h3><p>A function in its simplest form is an encapsulated block of code designed to perform a particular task. We use functions every day. Every time you pick up your phone or calculator to do simple arithmetic you are making use of a bunch of functions.</p><p>Most programmers think of functions as some “special” kind of data structure. It turns out functions are just objects that store up a collection of values like other JS objects. I don’t want to drift from the main idea of this article by going into detail about functions being objects. You can watch <a href="https://youtu.be/7UMuJMiNjSk?si=PifF8xay1amD96Eo">this YouTube video</a> to learn more.</p><p>JavaScript has different syntaxes for creating functions. In all of them, the common denominator is using the function keyword, the exception being when you use the arrow function syntax (more on this later) to create a function. Using the function keyword, you can create a function by simply passing it as a value to a variable (binding) as shown in the code below:</p><pre>let helloWorld = function() {<br>    console.log(&quot;Hello World!&quot;)<br>}</pre><p>When a function is created as seen above, it is called a function expression. Within the parentheses () is where you provide the function with inputs. When you are creating the function, these inputs are called parameters and when the function is being invoked(called) to perform the task it was created for, these inputs are called arguments. However, some developers parameters and arguments interchangeably.</p><p>A more widespread syntax for creating a function is using the function declaration syntax. When you use this syntax, you don’t have to create a variable as the name of the function is also the name of the variable that holds it in memory. Here is an example of a function declaration.</p><pre>function hello(name) {<br>    console.log(&quot;Hello &quot; + name)<br>}<br><br>hello(&quot;John Rambo&quot;)<br><br>// Output: Hello John Rambo</pre><p>Aside the tiny difference in syntax for function expressions and declarations, the only other difference between them is that when you create a function using the function declaration syntax, you can invoke the function even before you create it. This sounds weird but is made possible by a feature called hoisting that allows function and variable declarations (only for variables declared with var ) to be placed at the top of their scope when your code is being interpreted by the JavaScript interpreter.</p><p>For functions that are created using the function expression syntax, you can only use them after they have been created because function expressions are not hoisted so trying to do so will result in a ReferenceError.</p><p>With the arrow function syntax you don’t use the function keyword. The arrow function syntax is similar to the function expression syntax but without the function keyword. Here is a code example of the arrow function syntax.</p><pre>let helloWord = (name) =&gt; {<br>   console.log(&quot;Hello &quot; + name)<br>}</pre><p>As you can see the arrow function syntax is less verbose than the others and you can further break it down by omitting the parentheses when the function has only one parameter and omitting the braces when the code the inside the braces is a single line. By doing that the function above becomes.</p><pre>let helloWorld = name =&gt; console.log(&quot;Hello &quot; + name)</pre><p>The only difference that exists between the arrow function syntax and the other two syntaxes is the value of their this keyword. This is beyond the scope of this article so I won&#39;t go into the thick of it. If you are curious and want to learn more about it, check <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this">this out</a>. Now, unto the main events: recursion and closures.</p><h3>Recursion</h3><blockquote>Recursion is the act of a function calling itself, it is used to solve problems that contain smaller sub-problems. A recursive function can receive two inputs: a base case (ends recursion) or a recursive case (resumes recursion).</blockquote><blockquote><a href="https://developer.mozilla.org/en-US/docs/Glossary/Recursion">MDN Web Doc</a></blockquote><p>When you using recursion you have to create a mechanism that will break the recursion at some point or you will end up with an infinite loop. Below is a simple example of a recursive function.</p><pre>function recursiveCountDown(num) {<br>  if (num &lt;= 0) {<br>    console.log(&quot;The Count Down has ended!&quot;);<br>    return;<br>  }<br>  console.log(num);<br>  recursiveCountDown(num - 1);<br>}</pre><p>The function above is a regular countdown function that calls itself recursively reducing 1 from the previous number that was passed as the argument to the function each time it runs. The moment the number being passed to the recursive function becomes 0 we end the recursion loop by printing a message to the console and then exiting the function with the return keyword.</p><h3>Closures</h3><p>Closures refer to the combination of a function and its surrounding state that is its lexical scope. I agree with you if you think those are just a bunch of words that don’t really tell you what closures actually are. So let’s break it down.</p><p>What all this means is that inner functions are able to the access variables declared within the outer functions within which they exist but these variables are not accessible to any function that is outside this outer function. This brings us to the final definition that a closure is function that is able to reference (access) variables from the local scope surrounding it. Here is a code example from the MDN Docs to help you understand what we are talking about:</p><pre>function init() {<br>  var name = &quot;Mozilla&quot;; // name is a local variable created by init<br>  function displayName() {<br>    // displayName() is the inner function, that forms the closure<br>    console.log(name); // use variable declared in the parent function<br>  }<br>  displayName();<br>}<br>init();</pre><p>In the code example we have declared a function called init that has a variable name . Within this init function, we have created a function called displayName that is able to reference the name variable declared in its parent function init . That right there is all you really need to understand about closures.</p><h3>Conclusion</h3><p>After having explored all these about JavaScript functions, it is time for you to go on to use them in your JavaScript projects to make sure you don’t forget what you have learned. Thank you for sticking with me to the end.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f1a93996d524" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to implement Memoization in your React projects]]></title>
            <link>https://medium.com/@dbrandonbawe/how-to-implement-memoization-in-your-react-projects-e0d2e4283c9b?source=rss-8b8d692b1f3d------2</link>
            <guid isPermaLink="false">https://medium.com/p/e0d2e4283c9b</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[memoization]]></category>
            <dc:creator><![CDATA[Brandon Damue]]></dc:creator>
            <pubDate>Sun, 07 Jul 2024 18:20:46 GMT</pubDate>
            <atom:updated>2024-07-07T18:20:46.842Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nPtGf86BwhVl19ecIbuEpA.png" /></figure><p>React is a very powerful frontend library and you begin to witness more of its power when you learn the intricate details of the features that it offers. If you are like me who is always interested in understanding the inner workings of the tools they are using, lean back and keep reading because this article has a lot of insights for you. Even if you are not very fond of intricate details, read on as I will try my best to make the write up enjoyable and insightful still.</p><h3>What is Memoization?</h3><p>Memoization is a programming technique that is used to cache the results of intensive processes so that you don’t run the process over and over unnecessarily. So with memoization, you are basically asking a function (process) to remember (c ache) the result of the process so that it doesn’t have to run the process again if the same input is supplied it. For example: Imagine you have a function that multiplies two numbers. If you do the multiplication of two numbers say 100 and 458, if you want to do the exact same computation again, you’ll just get the previous value if you have implemented memoization since the inputs are the same.</p><p>In React, memoization is often used to ensure that components only re-render when it is absolutely necessary rather being re-rendered all the time. It is. important to note that when you are using memoization, you essentially trading memory for speed.</p><h3>How to implement Memoization in React</h3><p>It is common knowledge to most React developers that components are typically re-rendered when their states or props change. That said, the way memoization is implemented depends on the type of component you are using i.e. it is not implemented in the same manner for class and functional components. Let’s go over how it works and how to implement it in each case.</p><p>In a functional components, when the component is rendered the first time, React takes a snapshot of that component and then uses it as a reference for the next time the component has to be re-rendered. When a re-render is about to happen, React will compare the newer version of the component with the cached snapshot (reference) of the component to verify if there has been any change in the value of its props. For props that are arrays or objects, React performs a shallow comparison. When the comparison is done and React confirms that there has been a change in the component’s props, it goes ahead to re-render it, if not the component stays as it was without being re-rendered.</p><p>That is how memoization should work in functional components. However, you might witness some unexpected behaviors in specific scenarios like when you have directly mutated your state object, when the component has props that are functions, or when dealing with HOCs (Higher Order Components).</p><p>In the case of HOCs, when the props change on a parent component, child components within it will be re-rendered even when this change didn’t affect the data within them. To fix such unnecessary behaviors you can wrap the child component within the useMemo hook. Check out the <a href="https://react.dev/reference/react/useMemo">official documentation</a> to learn more about this hook. The useMemo hook won&#39;t work in components with props that are functions. When dealing with functional props, you can make use of the useCallback hook instead. useCallback is used to cache function definitions between renders. Now let&#39;s look at memoization in class components.</p><p>In functional programming, there is the concept of pure functions and a pure function is one that for the same set of inputs it will return the same output and its output is strictly determined by its input values only. A react class component can either be a regular class component or a pure component (class components that extend the React.PureComponent class). Pure components render the same output for the same state and props. They have a shouldComponentUpdate() method that allows them to perform shallow comparison of states and props and then use the result of that computation to decide whether the component should be re-rendered or not. Building components that extend the React.PureComponent class will add memoization to their behavior. It really that simple.</p><h3>Conclusion</h3><p>Even though memoization is a great tools to have in your toolbox as a react developer, it isn’t a feature that you should jump to using every time because even though it works great for caching the results of intensive or heavy processing computations, it still has some trade off like the hit it takes on your memory in exchange for speed optimization in your application. To drive my point home, you shouldn’t start with memoization in all scenarios as there are other other optimization techniques that you can make use of that will add less overhead to your application when compared to memoization.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0d2e4283c9b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Boost Your React App’s Performance with Lazy Loading, Hydration, and Code Splitting]]></title>
            <link>https://medium.com/@dbrandonbawe/boost-your-react-apps-performance-with-lazy-loading-hydration-and-code-splitting-dab7c99bb1d9?source=rss-8b8d692b1f3d------2</link>
            <guid isPermaLink="false">https://medium.com/p/dab7c99bb1d9</guid>
            <category><![CDATA[lazy-loading]]></category>
            <category><![CDATA[code-splitting]]></category>
            <category><![CDATA[lazy-load]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Brandon Damue]]></dc:creator>
            <pubDate>Mon, 01 Jul 2024 14:51:45 GMT</pubDate>
            <atom:updated>2024-07-01T14:51:45.431Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BL9LyBXyZYwgmHyPW2oSRg.png" /></figure><p>After a React/Next.js sabbatical, I am back to building ways!! At the time of writing, I am working on an admin dashboard for an online marketplace application powered by Next.js and Typescript. As is the case with every project I undertake, learning new things or getting a refresher on things I have learned in the past is inherent. In this article, I will be writing about some cool React features and concepts that every React and Next.js developer will be better off if they learn how they work and how to use them in their own projects (well that’s my opinion on the issue so don’t quote me on that)</p><p>As an outline of what’s to come, the features we will be talking about are: Lazy loading, Code Splitting and Hydration. Into the “Reactverse” we go!!</p><h3>Lazy Loading</h3><p>Lazy loading is definitely not a new feature around the block. It’s been around for quite some time. However, it is remains a feature with sufficient potential to boost the performance of your React applications. Lazy loading defers the loading of a React component’s code to when it is first needed i.e. to when it is rendered for the first time. To make use of this feature you have to import it from the React library. Let’s see how it is used with some code examples.</p><pre>import { lazy } from &quot;react&quot;;<br><br>const LazyLoadedComponent = lazy(() =&gt; import(&#39;./LazyLoaded.tsx&#39;));</pre><p>In the code above, we imported the lazy module from the React library. To make a component to be lazy loaded, you import it within a function called load passed as a parameter to lazy . load returns a Promise and it is not called until you try to render the returned component i.e. the one imported within the load function. When the component is rendered, the results are cached so that React won&#39;t have to called load more than once. As a side note, to be able to import the component within the load function as we did in the the code snippet above, it has to have been exported as the default export.</p><blockquote>To make sure your lazy loaded component doesn’t get resetted unexpectedly, make sure you don’t declare them inside other components. You should rather always declare them at the top level of your module.</blockquote><p>React recently added the &lt;Suspense&gt; component to the library, allowing you to display some fallback content (for example a loader) while components nested within it are still loading. I was so relieved when I learned about this cause I no longer have to leverage the useState hook to check if a component is still loading or not. Below is a code example of how you&#39;d typical use &lt;Suspense&gt;</p><pre>&lt;Suspense fallback={&lt;Loading /&gt;}&gt;<br>  &lt;h2&gt;Hello World, Welcome&lt;/h2&gt;<br>  &lt;LazyLoadedComponent /&gt;<br>&lt;/Suspense&gt;</pre><p>So while the &lt;LazyLoadedComponent /&gt; is being loaded, &lt;Loading /&gt; will be displayed as a fallback.</p><h3>Code Splitting</h3><p>The name chosen for this feature is self explanatory. With code splitting, React breaks down your application into smaller chunks. Doing this can greatly reduce the initial JavaScript bundle size the browser has to download. This can lead to faster initial page loads as these chunks of code are only loaded on demand based on user interaction or routing.</p><p>Code Splitting is performed when your application is being bundled by tools such as Webpack, Rollup and others. You can use dynamic imports within your React application to indicate pieces of code that you want splitted into smaller chunks. Build tools then use their code splitting functionality to analyze your code and generate different JavaScript bundles.</p><p>If you feel the need for more fine-grained control you can use code splitting libraries like react-loadable which is deemed easy to use by many.</p><h3>Hydration</h3><p>Hydration is another feature that I came to learn more about in the project I am currently working on. In this project, I created a digital clock component and made sure I avoided the errors that came with changing state directly within the set state function, mutating the state object and other common errors that come up when you use useState . After having done this, I kept getting a text mismatch error about the HTML that the server rendered and what is rendered on the client as the clock was updating every other second.</p><p>When I did some research on solving this issue, I learned about hydration. The question on you mind right now is probably what is hydration all about. Let’s talk about that real quick. I don’t think I can phrase it better than what I read in the React documentation so here you go.</p><blockquote>In React, “hydration” is how React “attaches” to existing HTML that was already rendered by React in a server environment. During hydration, React will attempt to attach event listeners to the existing markup and take over rendering the app on the client.</blockquote><p>So it is fundamentally a process in which React transforms content pre-rendered on the server into an interactive user interface. There are so many benefits that hydration has to offer. For instance; It can greatly improve the time your web application takes to become interactive to the end user and even boost your application’s SEO.</p><p>As I hinted above, hydration can sometimes constitute a few issues. An example of an issue you might face is that during rehydration, in a process called reconciliation, the content pre-rendered by the server is compared with what is rendered on the client-side. If the content differs, you can get a text mismatch error. This kind of error is very common when you are displaying a timestamp. Thank goodness that to every problem, there is a solution. To get rid of the error, you can set the suppressHydrationWarning attribute on the element for which you want to silence hydration to true.</p><h3>Conclusion</h3><p>When building an application using a framework like React or other JavaScript frameworks, the way you implement the features in your application can influence performance either positively or negatively. With the features we have just examined, you have more tools under your belt to take the performance of your application to the next level. As we have just seen, these features can: improve the initial load time of your application, improve how the application performs on search engines amongst other benefits. Don’t sit on the knowledge gained here. Use it to boost the performance of your React and Next.js applications. Good luck and working towards making the world a better place with the code that you write.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dab7c99bb1d9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Look at NAT Gateways and VPC Endpoints in AWS]]></title>
            <link>https://medium.com/@dbrandonbawe/a-look-at-nat-gateways-and-vpc-endpoints-in-aws-d7f854727e8d?source=rss-8b8d692b1f3d------2</link>
            <guid isPermaLink="false">https://medium.com/p/d7f854727e8d</guid>
            <category><![CDATA[address-translation]]></category>
            <category><![CDATA[endpoints]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Brandon Damue]]></dc:creator>
            <pubDate>Fri, 28 Jun 2024 12:55:57 GMT</pubDate>
            <atom:updated>2024-06-28T12:55:57.934Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CWMwxN7eVhEsbvvSeZRPzg.png" /></figure><p>Every time I get the chance, I like to write articles that are geared towards enabling you make your cloud infrastructure on AWS and other cloud platforms more secure. In today’s edition of writing about AWS services, we will be learning about NAT Gateways, what they are, how they work and how they enhance our cloud infrastructure. From NAT gateways we will finish it off by talking about VPC endpoints. Allons-y (FYI: that’s “let’s go” in French 😉)</p><h3>NAT Gateways</h3><p>First and foremost, NAT stands for <em>Network Address Translation</em>. Let’s look at what NAT really is before moving on to NAT gateways proper. Network Address Translation is a process in which private IP addresses used on a network (usually a local area network) are translated into public IP addresses that can be used to access the internet.</p><p>To understand how NAT gateways work, we are going to use the example of a two-tier architecture with a web tier deployed on EC2 instance in a public subnet (a public subnet is a subnet that has a route to an Internet gateway on the route table associated with it) and an application tier deployed on EC2 instances in a private subnet ( a private subnet has no route to an internet gateway on its route table). With this architecture, the EC2 instances that make up the application tier are unable to access the internet because they the subnet in which they reside has no route to an IGW on its route table. How will the instances go about performing tasks like downloading update patches from the internet? The answer lies in using NAT gateways. For the application tier to have access to the internet, we need to provision a NAT gateway in the public subnet housing our web tier.</p><p>When an instance in the application tier wants to connect to the internet, it sends a request which carries information such as the IP address of the instance and the destination of the request to the NAT gateway in the public subnet. The NAT gateway then translates the private IP address of the instance to a public elastic IP address in its address pool and uses it to forward the request to the internet via the internet gateway. One important thing to note about NAT gateways is that, they won’t accept or allow any inbound communication initiated from the internet as it only allows outbound traffic originating from your VPC. This can significantly improve the security posture of your infrastructure.</p><p>NAT gateways are managed by AWS. To create a NAT gateway, all you have to do is specify the subnet it will reside in and then associate an Elastic IP address (EIP). AWS handles every other configuration for you.</p><h3>VPC Endpoints</h3><p>VPC endpoints allow private access to an array of AWS services using the internal AWS network instead of having to go through the internet using public DNS endpoints. These endpoints enable you to connect to supported services without having to configure an IGW (Internet Gateway), NAT Gateway, a VPN, or a Direct Connect (DX) connection.</p><p>There are two types of VPC endpoints available on AWS. They are the Interface Endpoints and Gateway Endpoints</p><p><strong><em>Interface Endpoints</em> </strong>— They are fundamentally Elastic Network Interfaces (ENI) placed in a subnet where they act as a target for any traffic that is being sent to a supported service. To be able to connect to an interface endpoint to access a supported service, you use PrivateLink. PrivateLink provides a secure and private connection between VPCs, AWS services and on-premises applications through the internal AWS network.</p><p>To see the suite of services that can be accessed via interface endpoints, check out this <a href="https://docs.aws.amazon.com/vpc/latest/privatelink/aws-services-privatelink-support.html">AWS documentation</a>.</p><p><strong><em>Gateway Endpoints</em> </strong>— They are targets within your route table that enable you to access supported services thereby keeping traffic within the AWS network. At the time of writing, the only services supported by gateway endpoints are: S3 and DynamoDB. Be sure to check the appropriate AWS documentation for any addition to the list of services. One last thing to keep in mind about gateway endpoints is that they only work with IPv4</p><h3>Conclusion</h3><p>Some say the mark of a good dancer is to know when to bow out of the stage. With that, we have officially reached the end of this article about VPC endpoints and NAT gateways. I will like to implore you to keep learning and getting better at using tools such as these for you don’t know when they will come in handy. That could be sooner rather than later. Thank you for riding with me to the very end. Best of luck in all your endeavors.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7f854727e8d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>