<?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:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[GrokTechie]]></title><description><![CDATA[Deep dives made simple - from Containers and Kubernetes to Linux, Unix, and Networking. We break down complex tech so you can grok it with confidence.]]></description><link>https://www.groktechie.com</link><image><url>https://substackcdn.com/image/fetch/$s_!8elZ!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb283d56-89f1-4849-bcd6-3d965c6f4830_1024x1024.png</url><title>GrokTechie</title><link>https://www.groktechie.com</link></image><generator>Substack</generator><lastBuildDate>Fri, 03 Apr 2026 19:43:30 GMT</lastBuildDate><atom:link href="https://www.groktechie.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Shashank Singh]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[shashankrock24@gmail.com]]></webMaster><itunes:owner><itunes:email><![CDATA[shashankrock24@gmail.com]]></itunes:email><itunes:name><![CDATA[Shashank Singh]]></itunes:name></itunes:owner><itunes:author><![CDATA[Shashank Singh]]></itunes:author><googleplay:owner><![CDATA[shashankrock24@gmail.com]]></googleplay:owner><googleplay:email><![CDATA[shashankrock24@gmail.com]]></googleplay:email><googleplay:author><![CDATA[Shashank Singh]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[🐳 Docker Does Not Create Containers - Wait, What?!]]></title><description><![CDATA[During the past few months, I've been conducting technical interviews for DevOps/SRE roles in my team.]]></description><link>https://www.groktechie.com/p/docker-does-not-create-containers</link><guid isPermaLink="false">https://www.groktechie.com/p/docker-does-not-create-containers</guid><dc:creator><![CDATA[Shashank Singh]]></dc:creator><pubDate>Fri, 11 Apr 2025 19:31:08 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Vs8c!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3043bcce-a000-48cf-8ce0-ba97cb0ac210_1686x818.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!qtCt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb84e5026-6e5a-45f6-92cf-eb5a86135a80_458x258.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!qtCt!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb84e5026-6e5a-45f6-92cf-eb5a86135a80_458x258.png 424w, https://substackcdn.com/image/fetch/$s_!qtCt!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb84e5026-6e5a-45f6-92cf-eb5a86135a80_458x258.png 848w, https://substackcdn.com/image/fetch/$s_!qtCt!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb84e5026-6e5a-45f6-92cf-eb5a86135a80_458x258.png 1272w, https://substackcdn.com/image/fetch/$s_!qtCt!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb84e5026-6e5a-45f6-92cf-eb5a86135a80_458x258.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!qtCt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb84e5026-6e5a-45f6-92cf-eb5a86135a80_458x258.png" width="484" height="272.646288209607" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b84e5026-6e5a-45f6-92cf-eb5a86135a80_458x258.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:258,&quot;width&quot;:458,&quot;resizeWidth&quot;:484,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;What is a Docker Container?. A container is a standardized unit of&#8230; | by  Jessie Kuo | Medium&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:&quot;center&quot;,&quot;offset&quot;:false}" class="sizing-normal" alt="What is a Docker Container?. A container is a standardized unit of&#8230; | by  Jessie Kuo | Medium" title="What is a Docker Container?. A container is a standardized unit of&#8230; | by  Jessie Kuo | Medium" srcset="https://substackcdn.com/image/fetch/$s_!qtCt!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb84e5026-6e5a-45f6-92cf-eb5a86135a80_458x258.png 424w, https://substackcdn.com/image/fetch/$s_!qtCt!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb84e5026-6e5a-45f6-92cf-eb5a86135a80_458x258.png 848w, https://substackcdn.com/image/fetch/$s_!qtCt!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb84e5026-6e5a-45f6-92cf-eb5a86135a80_458x258.png 1272w, https://substackcdn.com/image/fetch/$s_!qtCt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb84e5026-6e5a-45f6-92cf-eb5a86135a80_458x258.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"></figcaption></figure></div><p>During the past few months, I've been conducting technical interviews for DevOps/SRE roles in my team. It's been fascinating and insightful to talk to various people - from fresh graduates to experienced engineers - who regularly use containerization tools. </p><p>However, one thing struck me repeatedly during these conversations:</p><blockquote><p><strong>Many people believe Docker itself creates containers, and that without Docker, containers cannot exist.</strong></p></blockquote><p>Many candidates expressed surprise when I told them: "<strong>Docker itself doesn't actually create containers.</strong>"  They often responded with disbelief: "<strong>Wait, how?</strong> Isn't Docker all about containers? Isn't Docker responsible for creating containers? How else would you create containers if Docker doesn't do it?"</p><p>This got me thinking - I should write a detailed blog to clarify this common misconception and share some insights into what actually creates containers. So today, let&#8217;s dive deep into the world of containers, Docker, container runtimes, and see a practical example with a simple yet powerful "<strong><a href="https://github.com/shashanksingh24/ContainerHub">ContainerHub</a></strong>" project I created for managing container lifecycles.</p><h2>&#128681; <strong>The Docker Misconception: Clearing the Air</strong></h2><p>First things first - let's address the elephant in the room:</p><blockquote><p><strong>Docker is not directly responsible for creating containers.</strong></p></blockquote><p>This might seem confusing, given Docker&#8217;s immense popularity in the containerization ecosystem. Docker made container technology accessible and developer-friendly, leading to widespread adoption. But under the hood, Docker itself relies on specialized components known as <strong>container runtimes</strong> to actually create and manage containers.</p><p>To put it clearly:</p><ul><li><p><strong>Docker</strong> is a user-friendly tool providing an intuitive interface and a set of commands that help you <strong>build</strong>, <strong>manage images</strong>, and <strong>interact with containers</strong>.</p></li><li><p><strong>Container runtime</strong> (like <strong>containerd</strong> and <strong>runc</strong>) is the one <strong>actually creating and running containers</strong> at the OS/kernel level.</p><p></p></li></ul><p><strong>Confused?</strong> Let's break down these concepts further.</p><div><hr></div><h2>&#127919; <strong>What Exactly is Creating Containers, then?</strong></h2><p>Behind Docker lies a core component called a <strong>container runtime</strong>, responsible for container lifecycle management.</p><p>Creating containers involves packaging an application and its dependencies into a standardized unit that can be run consistently across different environments. Containers fundamentally rely on two types of runtimes:</p><h3><strong>High-Level Container Runtime</strong></h3><p>High-level container runtimes manage the overall lifecycle of containers, including image creation, transport, and orchestration. Here are their key functions:</p><ol><li><p><strong>Image Management</strong>: High-level runtimes handle the creation, storage, and distribution of container images. They allow developers to build images from Dockerfiles or other configuration files.</p></li><li><p><strong>Transport</strong>: They manage the transport of container images from registries to the host system where containers will be run.</p></li><li><p><strong>API Access</strong>: High-level runtimes provide APIs for interacting with containers, enabling operations like starting, stopping, and monitoring containers.</p></li><li><p><strong>Networking</strong>: They set up networking between containers, allowing them to communicate with each other and the outside world.</p></li><li><p><strong>Volume Management</strong>: High-level runtimes prepare and manage volumes that containers use for persistent storage.</p></li><li><p><strong>Delegation</strong>: They delegate the actual running of containers to low-level runtimes.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Vs8c!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3043bcce-a000-48cf-8ce0-ba97cb0ac210_1686x818.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Vs8c!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3043bcce-a000-48cf-8ce0-ba97cb0ac210_1686x818.png 424w, https://substackcdn.com/image/fetch/$s_!Vs8c!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3043bcce-a000-48cf-8ce0-ba97cb0ac210_1686x818.png 848w, https://substackcdn.com/image/fetch/$s_!Vs8c!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3043bcce-a000-48cf-8ce0-ba97cb0ac210_1686x818.png 1272w, https://substackcdn.com/image/fetch/$s_!Vs8c!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3043bcce-a000-48cf-8ce0-ba97cb0ac210_1686x818.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Vs8c!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3043bcce-a000-48cf-8ce0-ba97cb0ac210_1686x818.png" width="472" height="228.86813186813185" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3043bcce-a000-48cf-8ce0-ba97cb0ac210_1686x818.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:706,&quot;width&quot;:1456,&quot;resizeWidth&quot;:472,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;containerd manages runc and other container runtimes&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="containerd manages runc and other container runtimes" title="containerd manages runc and other container runtimes" srcset="https://substackcdn.com/image/fetch/$s_!Vs8c!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3043bcce-a000-48cf-8ce0-ba97cb0ac210_1686x818.png 424w, https://substackcdn.com/image/fetch/$s_!Vs8c!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3043bcce-a000-48cf-8ce0-ba97cb0ac210_1686x818.png 848w, https://substackcdn.com/image/fetch/$s_!Vs8c!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3043bcce-a000-48cf-8ce0-ba97cb0ac210_1686x818.png 1272w, https://substackcdn.com/image/fetch/$s_!Vs8c!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3043bcce-a000-48cf-8ce0-ba97cb0ac210_1686x818.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div></li></ol><h3><strong>Low-Level Container Runtime</strong></h3><p>Low-level container runtimes focus on the technical aspects of running containers. Their main responsibilities include:</p><ol><li><p><strong>Namespace Setup</strong>: They set up Linux namespaces to isolate system resources like the file system, network, and process IDs for each container.</p></li><li><p><strong>Cgroups Management</strong>: Low-level runtimes manage cgroups to limit and allocate resources such as CPU and memory to containers.</p></li><li><p><strong>Command Execution</strong>: They run commands inside the namespaces and cgroups, ensuring the container operates within its isolated environment.</p></li><li><p><strong>Filesystem Setup</strong>: Low-level runtimes set up the root filesystem for containers, often using chroot to change the root directory.</p></li><li><p><strong>Resource Limits</strong>: They enforce resource limits on containers, ensuring they do not exceed allocated CPU, memory, and other resources.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!JKJm!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c6d0831-3f61-42e8-809f-c87570d1f476_1686x818.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JKJm!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c6d0831-3f61-42e8-809f-c87570d1f476_1686x818.png 424w, https://substackcdn.com/image/fetch/$s_!JKJm!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c6d0831-3f61-42e8-809f-c87570d1f476_1686x818.png 848w, https://substackcdn.com/image/fetch/$s_!JKJm!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c6d0831-3f61-42e8-809f-c87570d1f476_1686x818.png 1272w, https://substackcdn.com/image/fetch/$s_!JKJm!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c6d0831-3f61-42e8-809f-c87570d1f476_1686x818.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JKJm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c6d0831-3f61-42e8-809f-c87570d1f476_1686x818.png" width="506" height="245.3543956043956" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4c6d0831-3f61-42e8-809f-c87570d1f476_1686x818.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:706,&quot;width&quot;:1456,&quot;resizeWidth&quot;:506,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Runc scope - Linux namespaces, cgroups, networking, etc&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Runc scope - Linux namespaces, cgroups, networking, etc" title="Runc scope - Linux namespaces, cgroups, networking, etc" srcset="https://substackcdn.com/image/fetch/$s_!JKJm!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c6d0831-3f61-42e8-809f-c87570d1f476_1686x818.png 424w, https://substackcdn.com/image/fetch/$s_!JKJm!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c6d0831-3f61-42e8-809f-c87570d1f476_1686x818.png 848w, https://substackcdn.com/image/fetch/$s_!JKJm!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c6d0831-3f61-42e8-809f-c87570d1f476_1686x818.png 1272w, https://substackcdn.com/image/fetch/$s_!JKJm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c6d0831-3f61-42e8-809f-c87570d1f476_1686x818.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div></li></ol><div><hr></div><h2>&#128295; <strong>Why the Misunderstanding?</strong></h2><p>Docker's simplicity is the main reason for this confusion. When developers use Docker, everything seems seamless. You type `<code>docker run`</code>, and the container magically appears.</p><p>But behind the scenes, Docker delegates this task to runtimes like <strong>containerd</strong> and <strong>runc</strong>.</p><p><strong>Docker</strong> &#8594; calls &#8594; <strong>containerd</strong> &#8594; calls &#8594; <strong>runc</strong> &#8594; Linux kernel &#8594; <strong>creates containers</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!danY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41ff527d-1947-48d0-a7fe-4675c8d264ca_684x636.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!danY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41ff527d-1947-48d0-a7fe-4675c8d264ca_684x636.png 424w, https://substackcdn.com/image/fetch/$s_!danY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41ff527d-1947-48d0-a7fe-4675c8d264ca_684x636.png 848w, https://substackcdn.com/image/fetch/$s_!danY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41ff527d-1947-48d0-a7fe-4675c8d264ca_684x636.png 1272w, https://substackcdn.com/image/fetch/$s_!danY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41ff527d-1947-48d0-a7fe-4675c8d264ca_684x636.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!danY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41ff527d-1947-48d0-a7fe-4675c8d264ca_684x636.png" width="422" height="392.3859649122807" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/41ff527d-1947-48d0-a7fe-4675c8d264ca_684x636.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:636,&quot;width&quot;:684,&quot;resizeWidth&quot;:422,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Deep into Container &#8212; Deep into Container Runtime | by Qu&#226;n Hu&#7923;nh | Medium&quot;,&quot;title&quot;:&quot;Deep into Container &#8212; Deep into Container Runtime | by Qu&#226;n Hu&#7923;nh | Medium&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Deep into Container &#8212; Deep into Container Runtime | by Qu&#226;n Hu&#7923;nh | Medium" title="Deep into Container &#8212; Deep into Container Runtime | by Qu&#226;n Hu&#7923;nh | Medium" srcset="https://substackcdn.com/image/fetch/$s_!danY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41ff527d-1947-48d0-a7fe-4675c8d264ca_684x636.png 424w, https://substackcdn.com/image/fetch/$s_!danY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41ff527d-1947-48d0-a7fe-4675c8d264ca_684x636.png 848w, https://substackcdn.com/image/fetch/$s_!danY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41ff527d-1947-48d0-a7fe-4675c8d264ca_684x636.png 1272w, https://substackcdn.com/image/fetch/$s_!danY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41ff527d-1947-48d0-a7fe-4675c8d264ca_684x636.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h2><strong>&#128161; Practical Illustration: Introducing <a href="https://github.com/shashanksingh24/ContainerHub">ContainerHub</a></strong></h2><p>To illustrate how containers can be managed independently of Docker, I've developed <strong><a href="https://github.com/shashanksingh24/ContainerHub">ContainerHub</a></strong>, a practical, lightweight project that directly interacts with container runtimes.</p><h3>&#128640; How Does ContainerHub Work (Without Docker!)</h3><p>ContainerHub manages container lifecycles directly, demonstrating a clear separation of concerns:</p><ul><li><p><strong>Root Filesystem Preparation:</strong> Unlike Docker, ContainerHub requires manual preparation of a root filesystem since no high-level runtime is involved.</p></li><li><p><strong>Daemon (</strong><code>containerhubd</code><strong>):</strong> A gRPC server that manages container states and interacts directly with runc.</p></li><li><p><strong>Client CLI (</strong><code>containerhub</code><strong>):</strong> Communicates through sockets to the daemon, allowing direct management of containers.</p></li><li><p><strong>Storage:</strong> Container states and OCI-compliant configurations are stored systematically at <code>/var/lib/containerhub/&lt;id&gt;</code>.</p></li></ul><p>This setup clearly shows the fundamental responsibilities of container runtimes independently of Docker.</p><div><hr></div><h2>&#9989; <strong>Benefits of Understanding this Clearly</strong></h2><p>Knowing that Docker itself doesn&#8217;t create containers directly brings several benefits:</p><ul><li><p><strong>Enhanced Debugging:</strong> Easier to troubleshoot issues by directly interacting with container runtimes.</p></li><li><p><strong>Flexibility:</strong> You're free to use alternative container runtimes like Podman, containerd, or CRI-O.</p></li><li><p><strong>Better Architecture Decisions:</strong> Helps you make informed decisions around security, resource management, and rootless containers.</p></li></ul><div><hr></div><h2>&#127894;&#65039; <strong>Conclusion and Takeaways</strong></h2><p>I hope this blog clears up the confusion:</p><p><strong>Docker is a powerful tool, but containers are actually created and managed by underlying runtimes like containerd and runc.</strong></p><p>Using the ContainerHub example, I've practically demonstrated this concept clearly. Next time someone says "<em><strong>Docker creates containers</strong></em>," you can confidently explain the reality:</p><blockquote><p><strong>&#8220;Docker doesn&#8217;t create containers itself - it relies on OCI-compliant container runtimes like containerd and runc to do that!&#8221;</strong></p></blockquote><p>I'd love to hear your thoughts, experiences, or questions in the comments below!</p><p>Happy Containerizing! &#128640;&#128640;&#128640;</p>]]></content:encoded></item><item><title><![CDATA[Mastering Kubernetes with Custom Schedulers: A Story for Engineering Leaders]]></title><description><![CDATA[Imagine you&#8217;re the Engineering Manager of a fast-growing tech company.]]></description><link>https://www.groktechie.com/p/mastering-kubernetes-with-custom</link><guid isPermaLink="false">https://www.groktechie.com/p/mastering-kubernetes-with-custom</guid><dc:creator><![CDATA[Shashank Singh]]></dc:creator><pubDate>Sun, 06 Apr 2025 04:35:45 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!OfhQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4aea833-e00c-4209-9979-a265bf685acc_1024x1024.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OfhQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4aea833-e00c-4209-9979-a265bf685acc_1024x1024.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OfhQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4aea833-e00c-4209-9979-a265bf685acc_1024x1024.webp 424w, https://substackcdn.com/image/fetch/$s_!OfhQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4aea833-e00c-4209-9979-a265bf685acc_1024x1024.webp 848w, https://substackcdn.com/image/fetch/$s_!OfhQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4aea833-e00c-4209-9979-a265bf685acc_1024x1024.webp 1272w, https://substackcdn.com/image/fetch/$s_!OfhQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4aea833-e00c-4209-9979-a265bf685acc_1024x1024.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OfhQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4aea833-e00c-4209-9979-a265bf685acc_1024x1024.webp" width="1024" height="1024" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c4aea833-e00c-4209-9979-a265bf685acc_1024x1024.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1024,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:233732,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/webp&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://tecknobody.substack.com/i/160689283?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4aea833-e00c-4209-9979-a265bf685acc_1024x1024.webp&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!OfhQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4aea833-e00c-4209-9979-a265bf685acc_1024x1024.webp 424w, https://substackcdn.com/image/fetch/$s_!OfhQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4aea833-e00c-4209-9979-a265bf685acc_1024x1024.webp 848w, https://substackcdn.com/image/fetch/$s_!OfhQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4aea833-e00c-4209-9979-a265bf685acc_1024x1024.webp 1272w, https://substackcdn.com/image/fetch/$s_!OfhQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4aea833-e00c-4209-9979-a265bf685acc_1024x1024.webp 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Imagine you&#8217;re the Engineering Manager of a fast-growing tech company. Your team is responsible for running a suite of applications on Kubernetes, and everything seems to be going well - until it isn&#8217;t. Suddenly, a critical service goes down because it couldn&#8217;t get the resources it needed, while lower-priority workloads hogged valuable compute power. Now, you&#8217;re facing a production incident and a frustrated product team asking why their mission-critical workload wasn&#8217;t prioritized. Sound familiar?</p><p>In situations like this, Kubernetes&#8217; default scheduling can feel like a black box - effective for standard cases but not always aligned with your unique business priorities. That&#8217;s where <strong>custom schedulers</strong> come into play. Today, let&#8217;s explore a story of how custom schedulers helped an organization like yours take control of their workloads, save money, and ensure critical services always got the attention they deserved.</p><h2><strong>The Default Scheduler Dilemma</strong></h2><p>Our story starts with a company named <strong>Tecknobody (</strong>Fictional), a mid-sized enterprise specializing in financial technology. Tecknobody had adopted Kubernetes to scale their services and reduce manual overhead. At first, everything seemed great - Kubernetes made it easy to deploy applications, and the default scheduler worked well enough for most use cases. But as the business grew, so did the complexity of their infrastructure.</p><p>One day, during a high-stakes product demo, their flagship application suffered a significant slowdown. Investigations revealed that a batch of non-critical analytics jobs was taking up the majority of the cluster&#8217;s resources. The <strong>default Kubernetes scheduler</strong> had assigned these batch jobs to nodes with the most available resources, inadvertently starving the high-priority application of the compute it needed to run smoothly. This left Tecknobody&#8217;s leadership questioning whether Kubernetes was the right choice for their critical infrastructure.</p><h2><strong>The Custom Scheduler Solution</strong></h2><p>Enter <strong>Enna</strong>, Tecknobody&#8217;s Engineering Manager. Enna realized that while Kubernetes was a powerful tool, its default scheduling wasn&#8217;t quite tailored to their business needs. She knew that they needed a better way to ensure critical applications were prioritized, especially during peak times. After some research, Enna and her team decided to build a <strong>custom scheduler</strong>.</p><p>The custom scheduler allowed them to define specific rules for workload placement. By implementing a custom scheduling algorithm, they could ensure that mission-critical workloads always had the resources they needed, while less critical batch processes were scheduled with a lower priority. This not only resolved their immediate problem but also brought a sense of <strong>control</strong> back to the engineering team.</p><h2><strong>The Journey to Building a Custom Scheduler</strong></h2><p>Enna&#8217;s team started by understanding the <strong>scheduler framework</strong> that Kubernetes offers. They learned that Kubernetes allows multiple schedulers to run simultaneously in a cluster, meaning they could deploy their own custom scheduler alongside the default one. By specifying a different `schedulerName` in their pod definitions, they could dictate which pods would use the new custom logic.</p><p>Tecknobody&#8217;s custom scheduler was written in <strong>Go</strong> using the Kubernetes scheduler framework. It wasn&#8217;t an easy journey - Enna had to ensure her team understood the intricacies of <strong>scheduling cycles</strong>, including filtering nodes, scoring potential candidates, and ultimately binding pods to nodes. They created a set of <strong>custom plugins</strong> that allowed them to filter and score nodes based on more granular criteria: prioritizing critical workloads, minimizing cost by consolidating non-critical jobs during off-hours, and maintaining compliance by ensuring data-sensitive applications only ran in approved regions.</p><h2><strong>The Payoff: Control, Efficiency, and Peace of Mind</strong></h2><p>The impact was immediate. With the custom scheduler in place, Tecknobody could ensure that their flagship application always had priority access to the resources it needed. This translated into a smoother product demo, happier stakeholders, and a more reliable customer experience. Enna&#8217;s team also managed to <strong>reduce cloud costs</strong> by consolidating workloads more efficiently and strategically scaling down non-essential processes during low-demand periods.</p><p>For Tecknobody, the custom scheduler became more than just a tool - it was a strategic differentiator. The ability to exert <strong>fine-grained control</strong> over resource allocation helped align the engineering strategy with business goals. Instead of struggling to work within the limitations of the default Kubernetes scheduler, Enna&#8217;s team had created a solution that allowed them to focus on delivering value rather than firefighting infrastructure issues.</p><h2><strong>Why This Matters for You as an Engineering Leader</strong></h2><p>As an Engineering Manager or above, you&#8217;re likely balancing the needs of multiple teams and managing conflicting priorities. Kubernetes is an amazing tool, but its default settings are designed to fit general scenarios -not the specific needs of your business. <strong>Custom schedulers</strong> give you the power to implement your own business rules at the infrastructure level.</p><ul><li><p><strong>Mission-Critical Focus</strong>: Ensure that your high-priority applications always get the resources they need, reducing the risk of downtime or degraded performance during crucial moments.</p></li><li><p><strong>Cost Savings</strong>: Implement logic that takes advantage of low-cost nodes for non-critical workloads, ultimately optimizing your cloud spend.</p></li><li><p><strong>Compliance and Control</strong>: Enforce data sovereignty requirements by using custom scheduling rules that are impossible to implement with the default scheduler.</p></li></ul><p>The challenges you face aren&#8217;t just technical &#8212; they&#8217;re deeply tied to the outcomes your business wants to achieve. By adopting custom schedulers, you can create a <strong>tailored infrastructure</strong> that empowers your team, minimizes surprises, and directly contributes to the goals of your organization.</p><h2><strong>Wrapping Up: The Power of Customization</strong></h2><p>For Tecknobody, investing in a custom scheduler meant they could move from reacting to infrastructure problems to proactively managing them. For Enna, it meant peace of mind - knowing her team had built a system that aligned perfectly with the business&#8217;s unique needs.</p><p>If your organization has found itself limited by Kubernetes&#8217; default behavior, it might be time to consider whether a <strong>custom scheduler</strong> could give you the competitive edge you need. As a leader, embracing this level of customization can be the key to unlocking better efficiency, more predictable performance, and ultimately, happier customers.</p><h2><strong>Key Learnings: How to Approach and Solve Problems Like an Engineering Leader</strong></h2><ol><li><p><strong>Understand the Problem Before Blaming the Tool</strong><br>Tools like Kubernetes are designed to be general-purpose, but your specific use case might reveal limitations. Take time to investigate the root cause of issues instead of assuming the tool is at fault.</p></li><li><p><strong>Align Infrastructure Decisions with Business Goals</strong><br>Engineering challenges are rarely just technical. Consider the broader impact on your business priorities, like cost efficiency, reliability, and compliance, when designing solutions.</p></li><li><p><strong>Research and Explore Alternatives</strong><br>Before dismissing the tool, explore its advanced features or alternative approaches. Kubernetes&#8217; custom scheduler framework, for instance, provides a robust way to tailor resource management to your needs.</p></li><li><p><strong>Collaborate and Upskill Your Team</strong><br>Complex challenges often require stepping into new territory, like building custom schedulers. Invest in your team&#8217;s growth by encouraging learning and experimentation.</p></li><li><p><strong>Think Proactively, Not Reactively</strong><br>Instead of waiting for incidents to dictate your next steps, anticipate potential bottlenecks and design systems to mitigate them. This mindset turns firefighting into strategic planning.</p></li><li><p><strong>Leverage the Power of Customization</strong><br>One size rarely fits all in engineering. Customization can bridge the gap between default behavior and the unique requirements of your business. Don&#8217;t hesitate to tailor solutions to fit your needs.</p></li><li><p><strong>Iterate and Improve Continuously</strong><br>The first implementation may not be perfect, but it will serve as a foundation for future improvements. Focus on delivering incremental value while refining your approach over time.</p></li><li><p><strong>Share Knowledge and Learnings</strong><br>Challenges and their solutions are opportunities for growth - not just for your team, but for the broader engineering community. Sharing your story helps others navigate similar hurdles and fosters collective innovation.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.groktechie.com/p/mastering-kubernetes-with-custom/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://www.groktechie.com/p/mastering-kubernetes-with-custom/comments"><span>Leave a comment</span></a></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.groktechie.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading GrokTechie! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p></li></ol>]]></content:encoded></item><item><title><![CDATA[Zabbix- A Simpler way of Monitoring]]></title><description><![CDATA[Today, applications have evolved from standalone to the client-server model and ultimately to the cloud-based elastic application.]]></description><link>https://www.groktechie.com/p/zabbix-simpler-way-of-monitoring</link><guid isPermaLink="false">https://www.groktechie.com/p/zabbix-simpler-way-of-monitoring</guid><dc:creator><![CDATA[Shashank Singh]]></dc:creator><pubDate>Mon, 19 Jun 2017 07:02:00 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/5af7750c-690a-4f68-a2dc-eaf5666c9c6f_924x500.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Today, applications have evolved from standalone to the client-server model and ultimately to the cloud-based elastic application. Application performance can directly affect a business, hurting the revenue as customer struggle to complete the process. It&#8217;s always been difficult to see what&#8217;s going on inside the system. And doing so has become an essential part. Having a good monitoring tool will help us to understand the system status and determine when they are behaving normally and when they are behaving abnormally. When something goes wrong, the tool alerts quickly and then we can act on it and fix it without affecting customers. Zabbix is a well-known tool to do that for you.</p><h2>Why do we need Application Monitoring?</h2><ul><li><p>Information gathering</p></li></ul><p> Large application produces a humongous number of data that should be monitored and analyzed for the performance and improvement of product and thereby better business.</p><ul><li><p>Around the clock monitoring</p></li></ul><p> Humans will never be able to monitor each server 24 X 7. But it is very crucial that any unexpected incident on the servers should be notified and act on it immediately.</p><ul><li><p>Pre-emptive Alerting</p></li></ul><p> Monitoring tool is an invisible team member who will alert you about unexpected things in the system.</p><h2>What is Zabbix?</h2><p> Zabbix is an open source, real-time application, and network monitoring tool. It offers monitoring of thousands of metrics collected from physical machines or virtual machines. Zabbix has a web-based management interface which is centralized through a database. With Zabbix, visualization of your data is available in the form of graphs, screens, maps and overviews.</p><h2>Why Choose Zabbix?</h2><ul><li><p>Open Source &#8211; Zabbix is purely open source and comes at no cost.</p></li><li><p>Active Monitoring &#8211; You can easily monitor servers, applications and network devices, gathering accurate statistics and performance data</p></li><li><p>Enterprise ready &#8211; Zabbix has been designed to scale from small environments to large environments</p></li><li><p>Capacity Planning &#8211; With the data collected by Zabbix, you will be easy to analyze your infrastructure and plan the capacity accordingly.</p></li></ul><h2>Zabbix Architecture</h2><p> Zabbix is distributed monitoring tool with a central web interface. The simple architecture of Zabbix can be composed of three servers.</p><ul><li><p>Web Server</p></li><li><p>RDBMS Server</p></li><li><p>Zabbix server</p></li></ul><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ZbM8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e1568a0-9e03-4293-b3d7-181e801b5f79_924x500.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZbM8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e1568a0-9e03-4293-b3d7-181e801b5f79_924x500.png 424w, https://substackcdn.com/image/fetch/$s_!ZbM8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e1568a0-9e03-4293-b3d7-181e801b5f79_924x500.png 848w, https://substackcdn.com/image/fetch/$s_!ZbM8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e1568a0-9e03-4293-b3d7-181e801b5f79_924x500.png 1272w, https://substackcdn.com/image/fetch/$s_!ZbM8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e1568a0-9e03-4293-b3d7-181e801b5f79_924x500.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZbM8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e1568a0-9e03-4293-b3d7-181e801b5f79_924x500.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9e1568a0-9e03-4293-b3d7-181e801b5f79_924x500.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Zabbix_Arch&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Zabbix_Arch" title="Zabbix_Arch" srcset="https://substackcdn.com/image/fetch/$s_!ZbM8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e1568a0-9e03-4293-b3d7-181e801b5f79_924x500.png 424w, https://substackcdn.com/image/fetch/$s_!ZbM8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e1568a0-9e03-4293-b3d7-181e801b5f79_924x500.png 848w, https://substackcdn.com/image/fetch/$s_!ZbM8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e1568a0-9e03-4293-b3d7-181e801b5f79_924x500.png 1272w, https://substackcdn.com/image/fetch/$s_!ZbM8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e1568a0-9e03-4293-b3d7-181e801b5f79_924x500.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p> This setup is good enough to handle large environment successfully. It&#8217;s better to use the dedicated server for each one of these components.</p><p> Zabbix uses client-server architecture and uses an agent in the servers that should be monitored. This agent gathers all needed information and status from the system and sends to Zabbix server. Zabbix version 3 and above support encrypted communication between server and clients.</p><p> The Zabbix server can take input data also from a Zabbix sender or Zabbix proxy servers.&nbsp; Zabbix sender is a command line utility to send application performance and availability data to Zabbix servers for processing. Zabbix proxies are used to monitor remote servers. It can collect performance and availability data behalf of Zabbix server and save it in a buffer locally and then send it to Zabbix server. This way the proxy servers can take on itself some of the load and offload the Zabbix servers.</p><p> Let us look at some of the terminologies of Zabbix.</p><ul><li><p>Frontend &#8211; Web interface provided with Zabbix</p></li><li><p>Zabbix Server &#8211; Central server to collect the data and process it.</p></li><li><p>Zabbix agent &#8211; A process deployed on client servers to monitor locally</p></li><li><p>Host &#8211; A networked device that should be monitored</p></li><li><p>Host group &#8211; A logical group of hosts. It is used when assigning access rights.</p></li><li><p>Template &#8211; A set of entities (items, triggers, applications, low-level discovery rules, graphs, screens, web scenarios) ready to be applied to one or several hosts</p></li><li><p>Item &#8211; A data that you want to receive from a host</p></li><li><p>Trigger &#8211; It is a logical expression which defines a threshold</p></li><li><p>Event &#8211; Occurrence of something that deserves attention</p></li><li><p>Action -&nbsp; Predefined way of reacting to an event.</p></li></ul><h2>Install and configure Zabbix</h2><p> Now let&#8217;s look at how to install and configure Zabbix 3.0. I&#8217;m going to use one Centos 6 machine for all the three components. That are Zabbix Web, Zabbix Server and Database.</p><h2><strong>Step 1: Disable firewall:</strong></h2><pre><code># service iptables stop
# chkconfig iptables off
# service ip6tables stop
# chkconfig ip6tables off
# vim /etc/selinux/config
 SELINUX=disabled
# echo 0 &gt;/selinux/enforce
# reboot</code></pre><h2><strong>Step 2: Install Mysql on server:</strong></h2><pre><code># yum list installed | grep mysql
# rpm -ivh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
# yum install mysql-server -y
# yum install vim -y</code></pre><h2><strong>Step 3: Start Mysql on server:</strong></h2><pre><code># service mysqld start
# mysql_secure_installation
</code></pre><pre><code>"Enter current password for root    (enter for none):   (Press enter)
 Set root password?             [Y/n]:   Y
 New Password      &nbsp;   :   Password (Enter your root Password)
 Confirm Password   &nbsp;           :   Password (Verify your root Password)
 Remove anonymous users?                [Y/n]:   Y
 Disallow root login remotely?          [Y/n]:   Y
 Remove test database and access to it? [Y/n]:   Y
 Reload privilege tables now?        [Y/n]:   Y</code></pre><h2><strong>Step 4: Login to mysql:</strong></h2><pre><code># mysql -u root -p
# password&nbsp;: Password (Enter your password)
&gt;&gt; CREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin;
&gt;&gt; GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@localhost IDENTIFIED BY 'Password';</code></pre><h2><strong>Step 5: Install PHP on server:</strong></h2><pre><code># rpm -ivh http://repo.webtatic.com/yum/el6/latest.rpm
# yum install httpd php56w php56w-gd php56w-mysql php56w-bcmath php56w-mbstring php56w-xml php56w-ldap
# vim /etc/php.ini

 post_max_size=16M
 max_execution_time=300
 max_input_time=300
 date.timezone=Asia/Kolkata
 always_populate_raw_post_data=-1</code></pre><h2><strong>Step 6: A zabbix user in a group:</strong></h2><pre><code># groupadd zabbix 
# useradd -g zabbix zabbix</code></pre><h2><strong>Step 6: Install zabbix on server:</strong></h2><pre><code># mkdir /home/zabbix/downloads
# cd /home/zabbix/downloads
# wget https://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/3.2.4/zabbix-3.2.4.tar.gz
# tar xvf zabbix-3.2.4.tar.gz</code></pre><h2><strong>Step 7: install zabbix database in Mysql:</strong></h2><pre><code># cd /home/zabbix/downloads/zabbix-3.2.4/database/mysql/
# mysql -u zabbix -p zabbix &lt; schema.sql
# mysql -u zabbix -p zabbix &lt; images.sql
# mysql -u zabbix -p zabbix &lt; data.sql</code></pre><h2><strong>Step 8: Configure the source code:</strong></h2><pre><code># yum install gcc mysql-community-devel libxml2-devel  unixODBC-devel net-snmp-devel libcurl-devel libssh2-devel OpenIPMI-devel openssl-devel openldap-devel -y
# cd ../..
# ./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2 --with-unixodbc --with-ssh2 --with-openipmi --with-openssl
# make
# make install</code></pre><h2><strong>Step 9: Edit the Zabbix config file:</strong></h2><pre><code># vim /usr/local/etc/zabbix_server.conf

 DBName=zabbix
 DBUser=zabbix
 DBPassword=your_password</code></pre><h2><strong>Step 10: Configure zabbix:</strong></h2><pre><code># mkdir /var/www/html/zabbix
# cd /home/zabbix/downloads/zabbix-3.2.4/frontends/php/
# cp -a . /var/www/html/zabbix/
# chcon -Rv --type=httpd_sys_content_t /var/www/html
# setsebool -P httpd_can_network_connect=1
# setsebool -P zabbix_can_network=1
# chown -R apache:apache /var/www/html/zabbix
# chmod +x /var/www/html/zabbix/conf/
# cp /home/zabbix/downloads/zabbix-3.2.4/misc/init.d/fedora/core/zabbix_server /etc/init.d/zabbix-server
# cp /home/zabbix/downloads/zabbix-3.2.4/misc/init.d/fedora/core/zabbix_agentd /etc/init.d/zabbix-agentd</code></pre><h2><strong>Step 11: Start services:</strong></h2><pre><code># service zabbix-server start
# service zabbix-agentd start
# service httpd start</code></pre><h2><strong>Step 12: On services on boot time:</strong></h2><pre><code># chkconfig httpd on
# chkconfig mysqld on
# chkconfig zabbix-server on
# chkconfig zabbix-agentd on</code></pre><pre><code>1. Use the same address you have for your server now and add /zabbix to the URL.
URL&nbsp;: Server-IP/zabbix
&gt;&gt;Next

2. Check for pre-requisites and fix errors if you have any.
&gt;&gt;Next

3. Enter settings to connect to database.
password&nbsp;: Password (Enter the password of Mysql)
&gt;&gt;Next

4.  Enter details to connect to web interface.
Name&nbsp;: 3.0.3
&gt;&gt;Next
&gt;&gt;Finish

5. Connect to the Zabbix web interface with default credentials.
Username: Admin
Password: zabbix</code></pre><p> Hope this will help you!</p><p><br>Please Remember me in your prayers!</p><p><br>Enjoy&nbsp;</p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!XXKB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c0dcd89-4b87-46b6-aee4-ee987fe025da_15x15.gif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!XXKB!,w_424,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c0dcd89-4b87-46b6-aee4-ee987fe025da_15x15.gif 424w, https://substackcdn.com/image/fetch/$s_!XXKB!,w_848,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c0dcd89-4b87-46b6-aee4-ee987fe025da_15x15.gif 848w, https://substackcdn.com/image/fetch/$s_!XXKB!,w_1272,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c0dcd89-4b87-46b6-aee4-ee987fe025da_15x15.gif 1272w, https://substackcdn.com/image/fetch/$s_!XXKB!,w_1456,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c0dcd89-4b87-46b6-aee4-ee987fe025da_15x15.gif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!XXKB!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c0dcd89-4b87-46b6-aee4-ee987fe025da_15x15.gif" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2c0dcd89-4b87-46b6-aee4-ee987fe025da_15x15.gif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;:-)&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt=":-)" title=":-)" srcset="https://substackcdn.com/image/fetch/$s_!XXKB!,w_424,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c0dcd89-4b87-46b6-aee4-ee987fe025da_15x15.gif 424w, https://substackcdn.com/image/fetch/$s_!XXKB!,w_848,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c0dcd89-4b87-46b6-aee4-ee987fe025da_15x15.gif 848w, https://substackcdn.com/image/fetch/$s_!XXKB!,w_1272,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c0dcd89-4b87-46b6-aee4-ee987fe025da_15x15.gif 1272w, https://substackcdn.com/image/fetch/$s_!XXKB!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c0dcd89-4b87-46b6-aee4-ee987fe025da_15x15.gif 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a>]]></content:encoded></item><item><title><![CDATA[Step-by-Step: Connect your AWS and Azure environments with a VPN tunnel]]></title><description><![CDATA[Recently I&#8217;ve been working with a customer that is planning to connect the Azure infra with AWS infra through site-to-site VPN.]]></description><link>https://www.groktechie.com/p/step-by-step-connect-your-aws-and-azure</link><guid isPermaLink="false">https://www.groktechie.com/p/step-by-step-connect-your-aws-and-azure</guid><dc:creator><![CDATA[Shashank Singh]]></dc:creator><pubDate>Mon, 19 Jun 2017 06:24:00 GMT</pubDate><enclosure url="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/image_thumb_6FD4C7A5.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Recently I&#8217;ve been working with a customer that is planning to connect the Azure infra with AWS infra through site-to-site VPN. As their Primary AD server is running on Azure and rest infra in running on AWS. To setup this S2S VPN,</p><p>To achieve the desired results we create a POC (proof of concept environment) that is composed of the following pieces:</p><p>`</p><a class="image-link image2" target="_blank" href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/image_thumb_6FD4C7A5.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/image_thumb_6FD4C7A5.png 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/image_thumb_6FD4C7A5.png 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/image_thumb_6FD4C7A5.png 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/image_thumb_6FD4C7A5.png 1456w" sizes="100vw"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/image_thumb_6FD4C7A5.png" data-attrs="{&quot;src&quot;:&quot;https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/image_thumb_6FD4C7A5.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;image&quot;,&quot;title&quot;:&quot;image&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="image" title="image" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/image_thumb_6FD4C7A5.png 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/image_thumb_6FD4C7A5.png 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/image_thumb_6FD4C7A5.png 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/image_thumb_6FD4C7A5.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a><p>In this post I will show how created that site to site IPsec tunnel to connect to a Virtual Private Cloud (VPC) hosted in Amazon Web Services (AWS) to a Virtual Network in Azure. Using this setup you can have workloads in one or both clouds with full VM to VM connectivity over a secure IPsec tunnel. This easily can provide connectivity for high availability operations.</p><p>In our case we selected a Windows 2012 R2 server as the end point of the tunnel on the AWS side mostly because it is a supported platform as a&nbsp;<a href="https://azure.microsoft.com/en-us/documentation/articles/vpn-gateway-about-vpn-devices/#validated-vpn-devices">Azure VPN device</a>&nbsp;for route-based VPN that did not add costs to our POC unlike other supported virtual appliances from the AWS marketplace that are supported as validated VPN devices on Azure.</p><p>let&#8217;s get started&#8230;</p><h3>Create an Elastic IP in AWS</h3><p>First we need to an allocate address in AWS.&nbsp; It will be assigned in later steps to the AWS VPN gateway. However we will need that address before we start to configuring the Azure infrastructure.</p><p>1. In the VPC dashboard, click Elastic IPs , allocate New Address and click Yes, Allocate</p><a class="image-link image2" target="_blank" href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image002_thumb_5CB62BAA.jpg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image002_thumb_5CB62BAA.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image002_thumb_5CB62BAA.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image002_thumb_5CB62BAA.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image002_thumb_5CB62BAA.jpg 1456w" sizes="100vw"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image002_thumb_5CB62BAA.jpg" data-attrs="{&quot;src&quot;:&quot;https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image002_thumb_5CB62BAA.jpg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;clip_image002&quot;,&quot;title&quot;:&quot;clip_image002&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="clip_image002" title="clip_image002" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image002_thumb_5CB62BAA.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image002_thumb_5CB62BAA.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image002_thumb_5CB62BAA.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image002_thumb_5CB62BAA.jpg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p>This will create the address but it will not assign it anywhere. We're doing this now since we need the IP address to setup the Azure side of the VPN</p><h3>Prepare the Azure side of the VPN</h3><p>1. We used the Resource Group deployment model.&nbsp; So first, we need to create a Resource group for our POC.&nbsp; We created&nbsp;<strong>AZURE2AWS</strong></p><p>2. In the AZURE2AWS Resource Group Add a virtual Network.</p><a class="image-link image2" target="_blank" href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image004_thumb_48558781.jpg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image004_thumb_48558781.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image004_thumb_48558781.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image004_thumb_48558781.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image004_thumb_48558781.jpg 1456w" sizes="100vw"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image004_thumb_48558781.jpg" data-attrs="{&quot;src&quot;:&quot;https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image004_thumb_48558781.jpg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;clip_image004&quot;,&quot;title&quot;:&quot;clip_image004&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="clip_image004" title="clip_image004" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image004_thumb_48558781.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image004_thumb_48558781.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image004_thumb_48558781.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image004_thumb_48558781.jpg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p>3. In the Next blade ensure to select Resource Manager as the deployment model and click Create</p><a class="image-link image2" target="_blank" href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image006_thumb_1A6AC57A.jpg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image006_thumb_1A6AC57A.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image006_thumb_1A6AC57A.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image006_thumb_1A6AC57A.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image006_thumb_1A6AC57A.jpg 1456w" sizes="100vw"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image006_thumb_1A6AC57A.jpg" data-attrs="{&quot;src&quot;:&quot;https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image006_thumb_1A6AC57A.jpg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;clip_image006&quot;,&quot;title&quot;:&quot;clip_image006&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="clip_image006" title="clip_image006" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image006_thumb_1A6AC57A.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image006_thumb_1A6AC57A.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image006_thumb_1A6AC57A.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image006_thumb_1A6AC57A.jpg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p>4. Fill in creation details and click Create.</p><p>We used one Virtual Network called Azure2Aws with an address space of 172.16.0.0/16.&nbsp; In it we created a subnet called FrontEnd with the address range 172.16.1.0/24</p><a class="image-link image2" target="_blank" href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image008_thumb_432DDCD6.jpg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image008_thumb_432DDCD6.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image008_thumb_432DDCD6.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image008_thumb_432DDCD6.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image008_thumb_432DDCD6.jpg 1456w" sizes="100vw"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image008_thumb_432DDCD6.jpg" data-attrs="{&quot;src&quot;:&quot;https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image008_thumb_432DDCD6.jpg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;clip_image008&quot;,&quot;title&quot;:&quot;clip_image008&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="clip_image008" title="clip_image008" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image008_thumb_432DDCD6.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image008_thumb_432DDCD6.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image008_thumb_432DDCD6.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image008_thumb_432DDCD6.jpg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p>5. In the Virtual Network I created a GTW subnet that will be used when we create the Gateway.</p><a class="image-link image2" target="_blank" href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image010_thumb_2B7B052B.jpg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image010_thumb_2B7B052B.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image010_thumb_2B7B052B.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image010_thumb_2B7B052B.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image010_thumb_2B7B052B.jpg 1456w" sizes="100vw"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image010_thumb_2B7B052B.jpg" data-attrs="{&quot;src&quot;:&quot;https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image010_thumb_2B7B052B.jpg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;clip_image010&quot;,&quot;title&quot;:&quot;clip_image010&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="clip_image010" title="clip_image010" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image010_thumb_2B7B052B.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image010_thumb_2B7B052B.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image010_thumb_2B7B052B.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image010_thumb_2B7B052B.jpg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><a class="image-link image2" target="_blank" href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/SNAGHTML1be7c79_thumb_5E946249.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/SNAGHTML1be7c79_thumb_5E946249.png 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/SNAGHTML1be7c79_thumb_5E946249.png 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/SNAGHTML1be7c79_thumb_5E946249.png 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/SNAGHTML1be7c79_thumb_5E946249.png 1456w" sizes="100vw"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/SNAGHTML1be7c79_thumb_5E946249.png" data-attrs="{&quot;src&quot;:&quot;https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/SNAGHTML1be7c79_thumb_5E946249.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;SNAGHTML1be7c79&quot;,&quot;title&quot;:&quot;SNAGHTML1be7c79&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="SNAGHTML1be7c79" title="SNAGHTML1be7c79" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/SNAGHTML1be7c79_thumb_5E946249.png 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/SNAGHTML1be7c79_thumb_5E946249.png 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/SNAGHTML1be7c79_thumb_5E946249.png 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/SNAGHTML1be7c79_thumb_5E946249.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p>When providing the subnet name ensure that you use &#8220;GatewaySubnet&#8221; (<strong>This name is mandatory for Gateway Subnets).&nbsp;&nbsp;</strong>We used&nbsp;the subnet address space &#8211; 172.16.254.0/24</p><p>6. Once our virtual network was created. We deployed a Windows 2012 R2 server in the virtual network.&nbsp; It will act as a DC and DNS server for the lab. ( we deployed it at this point so it will be ready by the time we need it).&nbsp; We ensured that the NIC for the server was set to static since we will use it as a DC and as a DNS server.</p><a class="image-link image2" target="_blank" href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image014_thumb_4CDC79D1.jpg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image014_thumb_4CDC79D1.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image014_thumb_4CDC79D1.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image014_thumb_4CDC79D1.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image014_thumb_4CDC79D1.jpg 1456w" sizes="100vw"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image014_thumb_4CDC79D1.jpg" data-attrs="{&quot;src&quot;:&quot;https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image014_thumb_4CDC79D1.jpg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;clip_image014&quot;,&quot;title&quot;:&quot;clip_image014&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="clip_image014" title="clip_image014" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image014_thumb_4CDC79D1.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image014_thumb_4CDC79D1.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image014_thumb_4CDC79D1.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image014_thumb_4CDC79D1.jpg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p>7. We navigated back to the Azure2Aws resource group and added a Virtual Network Gateway.</p><a class="image-link image2" target="_blank" href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image016_thumb_78484CDE.jpg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image016_thumb_78484CDE.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image016_thumb_78484CDE.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image016_thumb_78484CDE.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image016_thumb_78484CDE.jpg 1456w" sizes="100vw"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image016_thumb_78484CDE.jpg" data-attrs="{&quot;src&quot;:&quot;https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image016_thumb_78484CDE.jpg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;clip_image016&quot;,&quot;title&quot;:&quot;clip_image016&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="clip_image016" title="clip_image016" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image016_thumb_78484CDE.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image016_thumb_78484CDE.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image016_thumb_78484CDE.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image016_thumb_78484CDE.jpg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p>Clicked Create in the Virtual network Gateway blade, provided the info needed for the creation (Gateway name, IP address Name, route-based) and click create. (Be patient it will take some time to generate the gateway).</p><a class="image-link image2" target="_blank" href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/image_thumb_30F5879D.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/image_thumb_30F5879D.png 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/image_thumb_30F5879D.png 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/image_thumb_30F5879D.png 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/image_thumb_30F5879D.png 1456w" sizes="100vw"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/image_thumb_30F5879D.png" data-attrs="{&quot;src&quot;:&quot;https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/image_thumb_30F5879D.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;image&quot;,&quot;title&quot;:&quot;image&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="image" title="image" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/image_thumb_30F5879D.png 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/image_thumb_30F5879D.png 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/image_thumb_30F5879D.png 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/image_thumb_30F5879D.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p>After the gateway has been created you will need to note the IP Address of the Virtual network Gateway you will need it later.</p><p>8. Then, navigate back to the Resource Group and Add a Local Network Gateway.</p><a class="image-link image2" target="_blank" href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image020_thumb_11D4FB6E.jpg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image020_thumb_11D4FB6E.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image020_thumb_11D4FB6E.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image020_thumb_11D4FB6E.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image020_thumb_11D4FB6E.jpg 1456w" sizes="100vw"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image020_thumb_11D4FB6E.jpg" data-attrs="{&quot;src&quot;:&quot;https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image020_thumb_11D4FB6E.jpg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;clip_image020&quot;,&quot;title&quot;:&quot;clip_image020&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="clip_image020" title="clip_image020" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image020_thumb_11D4FB6E.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image020_thumb_11D4FB6E.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image020_thumb_11D4FB6E.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image020_thumb_11D4FB6E.jpg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p>I once you selected Local Network Gateway above, click create in the next blade, fill the information of the AWS VPC (IP address is the Elastic IP assigned to the GTW &#8211;&nbsp;<em>We created that in the first step</em>&nbsp;&#8211; in the AWS VPC, and address space is the VPC CIDR in AWS) ensure that you are always selecting the right Resource Group in our case Azure2Aws and click create</p><a class="image-link image2" target="_blank" href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image022_thumb_17488D74.jpg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image022_thumb_17488D74.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image022_thumb_17488D74.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image022_thumb_17488D74.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image022_thumb_17488D74.jpg 1456w" sizes="100vw"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image022_thumb_17488D74.jpg" data-attrs="{&quot;src&quot;:&quot;https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image022_thumb_17488D74.jpg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;clip_image022&quot;,&quot;title&quot;:&quot;clip_image022&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="clip_image022" title="clip_image022" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image022_thumb_17488D74.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image022_thumb_17488D74.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image022_thumb_17488D74.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image022_thumb_17488D74.jpg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p>9. Wait for the Local network Gateway to be created. Once it is created, in the settings of the local network gateway, in the connections setting, add a new connection.</p><a class="image-link image2" target="_blank" href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image024_thumb_18AF40F7.jpg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image024_thumb_18AF40F7.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image024_thumb_18AF40F7.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image024_thumb_18AF40F7.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image024_thumb_18AF40F7.jpg 1456w" sizes="100vw"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image024_thumb_18AF40F7.jpg" data-attrs="{&quot;src&quot;:&quot;https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image024_thumb_18AF40F7.jpg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;clip_image024&quot;,&quot;title&quot;:&quot;clip_image024&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="clip_image024" title="clip_image024" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image024_thumb_18AF40F7.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image024_thumb_18AF40F7.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image024_thumb_18AF40F7.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image024_thumb_18AF40F7.jpg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p>In the connection settings give it a name select the Azure Virtual network gateway we created earlier and supply a shared key note the shared key , you will need it later.&nbsp; I recommend you DO NOT use&nbsp;<strong>a1b2c3d4e5</strong>&nbsp;has we did.&nbsp; This is a test environment.&nbsp; please generate a strong shared key.</p><a class="image-link image2" target="_blank" href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image026_thumb_6575983E.jpg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image026_thumb_6575983E.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image026_thumb_6575983E.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image026_thumb_6575983E.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image026_thumb_6575983E.jpg 1456w" sizes="100vw"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image026_thumb_6575983E.jpg" data-attrs="{&quot;src&quot;:&quot;https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image026_thumb_6575983E.jpg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;clip_image026&quot;,&quot;title&quot;:&quot;clip_image026&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="clip_image026" title="clip_image026" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image026_thumb_6575983E.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image026_thumb_6575983E.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image026_thumb_6575983E.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image026_thumb_6575983E.jpg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p>10. I set the Virtual Network DNS to be the DNS on my DC1 machine (the one we created earlier). Navigate to the Resource Group, select the Virtual Network, all settings, set the DNS to custom and provide the address of the DC1 NIC.</p><a class="image-link image2" target="_blank" href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image028_thumb_51ED59FF.jpg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image028_thumb_51ED59FF.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image028_thumb_51ED59FF.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image028_thumb_51ED59FF.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image028_thumb_51ED59FF.jpg 1456w" sizes="100vw"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image028_thumb_51ED59FF.jpg" data-attrs="{&quot;src&quot;:&quot;https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image028_thumb_51ED59FF.jpg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;clip_image028&quot;,&quot;title&quot;:&quot;clip_image028&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="clip_image028" title="clip_image028" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image028_thumb_51ED59FF.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image028_thumb_51ED59FF.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image028_thumb_51ED59FF.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image028_thumb_51ED59FF.jpg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><h3>Prepare AWS side</h3><p>1. Now that the Azure side of the equation is ready Let&#8217;s move to the AWS side of things.&nbsp; First we created a new VPC.</p><ul><li><p>Name Aws2Azure</p></li><li><p>Address block of 10.0.0.0/16</p></li><li><p>I used the following name: awssubnet</p></li><li><p>CIDR: 10.0.1.0/24</p></li></ul><a class="image-link image2" target="_blank" href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image030_thumb_74D33D11.jpg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image030_thumb_74D33D11.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image030_thumb_74D33D11.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image030_thumb_74D33D11.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image030_thumb_74D33D11.jpg 1456w" sizes="100vw"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image030_thumb_74D33D11.jpg" data-attrs="{&quot;src&quot;:&quot;https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image030_thumb_74D33D11.jpg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;clip_image030&quot;,&quot;title&quot;:&quot;clip_image030&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="clip_image030" title="clip_image030" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image030_thumb_74D33D11.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image030_thumb_74D33D11.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image030_thumb_74D33D11.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image030_thumb_74D33D11.jpg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><a class="image-link image2" target="_blank" href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image032_thumb_4F023810.jpg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image032_thumb_4F023810.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image032_thumb_4F023810.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image032_thumb_4F023810.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image032_thumb_4F023810.jpg 1456w" sizes="100vw"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image032_thumb_4F023810.jpg" data-attrs="{&quot;src&quot;:&quot;https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image032_thumb_4F023810.jpg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;clip_image032&quot;,&quot;title&quot;:&quot;clip_image032&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="clip_image032" title="clip_image032" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image032_thumb_4F023810.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image032_thumb_4F023810.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image032_thumb_4F023810.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image032_thumb_4F023810.jpg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><a class="image-link image2" target="_blank" href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image034_thumb_4302D88D.jpg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image034_thumb_4302D88D.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image034_thumb_4302D88D.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image034_thumb_4302D88D.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image034_thumb_4302D88D.jpg 1456w" sizes="100vw"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image034_thumb_4302D88D.jpg" data-attrs="{&quot;src&quot;:&quot;https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image034_thumb_4302D88D.jpg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;clip_image034&quot;,&quot;title&quot;:&quot;clip_image034&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="clip_image034" title="clip_image034" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image034_thumb_4302D88D.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image034_thumb_4302D88D.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image034_thumb_4302D88D.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image034_thumb_4302D88D.jpg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><a class="image-link image2" target="_blank" href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image035_thumb_03C73FA1.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image035_thumb_03C73FA1.png 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image035_thumb_03C73FA1.png 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image035_thumb_03C73FA1.png 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image035_thumb_03C73FA1.png 1456w" sizes="100vw"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image035_thumb_03C73FA1.png" data-attrs="{&quot;src&quot;:&quot;https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image035_thumb_03C73FA1.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;clip_image035&quot;,&quot;title&quot;:&quot;clip_image035&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="clip_image035" title="clip_image035" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image035_thumb_03C73FA1.png 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image035_thumb_03C73FA1.png 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image035_thumb_03C73FA1.png 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image035_thumb_03C73FA1.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p>2. Insure your VPC is connected to and internet Gateway.</p><a class="image-link image2" target="_blank" href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image037_thumb_2C683C59.jpg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image037_thumb_2C683C59.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image037_thumb_2C683C59.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image037_thumb_2C683C59.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image037_thumb_2C683C59.jpg 1456w" sizes="100vw"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image037_thumb_2C683C59.jpg" data-attrs="{&quot;src&quot;:&quot;https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image037_thumb_2C683C59.jpg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;clip_image037&quot;,&quot;title&quot;:&quot;clip_image037&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="clip_image037" title="clip_image037" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image037_thumb_2C683C59.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image037_thumb_2C683C59.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image037_thumb_2C683C59.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image037_thumb_2C683C59.jpg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p>3. At this point having a VPC up and running we created an EC2 instance in the VPC that will act as our edge VPN device.</p><ul><li><p>A Windows Server 2012 R2 instance</p></li><li><p>I used a t2.small instance but this could change depending on network performance needed.</p></li><li><p>Ensure that Auto-assign Public IP is enabled.</p></li></ul><a class="image-link image2" target="_blank" href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image039_thumb_3D6EFAED.jpg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image039_thumb_3D6EFAED.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image039_thumb_3D6EFAED.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image039_thumb_3D6EFAED.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image039_thumb_3D6EFAED.jpg 1456w" sizes="100vw"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image039_thumb_3D6EFAED.jpg" data-attrs="{&quot;src&quot;:&quot;https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image039_thumb_3D6EFAED.jpg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;clip_image039&quot;,&quot;title&quot;:&quot;clip_image039&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="clip_image039" title="clip_image039" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image039_thumb_3D6EFAED.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image039_thumb_3D6EFAED.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image039_thumb_3D6EFAED.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image039_thumb_3D6EFAED.jpg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p>Please ensure you pick the right VPC and Subnet then click review and launch</p><p>4. Once the instance is running associate the Elastic IP we created earlier to the Network interface of the instance. By clicking Elastic IPs in the VPC dashboard, selecting Associate Address in the actions menu, selecting the Network interface used by the Windows Server 2012 R2 instance we created earlier and click associate</p><a class="image-link image2" target="_blank" href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image041_thumb_7E9F94F5.jpg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image041_thumb_7E9F94F5.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image041_thumb_7E9F94F5.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image041_thumb_7E9F94F5.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image041_thumb_7E9F94F5.jpg 1456w" sizes="100vw"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image041_thumb_7E9F94F5.jpg" data-attrs="{&quot;src&quot;:&quot;https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image041_thumb_7E9F94F5.jpg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;clip_image041&quot;,&quot;title&quot;:&quot;clip_image041&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="clip_image041" title="clip_image041" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image041_thumb_7E9F94F5.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image041_thumb_7E9F94F5.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image041_thumb_7E9F94F5.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image041_thumb_7E9F94F5.jpg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p>5. Next, disable source/destination checking on the server.</p><a class="image-link image2" target="_blank" href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image043_thumb_14F7CAEC.jpg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image043_thumb_14F7CAEC.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image043_thumb_14F7CAEC.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image043_thumb_14F7CAEC.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image043_thumb_14F7CAEC.jpg 1456w" sizes="100vw"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image043_thumb_14F7CAEC.jpg" data-attrs="{&quot;src&quot;:&quot;https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image043_thumb_14F7CAEC.jpg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;clip_image043&quot;,&quot;title&quot;:&quot;clip_image043&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="clip_image043" title="clip_image043" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image043_thumb_14F7CAEC.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image043_thumb_14F7CAEC.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image043_thumb_14F7CAEC.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image043_thumb_14F7CAEC.jpg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><a class="image-link image2" target="_blank" href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image045_thumb_2EEE1BBF.jpg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image045_thumb_2EEE1BBF.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image045_thumb_2EEE1BBF.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image045_thumb_2EEE1BBF.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image045_thumb_2EEE1BBF.jpg 1456w" sizes="100vw"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image045_thumb_2EEE1BBF.jpg" data-attrs="{&quot;src&quot;:&quot;https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image045_thumb_2EEE1BBF.jpg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;clip_image045&quot;,&quot;title&quot;:&quot;clip_image045&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="clip_image045" title="clip_image045" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image045_thumb_2EEE1BBF.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image045_thumb_2EEE1BBF.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image045_thumb_2EEE1BBF.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image045_thumb_2EEE1BBF.jpg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p>6. Once the Elastic IP is associated connect to your instance over RDP. We are now ready to configure the instance to connect to Azure.</p><p>Configure The Windows 2012 R2 Server RRAS server</p><p>1. Copy the content of the script located here&nbsp;<a href="https://raw.githubusercontent.com/Azure/Azure-vpn-config-samples/master/Microsoft/microsoft-rras-windows-server-2012-r2.ps1.xslt">https://raw.githubusercontent.com/Azure/Azure-vpn-config-samples/master/Microsoft/microsoft-rras-windows-server-2012-r2.ps1.xslt</a>&nbsp;we will use that&nbsp;</p><p>PowerShell script to install RRAS on our server and configure it.&nbsp;&nbsp;</p><p>On your AWS windows 2012 R2 instance RDP session. Login as administrator, Open the PowerShell ISE and paste the content of the script you copied above in the script pane of the ISE.</p><p>Modify as shown below. (<strong>red</strong>&nbsp;= delete,&nbsp;<strong>Green</strong>&nbsp;= add\modify) and execute the script.</p><pre><code>&lt;?xml version="1.0" encoding="utf-16"?&gt;
&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  &lt;xsl:output method="text"/&gt;
  &lt;xsl:template match="/"&gt;# Microsoft Corporation
# Windows Azure Virtual Network

# This configuration template applies to Microsoft RRAS running on Windows Server 2012 R2.
# It configures an IPSec VPN tunnel connecting your on-premise VPN device with the Azure gateway.

# !!! Please notice that we have the following restrictions in our support for RRAS:
# !!! 1. Only IKEv2 is currently supported
# !!! 2. Only route-based VPN configuration is supported.
# !!! 3. Admin priveleges are required in order to run this script

Function Invoke-WindowsApi( 
    [string] $dllName,  
    [Type] $returnType,  
    [string] $methodName, 
    [Type[]] $parameterTypes, 
    [Object[]] $parameters 
    )
{
  ## Begin to build the dynamic assembly 
  $domain = [AppDomain]::CurrentDomain 
  $name = New-Object Reflection.AssemblyName 'PInvokeAssembly' 
  $assembly = $domain.DefineDynamicAssembly($name, 'Run') 
  $module = $assembly.DefineDynamicModule('PInvokeModule') 
  $type = $module.DefineType('PInvokeType', "Public,BeforeFieldInit") 

  $inputParameters = @() 

  for($counter = 1; $counter -le $parameterTypes.Length; $counter++) 
  { 
     $inputParameters += $parameters[$counter - 1] 
  } 

  $method = $type.DefineMethod($methodName, 'Public,HideBySig,Static,PinvokeImpl',$returnType, $parameterTypes) 

  ## Apply the P/Invoke constructor 
  $ctor = [Runtime.InteropServices.DllImportAttribute].GetConstructor([string]) 
  $attr = New-Object Reflection.Emit.CustomAttributeBuilder $ctor, $dllName 
  $method.SetCustomAttribute($attr) 

  ## Create the temporary type, and invoke the method. 
  $realType = $type.CreateType() 

  $ret = $realType.InvokeMember($methodName, 'Public,Static,InvokeMethod', $null, $null, $inputParameters) 

  return $ret
}

Function Set-PrivateProfileString( 
    $file, 
    $category, 
    $key, 
    $value) 
{
  ## Prepare the parameter types and parameter values for the Invoke-WindowsApi script 
  $parameterTypes = [string], [string], [string], [string] 
  $parameters = [string] $category, [string] $key, [string] $value, [string] $file 

  ## Invoke the API 
  [void] (Invoke-WindowsApi "kernel32.dll" ([UInt32]) "WritePrivateProfileString" $parameterTypes $parameters)
}

# Install RRAS role
Import-Module ServerManager
Install-WindowsFeature RemoteAccess -IncludeManagementTools
Add-WindowsFeature -name Routing -IncludeManagementTools

# !!! NOTE: A reboot of the machine might be required here after which the script can be executed again.

# Install S2S VPN
Import-Module RemoteAccess
if ((Get-RemoteAccess).VpnS2SStatus -ne "Installed")
{
  Install-RemoteAccess -VpnType VpnS2S
}

# Add and configure S2S VPN interface

Add-VpnS2SInterface -Protocol IKEv2 -AuthenticationMethod PSKOnly -NumberOfTries 3 -ResponderAuthenticationMethod PSKOnly
 -Name &lt;IP address of your Azure gateway&gt; -Destination &lt;IP address of your Azure gateway&gt; -IPv4Subnet @("&lt;IP range of your subnet in Azure&gt;:100")
 -SharedSecret &lt;shared key&gt;</code></pre><pre><code>Set-VpnServerIPsecConfiguration -EncryptionType MaximumEncryption

Set-VpnS2Sinterface -Name &lt;IP address of -InitiateConfigPayload $false -Force

# Set S2S VPN connection to be persistent by editing the router.pbk file (required admin priveleges)
Set-PrivateProfileString $env:windir\System32\ras\router.pbk &#8220;&lt;IP address of your Azure gateway&gt;&#8221; "IdleDisconnectSeconds" "0"
Set-PrivateProfileString $env:windir\System32\ras\router.pbk "&lt;IP address of your Azure gateway&gt;" "RedialOnLinkFailure" "1"

# Restart the RRAS service
Restart-Service RemoteAccess

# Dial-in to Azure gateway
Connect-VpnS2SInterface -Name &lt;IP address of your Azure gateway&gt;</code></pre><pre><code>&lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;
</code></pre><a class="image-link image2" target="_blank" href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image047_thumb_6488F888.jpg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image047_thumb_6488F888.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image047_thumb_6488F888.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image047_thumb_6488F888.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image047_thumb_6488F888.jpg 1456w" sizes="100vw"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image047_thumb_6488F888.jpg" data-attrs="{&quot;src&quot;:&quot;https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image047_thumb_6488F888.jpg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;clip_image047&quot;,&quot;title&quot;:&quot;clip_image047&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="clip_image047" title="clip_image047" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image047_thumb_6488F888.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image047_thumb_6488F888.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image047_thumb_6488F888.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image047_thumb_6488F888.jpg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p>2. Once the script finishes. You may have to run the following command in the powershell console</p><blockquote><p>Restart-Service RemoteAccess</p></blockquote><p>3. And then this one</p><blockquote><p>Connect-VpnS2SInterface -Name &lt;IP address of your Azure gateway&gt;</p></blockquote><p>4. Close PowerShell and open the Routing and Remote Access console and verify that the connection is complete</p><a class="image-link image2" target="_blank" href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image049_thumb_65EFAC0B.jpg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image049_thumb_65EFAC0B.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image049_thumb_65EFAC0B.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image049_thumb_65EFAC0B.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image049_thumb_65EFAC0B.jpg 1456w" sizes="100vw"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image049_thumb_65EFAC0B.jpg" data-attrs="{&quot;src&quot;:&quot;https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image049_thumb_65EFAC0B.jpg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;clip_image049&quot;,&quot;title&quot;:&quot;clip_image049&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="clip_image049" title="clip_image049" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image049_thumb_65EFAC0B.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image049_thumb_65EFAC0B.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image049_thumb_65EFAC0B.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image049_thumb_65EFAC0B.jpg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p>5. Go back to your AWS Management Console to Configure Routing.</p><p>In the Amazon management console switch to the VPC view and select&nbsp;<strong>Route tables</strong>. Select the route table associated with your VPC and add a new route to the 172.16.0.0/16 (Windows Azure Network) and that routes traffic through the instance ID of the Server.</p><a class="image-link image2" target="_blank" href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image051_thumb_56DDEE93.jpg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image051_thumb_56DDEE93.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image051_thumb_56DDEE93.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image051_thumb_56DDEE93.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image051_thumb_56DDEE93.jpg 1456w" sizes="100vw"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image051_thumb_56DDEE93.jpg" data-attrs="{&quot;src&quot;:&quot;https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image051_thumb_56DDEE93.jpg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;clip_image051&quot;,&quot;title&quot;:&quot;clip_image051&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="clip_image051" title="clip_image051" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image051_thumb_56DDEE93.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image051_thumb_56DDEE93.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image051_thumb_56DDEE93.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image051_thumb_56DDEE93.jpg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p>6. And finally, create a DHCP Option set that will point the machines in the AWS network to the DNS on the Azure network. That way you will be able to resolve machines.</p><a class="image-link image2" target="_blank" href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image053_thumb_23A445DB.jpg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image053_thumb_23A445DB.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image053_thumb_23A445DB.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image053_thumb_23A445DB.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image053_thumb_23A445DB.jpg 1456w" sizes="100vw"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image053_thumb_23A445DB.jpg" data-attrs="{&quot;src&quot;:&quot;https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image053_thumb_23A445DB.jpg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;clip_image053&quot;,&quot;title&quot;:&quot;clip_image053&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="clip_image053" title="clip_image053" srcset="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image053_thumb_23A445DB.jpg 424w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image053_thumb_23A445DB.jpg 848w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image053_thumb_23A445DB.jpg 1272w, https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/48/12/metablogapi/clip_image053_thumb_23A445DB.jpg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p>now that the network and the VPN are complete, we created some other VMs on each side (Ubuntu servers in this case) to validate routing, and connectivity.</p><p>That&#8217;s it, we now have a site to site VPN between our AWS and Azure environment.&nbsp; and we&#8217;re ready to start moving our workloads over.</p><p>Cheers!</p><p> Hope this will help you!</p><p><br>Please Remember me in your prayers!</p><p><br>Enjoy&nbsp;</p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gNgo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02e52db1-d7dc-46ce-9ddc-654443aa47ef_15x15.gif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gNgo!,w_424,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02e52db1-d7dc-46ce-9ddc-654443aa47ef_15x15.gif 424w, https://substackcdn.com/image/fetch/$s_!gNgo!,w_848,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02e52db1-d7dc-46ce-9ddc-654443aa47ef_15x15.gif 848w, https://substackcdn.com/image/fetch/$s_!gNgo!,w_1272,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02e52db1-d7dc-46ce-9ddc-654443aa47ef_15x15.gif 1272w, https://substackcdn.com/image/fetch/$s_!gNgo!,w_1456,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02e52db1-d7dc-46ce-9ddc-654443aa47ef_15x15.gif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gNgo!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02e52db1-d7dc-46ce-9ddc-654443aa47ef_15x15.gif" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/02e52db1-d7dc-46ce-9ddc-654443aa47ef_15x15.gif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;:-)&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt=":-)" title=":-)" srcset="https://substackcdn.com/image/fetch/$s_!gNgo!,w_424,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02e52db1-d7dc-46ce-9ddc-654443aa47ef_15x15.gif 424w, https://substackcdn.com/image/fetch/$s_!gNgo!,w_848,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02e52db1-d7dc-46ce-9ddc-654443aa47ef_15x15.gif 848w, https://substackcdn.com/image/fetch/$s_!gNgo!,w_1272,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02e52db1-d7dc-46ce-9ddc-654443aa47ef_15x15.gif 1272w, https://substackcdn.com/image/fetch/$s_!gNgo!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02e52db1-d7dc-46ce-9ddc-654443aa47ef_15x15.gif 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a>]]></content:encoded></item><item><title><![CDATA[AWS Subnets, Security Groups and Access Control Lists. So what is the difference?]]></title><description><![CDATA[Some time ago, a new client had asked me how we will protect his servers if he will decide to migrate them to AWS? I gave him a list of topics that AWS provides from the standpoint of security.]]></description><link>https://www.groktechie.com/p/aws-subnets-security-groups-and-access</link><guid isPermaLink="false">https://www.groktechie.com/p/aws-subnets-security-groups-and-access</guid><dc:creator><![CDATA[Shashank Singh]]></dc:creator><pubDate>Mon, 19 Jun 2017 05:02:00 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/1f4dbb37-a49b-417d-ade8-bdc674b24cd5_1008x328.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Some time ago, a new client had asked me how we will protect his servers if he will decide to migrate them to AWS?&nbsp;I gave him a list of topics that AWS provides from the standpoint of security.<br>&#8220;So how do you block access to the servers from the Internet?&#8221; he asked.<br>&#8220;Well, we use Virtual Private Cloud (VPC), subnetting and Security Groups (SG)&#8221; I answered, and explained the basics.<br>&#8220;Ah, these are like Access Control Lists (ACL)&#8221; he said.<br>&#8220;Well, AWS has ACL also, but we usually configure network access with SG, &#8221; I told him.<br>&#8220;So, what is the difference, what is more secured?&#8221; He asked.In this post, I will try to present the difference between SG and ACL on an AWS VPC using some basic networking principles and examples.<br></p><h1>Subnetting your VPC</h1><p> To understand the main difference between SG and ACL one must first understand the concept of a subnet, and how a VPC is divided into subnets. A <a href="https://en.wikipedia.org/wiki/Subnetwork">subnet</a> is a logical division of the IP address range into smaller logical networks. When you are creating a new VPC, you will be asked to specify a <a href="https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#CIDR_notation">CIDR</a> block. To create a new VPC, just go to the VPC Dashboard on the AWS console, select <strong>Your VPCs</strong> (1) and press on <strong>Create VPC</strong> (2):<br><br></p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!PxBm!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67a655ed-549e-41a3-aa9b-64dc795de27d_1008x328.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PxBm!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67a655ed-549e-41a3-aa9b-64dc795de27d_1008x328.jpeg 424w, https://substackcdn.com/image/fetch/$s_!PxBm!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67a655ed-549e-41a3-aa9b-64dc795de27d_1008x328.jpeg 848w, https://substackcdn.com/image/fetch/$s_!PxBm!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67a655ed-549e-41a3-aa9b-64dc795de27d_1008x328.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!PxBm!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67a655ed-549e-41a3-aa9b-64dc795de27d_1008x328.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PxBm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67a655ed-549e-41a3-aa9b-64dc795de27d_1008x328.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/67a655ed-549e-41a3-aa9b-64dc795de27d_1008x328.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;SG-Image 2&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="SG-Image 2" title="SG-Image 2" srcset="https://substackcdn.com/image/fetch/$s_!PxBm!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67a655ed-549e-41a3-aa9b-64dc795de27d_1008x328.jpeg 424w, https://substackcdn.com/image/fetch/$s_!PxBm!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67a655ed-549e-41a3-aa9b-64dc795de27d_1008x328.jpeg 848w, https://substackcdn.com/image/fetch/$s_!PxBm!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67a655ed-549e-41a3-aa9b-64dc795de27d_1008x328.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!PxBm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67a655ed-549e-41a3-aa9b-64dc795de27d_1008x328.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a><p><br>In the popup window, I have selected a <strong>CIDR block</strong> of 10.0.0.0/16 (1) for a VPC named <strong>VPC Test</strong> (2), which we will use during this post. Press on <strong>Yes, Create</strong> (3) to create the VPC:<br></p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!qY9Y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7eb2f9e-5163-46fe-884f-c7f6af1d6d73_978x464.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!qY9Y!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7eb2f9e-5163-46fe-884f-c7f6af1d6d73_978x464.jpeg 424w, https://substackcdn.com/image/fetch/$s_!qY9Y!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7eb2f9e-5163-46fe-884f-c7f6af1d6d73_978x464.jpeg 848w, https://substackcdn.com/image/fetch/$s_!qY9Y!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7eb2f9e-5163-46fe-884f-c7f6af1d6d73_978x464.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!qY9Y!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7eb2f9e-5163-46fe-884f-c7f6af1d6d73_978x464.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!qY9Y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7eb2f9e-5163-46fe-884f-c7f6af1d6d73_978x464.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a7eb2f9e-5163-46fe-884f-c7f6af1d6d73_978x464.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;SG-Image 1a&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="SG-Image 1a" title="SG-Image 1a" srcset="https://substackcdn.com/image/fetch/$s_!qY9Y!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7eb2f9e-5163-46fe-884f-c7f6af1d6d73_978x464.jpeg 424w, https://substackcdn.com/image/fetch/$s_!qY9Y!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7eb2f9e-5163-46fe-884f-c7f6af1d6d73_978x464.jpeg 848w, https://substackcdn.com/image/fetch/$s_!qY9Y!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7eb2f9e-5163-46fe-884f-c7f6af1d6d73_978x464.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!qY9Y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7eb2f9e-5163-46fe-884f-c7f6af1d6d73_978x464.jpeg 1456w" sizes="100vw"></picture><div></div></div></a><p><br>To create a new subnet select <strong>Subnets</strong> (1) and press on <strong>Create Subnet</strong> (2):<br></p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!RWKI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dd914c3-dfa7-4c0f-8e70-9380dc83132c_300x98.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!RWKI!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dd914c3-dfa7-4c0f-8e70-9380dc83132c_300x98.jpeg 424w, https://substackcdn.com/image/fetch/$s_!RWKI!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dd914c3-dfa7-4c0f-8e70-9380dc83132c_300x98.jpeg 848w, https://substackcdn.com/image/fetch/$s_!RWKI!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dd914c3-dfa7-4c0f-8e70-9380dc83132c_300x98.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!RWKI!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dd914c3-dfa7-4c0f-8e70-9380dc83132c_300x98.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!RWKI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dd914c3-dfa7-4c0f-8e70-9380dc83132c_300x98.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7dd914c3-dfa7-4c0f-8e70-9380dc83132c_300x98.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;SG-Image 3&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="SG-Image 3" title="SG-Image 3" srcset="https://substackcdn.com/image/fetch/$s_!RWKI!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dd914c3-dfa7-4c0f-8e70-9380dc83132c_300x98.jpeg 424w, https://substackcdn.com/image/fetch/$s_!RWKI!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dd914c3-dfa7-4c0f-8e70-9380dc83132c_300x98.jpeg 848w, https://substackcdn.com/image/fetch/$s_!RWKI!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dd914c3-dfa7-4c0f-8e70-9380dc83132c_300x98.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!RWKI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dd914c3-dfa7-4c0f-8e70-9380dc83132c_300x98.jpeg 1456w" sizes="100vw"></picture><div></div></div></a><p><br>When creating a new subnet, the CIDR block can be further divided into smaller chunks. In the following example, I have created a subnet named Test Subnet with a CIDR block of 10.0.1.0/24 (1) which supports 256 IP addresses and resides in the Test VPC (2). You can also select a preferred<br><strong>Availability Zone</strong> (3):<br><br></p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gTC6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff34ad0c6-84a7-4aae-a985-7a8db6cd8c69_300x155.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gTC6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff34ad0c6-84a7-4aae-a985-7a8db6cd8c69_300x155.png 424w, https://substackcdn.com/image/fetch/$s_!gTC6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff34ad0c6-84a7-4aae-a985-7a8db6cd8c69_300x155.png 848w, https://substackcdn.com/image/fetch/$s_!gTC6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff34ad0c6-84a7-4aae-a985-7a8db6cd8c69_300x155.png 1272w, https://substackcdn.com/image/fetch/$s_!gTC6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff34ad0c6-84a7-4aae-a985-7a8db6cd8c69_300x155.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gTC6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff34ad0c6-84a7-4aae-a985-7a8db6cd8c69_300x155.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f34ad0c6-84a7-4aae-a985-7a8db6cd8c69_300x155.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;SG-Image 4&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="SG-Image 4" title="SG-Image 4" srcset="https://substackcdn.com/image/fetch/$s_!gTC6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff34ad0c6-84a7-4aae-a985-7a8db6cd8c69_300x155.png 424w, https://substackcdn.com/image/fetch/$s_!gTC6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff34ad0c6-84a7-4aae-a985-7a8db6cd8c69_300x155.png 848w, https://substackcdn.com/image/fetch/$s_!gTC6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff34ad0c6-84a7-4aae-a985-7a8db6cd8c69_300x155.png 1272w, https://substackcdn.com/image/fetch/$s_!gTC6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff34ad0c6-84a7-4aae-a985-7a8db6cd8c69_300x155.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br>Each subnet inside a VPC is connected to a router which routes the traffic between the different subnets in the VPC &#8211; this is how you get connectivity between different subnets inside the VPC. For EC2 instances on the same subnet, no routing is needed. By now, you are probably asking yourself &#8211; but how do I connect to the Internet? This is done by connecting the router to an Internet Gateway. To create an Internet Gateway select <strong>Internet Gateways</strong> (1) from your VPC Dashboard and press on <strong>Create Internet Gateway</strong> (2):<br></p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!GjvO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ddc91ae-9f2a-49bb-b70a-33f0f0a873f9_300x103.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GjvO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ddc91ae-9f2a-49bb-b70a-33f0f0a873f9_300x103.jpeg 424w, https://substackcdn.com/image/fetch/$s_!GjvO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ddc91ae-9f2a-49bb-b70a-33f0f0a873f9_300x103.jpeg 848w, https://substackcdn.com/image/fetch/$s_!GjvO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ddc91ae-9f2a-49bb-b70a-33f0f0a873f9_300x103.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!GjvO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ddc91ae-9f2a-49bb-b70a-33f0f0a873f9_300x103.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GjvO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ddc91ae-9f2a-49bb-b70a-33f0f0a873f9_300x103.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1ddc91ae-9f2a-49bb-b70a-33f0f0a873f9_300x103.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;SG-Image 5&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="SG-Image 5" title="SG-Image 5" srcset="https://substackcdn.com/image/fetch/$s_!GjvO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ddc91ae-9f2a-49bb-b70a-33f0f0a873f9_300x103.jpeg 424w, https://substackcdn.com/image/fetch/$s_!GjvO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ddc91ae-9f2a-49bb-b70a-33f0f0a873f9_300x103.jpeg 848w, https://substackcdn.com/image/fetch/$s_!GjvO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ddc91ae-9f2a-49bb-b70a-33f0f0a873f9_300x103.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!GjvO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ddc91ae-9f2a-49bb-b70a-33f0f0a873f9_300x103.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br><br>In the popup window give a <strong>Name tag</strong> (1) to the internet gateway and press on <strong>Yes, Create</strong> (2):<br></p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!WzSR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d0a4a8d-0728-4b4e-ba22-d1d5487fcaf7_300x100.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!WzSR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d0a4a8d-0728-4b4e-ba22-d1d5487fcaf7_300x100.jpeg 424w, https://substackcdn.com/image/fetch/$s_!WzSR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d0a4a8d-0728-4b4e-ba22-d1d5487fcaf7_300x100.jpeg 848w, https://substackcdn.com/image/fetch/$s_!WzSR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d0a4a8d-0728-4b4e-ba22-d1d5487fcaf7_300x100.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!WzSR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d0a4a8d-0728-4b4e-ba22-d1d5487fcaf7_300x100.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!WzSR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d0a4a8d-0728-4b4e-ba22-d1d5487fcaf7_300x100.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4d0a4a8d-0728-4b4e-ba22-d1d5487fcaf7_300x100.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;SG-Image 6&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="SG-Image 6" title="SG-Image 6" srcset="https://substackcdn.com/image/fetch/$s_!WzSR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d0a4a8d-0728-4b4e-ba22-d1d5487fcaf7_300x100.jpeg 424w, https://substackcdn.com/image/fetch/$s_!WzSR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d0a4a8d-0728-4b4e-ba22-d1d5487fcaf7_300x100.jpeg 848w, https://substackcdn.com/image/fetch/$s_!WzSR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d0a4a8d-0728-4b4e-ba22-d1d5487fcaf7_300x100.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!WzSR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d0a4a8d-0728-4b4e-ba22-d1d5487fcaf7_300x100.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br>The last thing to do will be to attach the new Internet Gateway to our new VPC. On the VPC Dashboard select <strong>Internet Gateways</strong> (1) and search for the Internet Gateway you would like to attach (2). Select the Internet Gateway (3) and press on <strong>Attach to VPC</strong> (4):<br></p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!5dRW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F271428f4-4264-495a-88e3-583a70a77fd4_300x104.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!5dRW!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F271428f4-4264-495a-88e3-583a70a77fd4_300x104.jpeg 424w, https://substackcdn.com/image/fetch/$s_!5dRW!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F271428f4-4264-495a-88e3-583a70a77fd4_300x104.jpeg 848w, https://substackcdn.com/image/fetch/$s_!5dRW!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F271428f4-4264-495a-88e3-583a70a77fd4_300x104.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!5dRW!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F271428f4-4264-495a-88e3-583a70a77fd4_300x104.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!5dRW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F271428f4-4264-495a-88e3-583a70a77fd4_300x104.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/271428f4-4264-495a-88e3-583a70a77fd4_300x104.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;SG-Image 7&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="SG-Image 7" title="SG-Image 7" srcset="https://substackcdn.com/image/fetch/$s_!5dRW!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F271428f4-4264-495a-88e3-583a70a77fd4_300x104.jpeg 424w, https://substackcdn.com/image/fetch/$s_!5dRW!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F271428f4-4264-495a-88e3-583a70a77fd4_300x104.jpeg 848w, https://substackcdn.com/image/fetch/$s_!5dRW!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F271428f4-4264-495a-88e3-583a70a77fd4_300x104.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!5dRW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F271428f4-4264-495a-88e3-583a70a77fd4_300x104.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br>In the popup window select the <strong>VPC</strong> (1) and press <strong>Yes, Attach</strong> (2):<br></p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!mAqw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5725f298-2629-4b7f-b306-ddfa9fc2b594_300x107.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!mAqw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5725f298-2629-4b7f-b306-ddfa9fc2b594_300x107.jpeg 424w, https://substackcdn.com/image/fetch/$s_!mAqw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5725f298-2629-4b7f-b306-ddfa9fc2b594_300x107.jpeg 848w, https://substackcdn.com/image/fetch/$s_!mAqw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5725f298-2629-4b7f-b306-ddfa9fc2b594_300x107.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!mAqw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5725f298-2629-4b7f-b306-ddfa9fc2b594_300x107.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!mAqw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5725f298-2629-4b7f-b306-ddfa9fc2b594_300x107.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5725f298-2629-4b7f-b306-ddfa9fc2b594_300x107.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;SG-Image 8&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="SG-Image 8" title="SG-Image 8" srcset="https://substackcdn.com/image/fetch/$s_!mAqw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5725f298-2629-4b7f-b306-ddfa9fc2b594_300x107.jpeg 424w, https://substackcdn.com/image/fetch/$s_!mAqw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5725f298-2629-4b7f-b306-ddfa9fc2b594_300x107.jpeg 848w, https://substackcdn.com/image/fetch/$s_!mAqw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5725f298-2629-4b7f-b306-ddfa9fc2b594_300x107.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!mAqw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5725f298-2629-4b7f-b306-ddfa9fc2b594_300x107.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br>Whenever you create a new VPC, AWS will automatically connect a router to the VPC and create a default route table. Each subnet that you add to that VPC will be linked to this route table by default. Let&#8217;s take a look at the routes of the <strong>Route Table</strong> (1) of our subnet:<br></p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!yZIU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca24cf83-6949-4fdb-9f3b-e6ebe33298a7_300x126.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yZIU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca24cf83-6949-4fdb-9f3b-e6ebe33298a7_300x126.jpeg 424w, https://substackcdn.com/image/fetch/$s_!yZIU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca24cf83-6949-4fdb-9f3b-e6ebe33298a7_300x126.jpeg 848w, https://substackcdn.com/image/fetch/$s_!yZIU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca24cf83-6949-4fdb-9f3b-e6ebe33298a7_300x126.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!yZIU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca24cf83-6949-4fdb-9f3b-e6ebe33298a7_300x126.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yZIU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca24cf83-6949-4fdb-9f3b-e6ebe33298a7_300x126.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ca24cf83-6949-4fdb-9f3b-e6ebe33298a7_300x126.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;SG-Image 9&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="SG-Image 9" title="SG-Image 9" srcset="https://substackcdn.com/image/fetch/$s_!yZIU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca24cf83-6949-4fdb-9f3b-e6ebe33298a7_300x126.jpeg 424w, https://substackcdn.com/image/fetch/$s_!yZIU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca24cf83-6949-4fdb-9f3b-e6ebe33298a7_300x126.jpeg 848w, https://substackcdn.com/image/fetch/$s_!yZIU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca24cf83-6949-4fdb-9f3b-e6ebe33298a7_300x126.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!yZIU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca24cf83-6949-4fdb-9f3b-e6ebe33298a7_300x126.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br>The route table has only one route, which sends all traffic with destination 10.0.0.0/16 to the local target. This rule will enable the different subnets of the VPC to communicate with each other. Our subnet and any other subnets added to the VPC with the current default route table will have no access to or from the Internet. This kind of subnets is called <strong>Private Subnets</strong>.<br>We will need to modify the route table in order to grant our subnet access to the Internet. On the VPC Dashboard select <strong>Route Tables</strong> (1), find the Route Table (2) and select it (3). Select the <strong>Routes </strong>tab (4) and press on <strong>Edit</strong> (5):<br></p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_rz4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04090ab8-d11f-48ed-a11b-d6aaa346c22f_300x125.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_rz4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04090ab8-d11f-48ed-a11b-d6aaa346c22f_300x125.jpeg 424w, https://substackcdn.com/image/fetch/$s_!_rz4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04090ab8-d11f-48ed-a11b-d6aaa346c22f_300x125.jpeg 848w, https://substackcdn.com/image/fetch/$s_!_rz4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04090ab8-d11f-48ed-a11b-d6aaa346c22f_300x125.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!_rz4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04090ab8-d11f-48ed-a11b-d6aaa346c22f_300x125.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_rz4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04090ab8-d11f-48ed-a11b-d6aaa346c22f_300x125.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/04090ab8-d11f-48ed-a11b-d6aaa346c22f_300x125.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;SG-Image 10&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="SG-Image 10" title="SG-Image 10" srcset="https://substackcdn.com/image/fetch/$s_!_rz4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04090ab8-d11f-48ed-a11b-d6aaa346c22f_300x125.jpeg 424w, https://substackcdn.com/image/fetch/$s_!_rz4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04090ab8-d11f-48ed-a11b-d6aaa346c22f_300x125.jpeg 848w, https://substackcdn.com/image/fetch/$s_!_rz4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04090ab8-d11f-48ed-a11b-d6aaa346c22f_300x125.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!_rz4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04090ab8-d11f-48ed-a11b-d6aaa346c22f_300x125.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br>Press on the <strong>Add another route</strong> Button (1) which had appeared. Add 0.0.0.0/0 (which means any destination) to the <strong>Destination</strong> and select the Internet Gateway that we have created (2). To finish, press on <strong>Save</strong> (3):<br></p><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!jxkN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd06f4d6a-7829-4914-9fbc-6ba0144e2445_300x136.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jxkN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd06f4d6a-7829-4914-9fbc-6ba0144e2445_300x136.jpeg 424w, https://substackcdn.com/image/fetch/$s_!jxkN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd06f4d6a-7829-4914-9fbc-6ba0144e2445_300x136.jpeg 848w, https://substackcdn.com/image/fetch/$s_!jxkN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd06f4d6a-7829-4914-9fbc-6ba0144e2445_300x136.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!jxkN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd06f4d6a-7829-4914-9fbc-6ba0144e2445_300x136.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jxkN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd06f4d6a-7829-4914-9fbc-6ba0144e2445_300x136.jpeg" width="640" height="289" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d06f4d6a-7829-4914-9fbc-6ba0144e2445_300x136.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:289,&quot;width&quot;:640,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;SG-Image 11&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="SG-Image 11" title="SG-Image 11" srcset="https://substackcdn.com/image/fetch/$s_!jxkN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd06f4d6a-7829-4914-9fbc-6ba0144e2445_300x136.jpeg 424w, https://substackcdn.com/image/fetch/$s_!jxkN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd06f4d6a-7829-4914-9fbc-6ba0144e2445_300x136.jpeg 848w, https://substackcdn.com/image/fetch/$s_!jxkN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd06f4d6a-7829-4914-9fbc-6ba0144e2445_300x136.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!jxkN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd06f4d6a-7829-4914-9fbc-6ba0144e2445_300x136.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><p><br>With the Internet Gateway attached our subnet can now access the Internet. This kind of subnets is called <strong>Public Subnets</strong>. The following diagram illustrates the network setup that we have created:<br></p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!vBjg!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0e6ead3-8e11-4a7b-a586-ad2ef77f0295_300x213.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!vBjg!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0e6ead3-8e11-4a7b-a586-ad2ef77f0295_300x213.jpeg 424w, https://substackcdn.com/image/fetch/$s_!vBjg!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0e6ead3-8e11-4a7b-a586-ad2ef77f0295_300x213.jpeg 848w, https://substackcdn.com/image/fetch/$s_!vBjg!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0e6ead3-8e11-4a7b-a586-ad2ef77f0295_300x213.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!vBjg!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0e6ead3-8e11-4a7b-a586-ad2ef77f0295_300x213.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!vBjg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0e6ead3-8e11-4a7b-a586-ad2ef77f0295_300x213.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e0e6ead3-8e11-4a7b-a586-ad2ef77f0295_300x213.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;M1-SG-Image 12&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="M1-SG-Image 12" title="M1-SG-Image 12" srcset="https://substackcdn.com/image/fetch/$s_!vBjg!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0e6ead3-8e11-4a7b-a586-ad2ef77f0295_300x213.jpeg 424w, https://substackcdn.com/image/fetch/$s_!vBjg!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0e6ead3-8e11-4a7b-a586-ad2ef77f0295_300x213.jpeg 848w, https://substackcdn.com/image/fetch/$s_!vBjg!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0e6ead3-8e11-4a7b-a586-ad2ef77f0295_300x213.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!vBjg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0e6ead3-8e11-4a7b-a586-ad2ef77f0295_300x213.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br>Routes, subnets, and CIDR blocks can be a bit tricky. If you want to know more, just search it, as there are a lot of websites devoted to the subjects. For you book lovers, I can suggest this <a href="http://www.amazon.com/CCNA-Routing-Switching-Study-Guide/dp/1118749618/ref=la_B000APOJ5M_1_1?s=books&amp;ie=UTF8&amp;qid=1434701371&amp;sr=1-1">book</a>, where you can find a good explanation of the subjects.<br></p><h1>Secure Those Instances!</h1><p> Some of the parameters we are asked to specify when launching a new EC2 instance is the VPC, the subnet and the Security Groups (SG) for the instance. We have already created a VPC and a subnet, so now it&#8217;s time to create an SG. On the EC2 Dashboard select <strong>Security Groups</strong> (1) and press on <strong>Create Security Group</strong> (2):<br></p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!g5aM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc88c5eae-be59-4c56-a097-4cdb8a51281b_300x119.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!g5aM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc88c5eae-be59-4c56-a097-4cdb8a51281b_300x119.jpeg 424w, https://substackcdn.com/image/fetch/$s_!g5aM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc88c5eae-be59-4c56-a097-4cdb8a51281b_300x119.jpeg 848w, https://substackcdn.com/image/fetch/$s_!g5aM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc88c5eae-be59-4c56-a097-4cdb8a51281b_300x119.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!g5aM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc88c5eae-be59-4c56-a097-4cdb8a51281b_300x119.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!g5aM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc88c5eae-be59-4c56-a097-4cdb8a51281b_300x119.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c88c5eae-be59-4c56-a097-4cdb8a51281b_300x119.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;SG-Image 13&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="SG-Image 13" title="SG-Image 13" srcset="https://substackcdn.com/image/fetch/$s_!g5aM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc88c5eae-be59-4c56-a097-4cdb8a51281b_300x119.jpeg 424w, https://substackcdn.com/image/fetch/$s_!g5aM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc88c5eae-be59-4c56-a097-4cdb8a51281b_300x119.jpeg 848w, https://substackcdn.com/image/fetch/$s_!g5aM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc88c5eae-be59-4c56-a097-4cdb8a51281b_300x119.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!g5aM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc88c5eae-be59-4c56-a097-4cdb8a51281b_300x119.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br>In the popup window give the SG a name (1), a description (2) and select the VPC (3). Below you will notice two tabs for the SG rules (4), <strong>Inbound</strong> and <strong>Outbound</strong>. On the <strong>Inbound</strong> tab, you will notice that there are no inbound rules. Press on the <strong>Add Role</strong> for the <strong>Inbound</strong> tab (5):<br></p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cCpl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff13faff-76c7-4c6c-9e4c-a1586598e632_300x163.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cCpl!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff13faff-76c7-4c6c-9e4c-a1586598e632_300x163.jpeg 424w, https://substackcdn.com/image/fetch/$s_!cCpl!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff13faff-76c7-4c6c-9e4c-a1586598e632_300x163.jpeg 848w, https://substackcdn.com/image/fetch/$s_!cCpl!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff13faff-76c7-4c6c-9e4c-a1586598e632_300x163.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!cCpl!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff13faff-76c7-4c6c-9e4c-a1586598e632_300x163.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cCpl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff13faff-76c7-4c6c-9e4c-a1586598e632_300x163.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ff13faff-76c7-4c6c-9e4c-a1586598e632_300x163.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;SG-Image 14&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="SG-Image 14" title="SG-Image 14" srcset="https://substackcdn.com/image/fetch/$s_!cCpl!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff13faff-76c7-4c6c-9e4c-a1586598e632_300x163.jpeg 424w, https://substackcdn.com/image/fetch/$s_!cCpl!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff13faff-76c7-4c6c-9e4c-a1586598e632_300x163.jpeg 848w, https://substackcdn.com/image/fetch/$s_!cCpl!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff13faff-76c7-4c6c-9e4c-a1586598e632_300x163.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!cCpl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff13faff-76c7-4c6c-9e4c-a1586598e632_300x163.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br>Inbound traffic means traffic coming into the instance. The origin of the traffic can be an instance on the same subnet, on a different subnet on the same VPC, or a server on the other side of the world.<br>By default, a new SG is created with no inbound traffic allowed. When setting a new rule, we must specify the <strong>Type</strong> (1), <strong>Protocol</strong> (2), <strong>Port Range</strong> (3) and <strong>Source</strong> (4). In the following example I have permitted inbound access for the SSH protocol only from <strong>My IP</strong> address (the public IP address I currently use to connect to the AWS console, not shown), and to the HTTP and HTTPS protocols from <strong>Anywhere </strong>(that is what the 0.0.0.0/0 means):<br></p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Sn9U!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07a2e31e-690f-4e08-a79a-7b81d9da3cd0_300x163.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Sn9U!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07a2e31e-690f-4e08-a79a-7b81d9da3cd0_300x163.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Sn9U!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07a2e31e-690f-4e08-a79a-7b81d9da3cd0_300x163.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Sn9U!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07a2e31e-690f-4e08-a79a-7b81d9da3cd0_300x163.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Sn9U!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07a2e31e-690f-4e08-a79a-7b81d9da3cd0_300x163.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Sn9U!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07a2e31e-690f-4e08-a79a-7b81d9da3cd0_300x163.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/07a2e31e-690f-4e08-a79a-7b81d9da3cd0_300x163.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;SG-Image 15&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="SG-Image 15" title="SG-Image 15" srcset="https://substackcdn.com/image/fetch/$s_!Sn9U!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07a2e31e-690f-4e08-a79a-7b81d9da3cd0_300x163.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Sn9U!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07a2e31e-690f-4e08-a79a-7b81d9da3cd0_300x163.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Sn9U!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07a2e31e-690f-4e08-a79a-7b81d9da3cd0_300x163.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Sn9U!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07a2e31e-690f-4e08-a79a-7b81d9da3cd0_300x163.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br>Outbound traffic means traffic going out from the instance to a specific destination. Let&#8217;s take a look at the <strong>Outbound</strong> tab. By default, a new SG will permit any traffic going outbound from the instance (1). If you are in a need to prevent outbound traffic, except for specific ports or protocols, delete the &#8220;any&#8221; rule and add your own rules. In order to finish and create the SG just press on <strong>Create</strong> (2):<br></p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!aMJO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2c71541-a58c-4472-a7cb-68db2f70f53a_300x163.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!aMJO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2c71541-a58c-4472-a7cb-68db2f70f53a_300x163.jpeg 424w, https://substackcdn.com/image/fetch/$s_!aMJO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2c71541-a58c-4472-a7cb-68db2f70f53a_300x163.jpeg 848w, https://substackcdn.com/image/fetch/$s_!aMJO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2c71541-a58c-4472-a7cb-68db2f70f53a_300x163.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!aMJO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2c71541-a58c-4472-a7cb-68db2f70f53a_300x163.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!aMJO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2c71541-a58c-4472-a7cb-68db2f70f53a_300x163.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e2c71541-a58c-4472-a7cb-68db2f70f53a_300x163.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;SG-Image 16&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="SG-Image 16" title="SG-Image 16" srcset="https://substackcdn.com/image/fetch/$s_!aMJO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2c71541-a58c-4472-a7cb-68db2f70f53a_300x163.jpeg 424w, https://substackcdn.com/image/fetch/$s_!aMJO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2c71541-a58c-4472-a7cb-68db2f70f53a_300x163.jpeg 848w, https://substackcdn.com/image/fetch/$s_!aMJO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2c71541-a58c-4472-a7cb-68db2f70f53a_300x163.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!aMJO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2c71541-a58c-4472-a7cb-68db2f70f53a_300x163.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br>The most important point to note here is that SG is instance specific. You associate an SG to an instance or to a group of instances, but not to a subnet or a VPC altogether.<br>If you ever worked with ACL on a firewall before, then you may be asking yourself a few questions &#8211; What is the order at which the SG inbound and outbound rules are evaluated, does the SG uses stateful or stateless filtering and where are my deny rules?<br>In an ACL (and, as we shell see, with AWS ACL also) each rule is numbered. When a <a href="https://en.wikipedia.org/wiki/Network_packet">packet </a>arrives at the firewall, it gets evaluated against the rules of the ACL starting with the rule with the lowest number. When a match is found, the rule is enforced and the packet is permitted or dropped. The rules with higher numbering than the matched rule are not evaluated. If the packet doesn&#8217;t match a rule, the next rule with a higher number is evaluated and so forth.<br>Security Groups operate in a different way. As we saw, there are no numbers to the SG rules. The rules are evaluated as a whole, no rule has precedence over other rules.<br>When an EC2 instance initiates a connection to some server, its outbound traffic will be evaluated against the outbound SG rules. If the rules permit it, the traffic will flow to the destination. But what happens when the remote server response? &nbsp;The inbound traffic should be evaluated against the inbound SG rules, but the remote server IP address and port are not always known beforehand. If we don&#8217;t know the remote server IP address and port, how can we create the proper inbound rules?&nbsp; The answer is that we don&#8217;t need to.<br>Security Groups implement <a href="https://en.wikipedia.org/?title=Stateful_firewall">stateful filtering</a>. With stateful filtering, the inbound traffic originating from the remote server, as a result of the new connection initiated by our EC2 instance, will be automatically permitted even though there are no specific inbound rules.&nbsp; In the same manner, for a connection initiated from a remote server, if the inbound traffic is permitted to pass to our EC2 instance, the outbound traffic from our EC2 instance will be automatically permitted even though there are no specific outbound rules. As we shall see, ACL are using stateless filtering.<br>And no, there are no deny rules when using SG, only permit ones. All traffic flowing inbound or outbound should much to the evaluated SG rules or it will be dropped.&nbsp; With most cases, it is enough, though it can be painful at times. For example, imagine you want to permit all traffic from a specific location except from a specific protocol. In contrast, ACL have allowed and deny rules.<br>Any EC2 instance that is launched must have at least one SG associated to it. For each VPC you create, a default SG will be created for you. Let&#8217;s take a look at the default SG created for our VPC:<br></p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Ne0E!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9509f088-80d6-4766-a32a-00d06270d315_300x102.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Ne0E!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9509f088-80d6-4766-a32a-00d06270d315_300x102.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Ne0E!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9509f088-80d6-4766-a32a-00d06270d315_300x102.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Ne0E!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9509f088-80d6-4766-a32a-00d06270d315_300x102.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Ne0E!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9509f088-80d6-4766-a32a-00d06270d315_300x102.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Ne0E!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9509f088-80d6-4766-a32a-00d06270d315_300x102.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9509f088-80d6-4766-a32a-00d06270d315_300x102.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;SG-Image 17&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="SG-Image 17" title="SG-Image 17" srcset="https://substackcdn.com/image/fetch/$s_!Ne0E!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9509f088-80d6-4766-a32a-00d06270d315_300x102.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Ne0E!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9509f088-80d6-4766-a32a-00d06270d315_300x102.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Ne0E!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9509f088-80d6-4766-a32a-00d06270d315_300x102.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Ne0E!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9509f088-80d6-4766-a32a-00d06270d315_300x102.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br>The <strong>Group ID</strong> of the SG is <strong>sg-dd3900b8</strong> (1) and the <strong>Description </strong>states &#8220;default VPC security group&#8221; (2). Take a look at the <strong>Inbound Rules</strong> (3). The only rule that is specified permits all traffic from sg-dd3900b8. But wait, this is the ID of this SG. This is an example of a very handy feature. This specific rule will permit any traffic between any two EC2 instances which are associated with this SG. Therefore, the VPC&#8217;s default SG permits any traffic between any instances launched into the VPC that were associated to the default SG.<br></p><h1>Secure Those Subnets!</h1><p> Let&#8217;s take a look at the <strong>Network ACL</strong> (1) of our Test subnet:<br>This ACL has <strong>Inbound</strong> (2) and <strong>Outbound</strong> rules (3). Both the inbound and outbound rules are the same, they both permit any traffic from any source (rule number 100) and have an implicit &#8220;deny all&#8221; at the end (the rule marked with an asterisk, will get back to it later). I don&#8217;t remember creating this ACL when creating the subnet, so where did it come from?<br>When you create a new Subnet, a default ACL will be associated with the subnet. The ACL that we saw in the previous image is an example of a default ACL that was associated with our Test subnet.<br>Default ACL have no restriction on the inbound and outbound traffic so you can keep using SG without even knowing of ACL existence. On the other hand, a default SG will permit inbound traffic only from within the VPC and drop any other traffic. Both default SG and ACL permit any traffic in the outbound direction.<br>This brings us to an important difference between ACL and SG, the scope of there influence. As we saw, an SG is associated to an EC2 instance and defines the allowed inbound and outbound traffic for that instance. An ACL, on the other hand, is associated with a subnet. A subnet can host one or more EC2 instances, and all of them will be affected by the inbound and outbound rules defined in the ACL of that subnet. For example, if we should create an ACL inbound rule that blocks SSH traffic from a specific IP address. All the EC2 instances on the subnet associated with that ACL will be blocked for SSH access from that specific IP address.<br>To create a new ACL, go to the VPC Dashboard, press on <strong>Network ACLs</strong> (1) and then on <strong>Create Network ACL</strong> (2):<br></p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tA7-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe45b3c63-df39-4de4-9a03-66ad4c79b718_300x104.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tA7-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe45b3c63-df39-4de4-9a03-66ad4c79b718_300x104.jpeg 424w, https://substackcdn.com/image/fetch/$s_!tA7-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe45b3c63-df39-4de4-9a03-66ad4c79b718_300x104.jpeg 848w, https://substackcdn.com/image/fetch/$s_!tA7-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe45b3c63-df39-4de4-9a03-66ad4c79b718_300x104.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!tA7-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe45b3c63-df39-4de4-9a03-66ad4c79b718_300x104.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tA7-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe45b3c63-df39-4de4-9a03-66ad4c79b718_300x104.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e45b3c63-df39-4de4-9a03-66ad4c79b718_300x104.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;SG-Image 19&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="SG-Image 19" title="SG-Image 19" srcset="https://substackcdn.com/image/fetch/$s_!tA7-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe45b3c63-df39-4de4-9a03-66ad4c79b718_300x104.jpeg 424w, https://substackcdn.com/image/fetch/$s_!tA7-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe45b3c63-df39-4de4-9a03-66ad4c79b718_300x104.jpeg 848w, https://substackcdn.com/image/fetch/$s_!tA7-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe45b3c63-df39-4de4-9a03-66ad4c79b718_300x104.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!tA7-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe45b3c63-df39-4de4-9a03-66ad4c79b718_300x104.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br>In the popup window, set a <strong>Name tag</strong> (1) for the ACL, select the relevant <strong>VPC</strong> (2) and press on <strong>Yes, Create</strong> (3):<br></p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!xYJA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15fee16c-965f-4198-af8e-a3b480e61637_300x118.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!xYJA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15fee16c-965f-4198-af8e-a3b480e61637_300x118.jpeg 424w, https://substackcdn.com/image/fetch/$s_!xYJA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15fee16c-965f-4198-af8e-a3b480e61637_300x118.jpeg 848w, https://substackcdn.com/image/fetch/$s_!xYJA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15fee16c-965f-4198-af8e-a3b480e61637_300x118.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!xYJA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15fee16c-965f-4198-af8e-a3b480e61637_300x118.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!xYJA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15fee16c-965f-4198-af8e-a3b480e61637_300x118.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/15fee16c-965f-4198-af8e-a3b480e61637_300x118.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;SG-Image 20&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="SG-Image 20" title="SG-Image 20" srcset="https://substackcdn.com/image/fetch/$s_!xYJA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15fee16c-965f-4198-af8e-a3b480e61637_300x118.jpeg 424w, https://substackcdn.com/image/fetch/$s_!xYJA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15fee16c-965f-4198-af8e-a3b480e61637_300x118.jpeg 848w, https://substackcdn.com/image/fetch/$s_!xYJA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15fee16c-965f-4198-af8e-a3b480e61637_300x118.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!xYJA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15fee16c-965f-4198-af8e-a3b480e61637_300x118.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br>If we will look at the <strong>Inbound Rules</strong> (1) of the new ACL, we will see that all inbound traffic is blocked (2):<br></p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!uNQ1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd40ce088-abb1-44e2-b609-22ffd4abc2fc_300x100.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!uNQ1!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd40ce088-abb1-44e2-b609-22ffd4abc2fc_300x100.jpeg 424w, https://substackcdn.com/image/fetch/$s_!uNQ1!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd40ce088-abb1-44e2-b609-22ffd4abc2fc_300x100.jpeg 848w, https://substackcdn.com/image/fetch/$s_!uNQ1!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd40ce088-abb1-44e2-b609-22ffd4abc2fc_300x100.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!uNQ1!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd40ce088-abb1-44e2-b609-22ffd4abc2fc_300x100.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!uNQ1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd40ce088-abb1-44e2-b609-22ffd4abc2fc_300x100.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d40ce088-abb1-44e2-b609-22ffd4abc2fc_300x100.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;M1-SG-Image 21&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="M1-SG-Image 21" title="M1-SG-Image 21" srcset="https://substackcdn.com/image/fetch/$s_!uNQ1!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd40ce088-abb1-44e2-b609-22ffd4abc2fc_300x100.jpeg 424w, https://substackcdn.com/image/fetch/$s_!uNQ1!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd40ce088-abb1-44e2-b609-22ffd4abc2fc_300x100.jpeg 848w, https://substackcdn.com/image/fetch/$s_!uNQ1!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd40ce088-abb1-44e2-b609-22ffd4abc2fc_300x100.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!uNQ1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd40ce088-abb1-44e2-b609-22ffd4abc2fc_300x100.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br>The same goes with the <strong>Outbound Rules</strong> (1) where all the outbound traffic is blocked as well (2):<br></p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!SZtb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff94caf24-4d8e-4d37-88ae-f53b992f49bc_300x99.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!SZtb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff94caf24-4d8e-4d37-88ae-f53b992f49bc_300x99.jpeg 424w, https://substackcdn.com/image/fetch/$s_!SZtb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff94caf24-4d8e-4d37-88ae-f53b992f49bc_300x99.jpeg 848w, https://substackcdn.com/image/fetch/$s_!SZtb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff94caf24-4d8e-4d37-88ae-f53b992f49bc_300x99.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!SZtb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff94caf24-4d8e-4d37-88ae-f53b992f49bc_300x99.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!SZtb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff94caf24-4d8e-4d37-88ae-f53b992f49bc_300x99.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f94caf24-4d8e-4d37-88ae-f53b992f49bc_300x99.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;M1-SG-Image 22&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="M1-SG-Image 22" title="M1-SG-Image 22" srcset="https://substackcdn.com/image/fetch/$s_!SZtb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff94caf24-4d8e-4d37-88ae-f53b992f49bc_300x99.jpeg 424w, https://substackcdn.com/image/fetch/$s_!SZtb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff94caf24-4d8e-4d37-88ae-f53b992f49bc_300x99.jpeg 848w, https://substackcdn.com/image/fetch/$s_!SZtb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff94caf24-4d8e-4d37-88ae-f53b992f49bc_300x99.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!SZtb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff94caf24-4d8e-4d37-88ae-f53b992f49bc_300x99.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br>As with a new SG, a new ACL will also block inbound traffic by default. However, while a new SG permits any outbound traffic, a new ACL blocks it by default.<br>Now, let&#8217;s add an inbound ACL rule which will permit SSH access from the 1.2.3.4 IP address. On the VPC Dashboard select <strong>Network ACLs</strong> (1) find the relevant ACL (2), select the <strong>Inbound Rules</strong> tab (3) and press on <strong>Edit</strong> (4):<br></p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!n9sB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff0ac247f-8a43-4c91-a49c-6adf93374c07_300x100.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!n9sB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff0ac247f-8a43-4c91-a49c-6adf93374c07_300x100.jpeg 424w, https://substackcdn.com/image/fetch/$s_!n9sB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff0ac247f-8a43-4c91-a49c-6adf93374c07_300x100.jpeg 848w, https://substackcdn.com/image/fetch/$s_!n9sB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff0ac247f-8a43-4c91-a49c-6adf93374c07_300x100.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!n9sB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff0ac247f-8a43-4c91-a49c-6adf93374c07_300x100.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!n9sB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff0ac247f-8a43-4c91-a49c-6adf93374c07_300x100.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f0ac247f-8a43-4c91-a49c-6adf93374c07_300x100.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;M1-SG-Image 23&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="M1-SG-Image 23" title="M1-SG-Image 23" srcset="https://substackcdn.com/image/fetch/$s_!n9sB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff0ac247f-8a43-4c91-a49c-6adf93374c07_300x100.jpeg 424w, https://substackcdn.com/image/fetch/$s_!n9sB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff0ac247f-8a43-4c91-a49c-6adf93374c07_300x100.jpeg 848w, https://substackcdn.com/image/fetch/$s_!n9sB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff0ac247f-8a43-4c91-a49c-6adf93374c07_300x100.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!n9sB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff0ac247f-8a43-4c91-a49c-6adf93374c07_300x100.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br>I have set the rule number to 100 (1), the protocol to SSH (2), which automatically have set the protocol to TCP and the port range to 22 (3). I have set the IP address to 1.2.3.4/32 (4, the &#8220;/32&#8221; notation means that it is a host IP address) and allowed the access (5). To finish press on <strong>Save</strong> (6):<br></p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!JEP7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F555d3490-17ac-4f52-b3ff-5198ffc609e6_300x98.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JEP7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F555d3490-17ac-4f52-b3ff-5198ffc609e6_300x98.jpeg 424w, https://substackcdn.com/image/fetch/$s_!JEP7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F555d3490-17ac-4f52-b3ff-5198ffc609e6_300x98.jpeg 848w, https://substackcdn.com/image/fetch/$s_!JEP7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F555d3490-17ac-4f52-b3ff-5198ffc609e6_300x98.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!JEP7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F555d3490-17ac-4f52-b3ff-5198ffc609e6_300x98.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JEP7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F555d3490-17ac-4f52-b3ff-5198ffc609e6_300x98.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/555d3490-17ac-4f52-b3ff-5198ffc609e6_300x98.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;M1-SG-Image 24&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="M1-SG-Image 24" title="M1-SG-Image 24" srcset="https://substackcdn.com/image/fetch/$s_!JEP7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F555d3490-17ac-4f52-b3ff-5198ffc609e6_300x98.jpeg 424w, https://substackcdn.com/image/fetch/$s_!JEP7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F555d3490-17ac-4f52-b3ff-5198ffc609e6_300x98.jpeg 848w, https://substackcdn.com/image/fetch/$s_!JEP7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F555d3490-17ac-4f52-b3ff-5198ffc609e6_300x98.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!JEP7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F555d3490-17ac-4f52-b3ff-5198ffc609e6_300x98.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br>The updated ACL now has two rules. The first rule numbered 100 is the rule we just created (1). The second rule, marked with an asterisk, is the implicit &#8220;deny all&#8221; rule (2):<br></p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!P_gr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77705f89-1f09-4e24-b86d-ed4103967705_300x99.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!P_gr!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77705f89-1f09-4e24-b86d-ed4103967705_300x99.jpeg 424w, https://substackcdn.com/image/fetch/$s_!P_gr!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77705f89-1f09-4e24-b86d-ed4103967705_300x99.jpeg 848w, https://substackcdn.com/image/fetch/$s_!P_gr!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77705f89-1f09-4e24-b86d-ed4103967705_300x99.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!P_gr!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77705f89-1f09-4e24-b86d-ed4103967705_300x99.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!P_gr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77705f89-1f09-4e24-b86d-ed4103967705_300x99.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/77705f89-1f09-4e24-b86d-ed4103967705_300x99.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;M1-SG-Image 25&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="M1-SG-Image 25" title="M1-SG-Image 25" srcset="https://substackcdn.com/image/fetch/$s_!P_gr!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77705f89-1f09-4e24-b86d-ed4103967705_300x99.jpeg 424w, https://substackcdn.com/image/fetch/$s_!P_gr!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77705f89-1f09-4e24-b86d-ed4103967705_300x99.jpeg 848w, https://substackcdn.com/image/fetch/$s_!P_gr!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77705f89-1f09-4e24-b86d-ed4103967705_300x99.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!P_gr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77705f89-1f09-4e24-b86d-ed4103967705_300x99.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br>The implicit &#8220;deny all&#8221; rule will always be evaluated last. As was stated before, any packet arriving inbound or outbound will be evaluated against the relevant ACL rules. In the end, if the packet does not match any of the rules, it will hit the implicit &#8220;deny all&#8221; rule and will be dropped. This ensures that only packets with a perfect match to an ACL rule (like a specific source IP address) will be permitted to pass.<br>Presume that we have launched a new EC2 instance to a subnet associated with our new ACL, gave it a public IP address, and configure an SG which would allow access to the instance on the SSH protocol from the 1.2.3.4 IP address. Now, will a client with an IP address of 1.2.3.4 would be able to connect to the SSH port? The answer is no. To understand why we need to look at the <strong>Outbound rules</strong> (1) of our Test ACL. The only rule there is the implicit &#8220;deny all&#8221; rule (2):<br></p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cnTW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a82660e-b03b-43cc-90c0-6affd118fa4f_300x100.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cnTW!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a82660e-b03b-43cc-90c0-6affd118fa4f_300x100.jpeg 424w, https://substackcdn.com/image/fetch/$s_!cnTW!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a82660e-b03b-43cc-90c0-6affd118fa4f_300x100.jpeg 848w, https://substackcdn.com/image/fetch/$s_!cnTW!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a82660e-b03b-43cc-90c0-6affd118fa4f_300x100.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!cnTW!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a82660e-b03b-43cc-90c0-6affd118fa4f_300x100.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cnTW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a82660e-b03b-43cc-90c0-6affd118fa4f_300x100.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4a82660e-b03b-43cc-90c0-6affd118fa4f_300x100.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;M1-SG-Image 26&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="M1-SG-Image 26" title="M1-SG-Image 26" srcset="https://substackcdn.com/image/fetch/$s_!cnTW!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a82660e-b03b-43cc-90c0-6affd118fa4f_300x100.jpeg 424w, https://substackcdn.com/image/fetch/$s_!cnTW!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a82660e-b03b-43cc-90c0-6affd118fa4f_300x100.jpeg 848w, https://substackcdn.com/image/fetch/$s_!cnTW!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a82660e-b03b-43cc-90c0-6affd118fa4f_300x100.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!cnTW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a82660e-b03b-43cc-90c0-6affd118fa4f_300x100.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br>The SSH connection will not work because ACL use stateless filtering. The inbound traffic from the remote server, accessing the EC2 instance on port 22/TCP, will get through because both the subnet ACL and the instance SG will permit it to pass. However, when the instance will try to respond, the SG will let the traffic pass, because it uses stateful filtering, but the ACL will drop the traffic because it uses stateless filtering and has no outbound rules for the remote server. To mitigate this problem we can add an outbound rule. I have added a custom outbound TCP rule number 100 (1) which allows a range of TCP ports (2) to the 1.2.3.4 IP address:<br></p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!IjVl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f525488-8d08-4db6-a7d9-c8453c983707_300x99.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!IjVl!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f525488-8d08-4db6-a7d9-c8453c983707_300x99.jpeg 424w, https://substackcdn.com/image/fetch/$s_!IjVl!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f525488-8d08-4db6-a7d9-c8453c983707_300x99.jpeg 848w, https://substackcdn.com/image/fetch/$s_!IjVl!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f525488-8d08-4db6-a7d9-c8453c983707_300x99.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!IjVl!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f525488-8d08-4db6-a7d9-c8453c983707_300x99.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!IjVl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f525488-8d08-4db6-a7d9-c8453c983707_300x99.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8f525488-8d08-4db6-a7d9-c8453c983707_300x99.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;M1-SG-Image 27&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="M1-SG-Image 27" title="M1-SG-Image 27" srcset="https://substackcdn.com/image/fetch/$s_!IjVl!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f525488-8d08-4db6-a7d9-c8453c983707_300x99.jpeg 424w, https://substackcdn.com/image/fetch/$s_!IjVl!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f525488-8d08-4db6-a7d9-c8453c983707_300x99.jpeg 848w, https://substackcdn.com/image/fetch/$s_!IjVl!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f525488-8d08-4db6-a7d9-c8453c983707_300x99.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!IjVl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f525488-8d08-4db6-a7d9-c8453c983707_300x99.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br>So, why allow outbound traffic to a range of TCP ports and not to a specific port like we did with the inbound rule? To answer this question we need to understand the concept of <a href="https://en.wikipedia.org/wiki/Ephemeral_port">ephemeral</a> and <a href="https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers#Well-known_ports">well-known ports</a>.<br>When a client initiates a connection to a server he needs to know the destination server IP address and port number (let&#8217;s use HTTP port 80 as an example). With these two parameters, the client will create a pair of <a href="https://en.wikipedia.org/wiki/Network_socket#Socket_types">TCP sockets</a>. One TCP socket will be <em>Server-IP-Address: TCP-Port</em>, or in our example, <em>Server-IP-Address:80</em>. The second TCP socket will be the <em>Client-IP-Address: Ephemeral-Port</em>. The client shares these two sockets with the server (via the IP and TCP headers).<br>The Server&#8217;s TCP port (80 in our example) is the well-known port for the HTTP protocol. The well-known ports range from 0 to 1023 and are associated with well-known protocols (22 for SSH, 443 for HTTPS). When the client knows that it need to access the HTTP protocol on the remote server he will use port 80/TCP by default. For that reason, we can always open specific port numbers inbound to a server when we know exactly which services are running on that server (this is what we did with port 22/TCP when we configured the inbound rules for the Test ACL).<br>But why does the client needs a port number? The traffic from the server reaches the client because the client had given the server its IP address. The packets arriving at the client must be directed to the correct application that initiated the connection. This is done by associated the port number to that application (just like associating port 22 to the SSH service on the server). Moreover, this enables both the client and the server to have multiple connections with the same well-known port.<br>When the client initiates the connection, he chooses a random port number from a range of ports named ephemeral ports and creates the socket. They are called ephemeral or dynamic ports because whenever the connection is terminated they are released, and can be reused for other connections afterwords. Linux kernels usually use the port range 32768-61000. This exact port range was used for the outbound rule configured for our Test ACL.<br>In situations where we do not know the client IP address beforehand (like for a web server on the Internet), we will need to create an ACL outbound rule that will permit the ephemeral port range to any IP address (1):<br></p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!bgh5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68ac6f78-5322-46a9-9c5a-0644ed25137f_300x99.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!bgh5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68ac6f78-5322-46a9-9c5a-0644ed25137f_300x99.jpeg 424w, https://substackcdn.com/image/fetch/$s_!bgh5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68ac6f78-5322-46a9-9c5a-0644ed25137f_300x99.jpeg 848w, https://substackcdn.com/image/fetch/$s_!bgh5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68ac6f78-5322-46a9-9c5a-0644ed25137f_300x99.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!bgh5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68ac6f78-5322-46a9-9c5a-0644ed25137f_300x99.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!bgh5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68ac6f78-5322-46a9-9c5a-0644ed25137f_300x99.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/68ac6f78-5322-46a9-9c5a-0644ed25137f_300x99.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;M1-SG-Image 28&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="M1-SG-Image 28" title="M1-SG-Image 28" srcset="https://substackcdn.com/image/fetch/$s_!bgh5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68ac6f78-5322-46a9-9c5a-0644ed25137f_300x99.jpeg 424w, https://substackcdn.com/image/fetch/$s_!bgh5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68ac6f78-5322-46a9-9c5a-0644ed25137f_300x99.jpeg 848w, https://substackcdn.com/image/fetch/$s_!bgh5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68ac6f78-5322-46a9-9c5a-0644ed25137f_300x99.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!bgh5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68ac6f78-5322-46a9-9c5a-0644ed25137f_300x99.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br>One last thing left to do is to associate our Test ACL with the Test Subnet. Open the VPC Dashboard, select <strong>Subnets</strong> (1) and search for the subnet (2). Select the subnet and press on <strong>Edit</strong> (3):<br></p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ArCz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0240e3c8-8567-4939-a848-5621df03a94a_300x128.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ArCz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0240e3c8-8567-4939-a848-5621df03a94a_300x128.jpeg 424w, https://substackcdn.com/image/fetch/$s_!ArCz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0240e3c8-8567-4939-a848-5621df03a94a_300x128.jpeg 848w, https://substackcdn.com/image/fetch/$s_!ArCz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0240e3c8-8567-4939-a848-5621df03a94a_300x128.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!ArCz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0240e3c8-8567-4939-a848-5621df03a94a_300x128.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ArCz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0240e3c8-8567-4939-a848-5621df03a94a_300x128.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0240e3c8-8567-4939-a848-5621df03a94a_300x128.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;M1-SG-Image 29&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="M1-SG-Image 29" title="M1-SG-Image 29" srcset="https://substackcdn.com/image/fetch/$s_!ArCz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0240e3c8-8567-4939-a848-5621df03a94a_300x128.jpeg 424w, https://substackcdn.com/image/fetch/$s_!ArCz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0240e3c8-8567-4939-a848-5621df03a94a_300x128.jpeg 848w, https://substackcdn.com/image/fetch/$s_!ArCz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0240e3c8-8567-4939-a848-5621df03a94a_300x128.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!ArCz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0240e3c8-8567-4939-a848-5621df03a94a_300x128.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br>In the <strong>Change to</strong> a drop-down box (1) select the Test ACL and press on <strong>Save</strong> (2):<br></p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!pK8R!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabc03b3c-833d-4447-87e3-5da875e54490_300x126.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!pK8R!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabc03b3c-833d-4447-87e3-5da875e54490_300x126.jpeg 424w, https://substackcdn.com/image/fetch/$s_!pK8R!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabc03b3c-833d-4447-87e3-5da875e54490_300x126.jpeg 848w, https://substackcdn.com/image/fetch/$s_!pK8R!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabc03b3c-833d-4447-87e3-5da875e54490_300x126.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!pK8R!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabc03b3c-833d-4447-87e3-5da875e54490_300x126.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!pK8R!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabc03b3c-833d-4447-87e3-5da875e54490_300x126.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/abc03b3c-833d-4447-87e3-5da875e54490_300x126.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;M1-SG-Image 30&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="M1-SG-Image 30" title="M1-SG-Image 30" srcset="https://substackcdn.com/image/fetch/$s_!pK8R!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabc03b3c-833d-4447-87e3-5da875e54490_300x126.jpeg 424w, https://substackcdn.com/image/fetch/$s_!pK8R!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabc03b3c-833d-4447-87e3-5da875e54490_300x126.jpeg 848w, https://substackcdn.com/image/fetch/$s_!pK8R!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabc03b3c-833d-4447-87e3-5da875e54490_300x126.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!pK8R!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabc03b3c-833d-4447-87e3-5da875e54490_300x126.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><h1>What is more secured?</h1><p> Basically, ACL and SG do the same thing, they filter traffic. ACL adds a level of security by ensuring that each EC2 instance launched into the associated subnet is enforced by the rules specified in the ACL, even if the right SG where not configured. On the other hand, because of their stateless nature, there are more difficult to configure at times.<br><br>I usually use SG for the less secure, mostly internet facing instances. ACL are used for a very secure instance, like databases, where I want another layer of security and the clients accessing these instances are well known.</p>]]></content:encoded></item><item><title><![CDATA[How can I resolve Route 53 private hosted zones from an on-premises network via an Ubuntu instance?]]></title><description><![CDATA[Issue How can I resolve Amazon Route 53 private hosted zones from an on-premises network via an Ubuntu instance?]]></description><link>https://www.groktechie.com/p/how-can-i-resolve-route-53-private</link><guid isPermaLink="false">https://www.groktechie.com/p/how-can-i-resolve-route-53-private</guid><dc:creator><![CDATA[Shashank Singh]]></dc:creator><pubDate>Sat, 01 Apr 2017 08:08:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!8elZ!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb283d56-89f1-4849-bcd6-3d965c6f4830_1024x1024.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3><a href="https://www.blogger.com/null">&nbsp;Issue</a></h3><p> &nbsp;How can I resolve Amazon Route 53 private hosted zones from an on-premises network via an &nbsp;Ubuntu instance?<br><br></p><h3><a href="https://www.blogger.com/null">&nbsp;Resolution</a></h3><p> You can resolve domain names in private hosted zones from your on-premises network by configuring a DNS forwarder. The following instructions assume that your on-premises network is configured with a VPN or AWS Direct Connect to an AWS VPC, and a Route 53 private hosted zone is associated with that VPC.<br><br>Configure a DNS forwarder by completing the following steps:<br><br>1.&nbsp;&nbsp;&nbsp; <a href="http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-dns.html#vpc-dns-updating">Ensure that DNS resolution and DNS hostnames are enabled on the target VPC</a>.<br><strong>Note:</strong> DNS hostnames are enabled for default VPCs and VPCs that you create using the VPC wizard in the Amazon VPC console.<br><br>2.&nbsp;&nbsp;&nbsp; Install BIND DNS server on your instance by using the following command:<br></p><pre><code>      sudo apt-get install bind9 bind9utils bind9-doc</code></pre><p> 3.&nbsp;&nbsp;&nbsp; Configure the BIND server in a forward-only configuration by modifying the named.conf.options file. By default, BIND configuration files are kept at /etc/bind.<br><br>a.&nbsp;&nbsp;&nbsp; Create an access control list (ACL) for the BIND server, replacing the IP address in the following example with a list of IP addresses you trust:<br></p><pre><code>    acl "trusted" {

  &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 172.16.0.0/16

  &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; localhost;

  &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; localnets;

  };


</code></pre><p> b.&nbsp;&nbsp;&nbsp; Configure BIND to forward all DNS requests to the Amazon VPC name server. The VPC name server is always the second available address in the VPC. For example, if the VPC CIDR is 10.10.0.0/16, then the VPC name server has the IP address of 10.10.0.2, as in the following example:<br><br></p><pre><code>options {

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; directory "/var/cache/bind";

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; recursion yes;

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; allow-query { trusted; };

&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; forwarders {

 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 10.10.0.2;

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; };



&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; forward only;

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dnssec-enable no;

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dnssec-validation no;

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dnssec-lookaside auto;

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; auth-nxdomain no;

 &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; listen-on-v6 { any; };

};

</code></pre><p><strong>Note:</strong> In the above example, DNSSEC is disabled, because Route 53 does not support DNSSEC at this time.<br><br>4.&nbsp;&nbsp;&nbsp;&nbsp;Test the syntax and restart the service by using the following commands:<br></p><pre><code>    sudo named-checkconf 

    sudo service bind9 restart</code></pre><p><strong>Note:</strong> Ensure you have port 53 TCP/UDP open to the on-premises network in your DNS server&#8217;s security group.<br>Configure your clients to use the BIND DNS server to resolve DNS. For instructions, check the documentation for your client&#8217;s operating system.<br></p><h3><a href="https://www.blogger.com/null">Keywords</a></h3><p> private hosted zone, name resolution, BIND, DNS forwarder<br><br></p><h3><a href="https://www.blogger.com/null">Related Information</a></h3><p><a href="http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-dns.html">Using DNS with Your VPC</a><br><a href="http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/hosted-zone-private-creating.html">Creating a Private Hosted Zone</a><br></p>]]></content:encoded></item><item><title><![CDATA[Thursday March 30, 2017]]></title><description><![CDATA[Swap space are useful for systems having less memory (RAM).]]></description><link>https://www.groktechie.com/p/swap-space-are-useful-for-systems</link><guid isPermaLink="false">https://www.groktechie.com/p/swap-space-are-useful-for-systems</guid><dc:creator><![CDATA[Shashank Singh]]></dc:creator><pubDate>Thu, 30 Mar 2017 16:41:00 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/88448300-cccd-4f63-ba5e-b84caf032b87_15x15.gif" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Swap space are useful for systems having less memory (RAM). If your system facing problem of lack of memory continuously and you don&#8217;t want to increase memory on server, Then it can be helpful to enable swap in your system. Swap is comparatively much slower than physical memory but operating system uses swap space in case system goes out of memory. To know more about working of swap visit here.</p><p>This article will help you to enable swap filesystem in your running instance. There are two methods to add swap in Amazon ec2 linux instances. This article has been tested with CentOS 6.5 only, but it can work on most of Linux distributions</p><p><strong>Method 1: By Creating File in Current File System</strong></p><p> This option is helpful if we don&#8217;t want to add extra disks in our systems, In this we simply create a file in our current file system and make it type swap, which can be used as swap in our system. Use following commands to create and enable swap on our system.</p><pre><code># dd if=/dev/zero of=/var/myswap bs=1M count=2048
# mkswap /var/myswap
# swapon /var/myswap
</code></pre><p><strong>bs=1M count=2048</strong>&nbsp;means it will create 2GB of swap file, You may change as per you need. After enabling swap we can see that our system has swap enabled by running &#8220;<strong>free -m</strong>&#8221; command.</p><p> To make it enable on system boot, simply edit&nbsp;<strong>/etc/fstab</strong>&nbsp;file and add following entry at end of file.</p><pre><code>/var/myswap   swap   swap   defaults  0 0
</code></pre><h2><strong>Method 2: By Adding new Disk in System</strong></h2><p> This option is helpful if you do not have enough space in our current drives mounted in system. In this option, first we need to add extra disk in our system first. In my case new disk mounted as&nbsp;<strong>/dev/xvdd</strong>&nbsp;(It may change in your case)</p><pre><code># mkswap -f /dev/xvdd
# swapon /dev/xvdd
</code></pre><p> To make it enable on system boot, simply edit&nbsp;<strong>/etc/fstab</strong>&nbsp;file and add following entry at end of file.</p><pre><code>/dev/xvdd   swap   swap   defaults  0 0</code></pre><p>Hope this will help you!</p><p> Please Remember me in your prayers!</p><p><br>Enjoy&nbsp;</p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!7shR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3a482c2-8f72-4ab2-9cf4-38fca1bd0324_15x15.gif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7shR!,w_424,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3a482c2-8f72-4ab2-9cf4-38fca1bd0324_15x15.gif 424w, https://substackcdn.com/image/fetch/$s_!7shR!,w_848,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3a482c2-8f72-4ab2-9cf4-38fca1bd0324_15x15.gif 848w, https://substackcdn.com/image/fetch/$s_!7shR!,w_1272,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3a482c2-8f72-4ab2-9cf4-38fca1bd0324_15x15.gif 1272w, https://substackcdn.com/image/fetch/$s_!7shR!,w_1456,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3a482c2-8f72-4ab2-9cf4-38fca1bd0324_15x15.gif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7shR!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3a482c2-8f72-4ab2-9cf4-38fca1bd0324_15x15.gif" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e3a482c2-8f72-4ab2-9cf4-38fca1bd0324_15x15.gif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;:-)&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt=":-)" title=":-)" srcset="https://substackcdn.com/image/fetch/$s_!7shR!,w_424,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3a482c2-8f72-4ab2-9cf4-38fca1bd0324_15x15.gif 424w, https://substackcdn.com/image/fetch/$s_!7shR!,w_848,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3a482c2-8f72-4ab2-9cf4-38fca1bd0324_15x15.gif 848w, https://substackcdn.com/image/fetch/$s_!7shR!,w_1272,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3a482c2-8f72-4ab2-9cf4-38fca1bd0324_15x15.gif 1272w, https://substackcdn.com/image/fetch/$s_!7shR!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3a482c2-8f72-4ab2-9cf4-38fca1bd0324_15x15.gif 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a>]]></content:encoded></item><item><title><![CDATA[Resize Drive Problem in Centos6 on AWS EC2]]></title><description><![CDATA[To Resize the root partition in Centos 6 machine run the below mentioned Commands:]]></description><link>https://www.groktechie.com/p/resize-drive-problem-in-centos6-on-aws</link><guid isPermaLink="false">https://www.groktechie.com/p/resize-drive-problem-in-centos6-on-aws</guid><dc:creator><![CDATA[Shashank Singh]]></dc:creator><pubDate>Tue, 28 Mar 2017 08:47:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!8elZ!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb283d56-89f1-4849-bcd6-3d965c6f4830_1024x1024.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>To Resize the root partition in Centos 6 machine run the below mentioned Commands:<br><br> <br> <br></p><pre><code>1. Install EPEL6 Repo
~]# wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
    or </code></pre><pre><code>~]# wget  http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm</code></pre><pre><code>~]# rpm -ivh epel-release-6-8.noarch.rpm

2. Install the dracut &amp; cloud-utils growpart modules-growroot
~]# yum install -y dracut-modules-growroot cloud-utils-growpart</code></pre><pre><code>  or </code></pre><pre><code>~]# yum -y --quiet install dracut-modules-growroot
~]# dracut -v --force --add growroot /boot/initramfs-$(uname -r).img
~]# reboot
3. The initrd needs to be rebuilt after installing the dracut-modules-growroot.
Create a backup copy of the current initramfs:</code></pre><pre><code>~]# cp -p /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.bak

4. Create the initramfs for the current kernel:
~]# dracut -f

5. Result after reboot
~]# reboot</code></pre>]]></content:encoded></item><item><title><![CDATA[Automating Windows Server backups on Amazon S3 ]]></title><description><![CDATA[1: Create an Amazon AWS account]]></description><link>https://www.groktechie.com/p/automating-windows-server-backups-on</link><guid isPermaLink="false">https://www.groktechie.com/p/automating-windows-server-backups-on</guid><dc:creator><![CDATA[Shashank Singh]]></dc:creator><pubDate>Wed, 21 Dec 2016 06:14:00 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/f6218b90-0e52-4650-8f28-63fab4025bf8_15x15.gif" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>1: Create an Amazon AWS account<br><br> If you don't already have an AWS account - <a href="http://aws.amazon.com/s3/">create it here</a>, it's free. Amazon's "free usage tier" on S3 gives you 5GB free storage from scratch, so after registering, sign in to your "AWS Management Console", select the "S3" tab and create one or more "buckets".<br><br>2: Get your access keys<br><br> You will need security credentials to access your online storage from the server, so click your account name - "Security Credentials" - "Access Keys" and copy your Key ID and Secret.<br><br>3: Download "S3Sync"<br><br>"S3Sync" is a great free command-line application from SprightlySoft. It is .NET-based and even comes with the source codes. At the time of writing this post their website was down, so I published the tool on Google Docs here: <a href="https://sites.google.com/site/jitbit/files/S3Sync.zip?attredirects=0&amp;d=1">S3Sync.zip</a>.<br><br>The tool syncs a given folder with your S3 bucket. And the best part - unlike similar scripts and utilities it performs a "smart" differential sync that detects additions, deletions and file-modifications.<br></p><p> extract the S3Sync.zip folder to C drive.</p><p> Location of S3sync folder =&nbsp;<strong>C:\S3Sync</strong></p><p>4: Write a backup script<br><br>Create a batch file and paste this code into it:<br><br><strong>cd C:\S3Sync</strong><br><strong>S3Sync.exe -AWSAccessKeyId xxxxxxx -AWSSecretAccessKey xxxxxxx -SyncDirection upload -LocalFolderPath "C:\inetpub\wwwroot" -BucketName YOURBUCKETNAME</strong><br><br><br>The code above is pretty self-explanatory. Just replace the "<strong>xxxxxx</strong>" with your access codes from #2, "<strong>YOURBUCKETNAME</strong>" with the name of your S3 bucket, and "<strong>C:\inetpub\wwwroot</strong>" - with the <strong>folder you want to backup</strong>. Then create a scheduled task that runs the batch file every 24 hours, and you're all set.<br><br></p><p>Hope this will help you!</p><p><br>Please Remember me in your prayers!</p><p><br>Enjoy&nbsp;</p>]]></content:encoded></item><item><title><![CDATA[AWS CodeDeploy Using S3]]></title><description><![CDATA[AWS has great set of tools which helps simplify the deployment process in their cloud and one such tool is AWS CodeDeploy.]]></description><link>https://www.groktechie.com/p/aws-codedeploy-using-s3_20</link><guid isPermaLink="false">https://www.groktechie.com/p/aws-codedeploy-using-s3_20</guid><dc:creator><![CDATA[Shashank Singh]]></dc:creator><pubDate>Tue, 20 Dec 2016 10:50:00 GMT</pubDate><enclosure url="http://www.tothenew.com/blog/wp-content/uploads/2015/03/533x273xCode-Deploy.jpg.pagespeed.ic.iIapcxX49N.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>AWS has great set of tools which helps simplify the deployment process in their cloud and one such tool is AWS CodeDeploy. &nbsp;In this blog, we will deploy the application using AWS CodeDeploy using S3.</p><p> Consider a use case where you have 20 instances and you want to deploy your code or change the configuration file of these instances. The only solution would be to login into each particular instance and then changing the configuration file. AWS CodeDeploy lets you do this in just few steps . You just create a deploy application and your code will be deployed in all these 20 instances.</p><p><strong>Deploying code without using AWS CodeDeploy</strong></p><a class="image-link image2" target="_blank" href="http://www.tothenew.com/blog/wp-content/uploads/2015/03/533x273xCode-Deploy.jpg.pagespeed.ic.iIapcxX49N.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="http://www.tothenew.com/blog/wp-content/uploads/2015/03/533x273xCode-Deploy.jpg.pagespeed.ic.iIapcxX49N.webp 424w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/533x273xCode-Deploy.jpg.pagespeed.ic.iIapcxX49N.webp 848w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/533x273xCode-Deploy.jpg.pagespeed.ic.iIapcxX49N.webp 1272w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/533x273xCode-Deploy.jpg.pagespeed.ic.iIapcxX49N.webp 1456w" sizes="100vw"><img src="http://www.tothenew.com/blog/wp-content/uploads/2015/03/533x273xCode-Deploy.jpg.pagespeed.ic.iIapcxX49N.webp" data-attrs="{&quot;src&quot;:&quot;http://www.tothenew.com/blog/wp-content/uploads/2015/03/533x273xCode-Deploy.jpg.pagespeed.ic.iIapcxX49N.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Deploying code without using AWS CODE DEPLOY&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Deploying code without using AWS CODE DEPLOY" title="Deploying code without using AWS CODE DEPLOY" srcset="http://www.tothenew.com/blog/wp-content/uploads/2015/03/533x273xCode-Deploy.jpg.pagespeed.ic.iIapcxX49N.webp 424w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/533x273xCode-Deploy.jpg.pagespeed.ic.iIapcxX49N.webp 848w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/533x273xCode-Deploy.jpg.pagespeed.ic.iIapcxX49N.webp 1272w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/533x273xCode-Deploy.jpg.pagespeed.ic.iIapcxX49N.webp 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a><p><strong>Deploying code using AWS CodeDeploy</strong></p><a class="image-link image2" target="_blank" href="http://www.tothenew.com/blog/wp-content/uploads/2015/03/491x375xCode-Deploy-1.jpg.pagespeed.ic.RKWOrVCy6k.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="http://www.tothenew.com/blog/wp-content/uploads/2015/03/491x375xCode-Deploy-1.jpg.pagespeed.ic.RKWOrVCy6k.webp 424w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/491x375xCode-Deploy-1.jpg.pagespeed.ic.RKWOrVCy6k.webp 848w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/491x375xCode-Deploy-1.jpg.pagespeed.ic.RKWOrVCy6k.webp 1272w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/491x375xCode-Deploy-1.jpg.pagespeed.ic.RKWOrVCy6k.webp 1456w" sizes="100vw"><img src="http://www.tothenew.com/blog/wp-content/uploads/2015/03/491x375xCode-Deploy-1.jpg.pagespeed.ic.RKWOrVCy6k.webp" data-attrs="{&quot;src&quot;:&quot;http://www.tothenew.com/blog/wp-content/uploads/2015/03/491x375xCode-Deploy-1.jpg.pagespeed.ic.RKWOrVCy6k.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Deploying code using AWS CODE DEPLOY&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Deploying code using AWS CODE DEPLOY" title="Deploying code using AWS CODE DEPLOY" srcset="http://www.tothenew.com/blog/wp-content/uploads/2015/03/491x375xCode-Deploy-1.jpg.pagespeed.ic.RKWOrVCy6k.webp 424w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/491x375xCode-Deploy-1.jpg.pagespeed.ic.RKWOrVCy6k.webp 848w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/491x375xCode-Deploy-1.jpg.pagespeed.ic.RKWOrVCy6k.webp 1272w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/491x375xCode-Deploy-1.jpg.pagespeed.ic.RKWOrVCy6k.webp 1456w" sizes="100vw"></picture><div></div></div></a><p> There are two ways to deploy code in Amazon Web Services:-</p><ul><li><p>Using <strong>GIT&nbsp;</strong></p></li><li><p>Using <strong>AWS S3 (Simple Storage Service)</strong></p></li></ul><p> Here, we will deploy the code using Amazon S3 service. Let us also understand few useful terms which will be used in the deployment process:</p><ul><li><p><strong>AppSpec file:</strong>- It is an Application Specification file. It is a unique file that defines a series of deployment actions that you want CodeDeploy to execute.</p></li><li><p><strong>Deployment&nbsp;Application:</strong>- The unique name which will be given to your Deployment Application.</p></li><li><p><strong>Revision:</strong>- It is a combination of AppSpec file and other files such as scripts, images, index files, media etc.</p></li><li><p><strong>Deployment Group:</strong>- It is defined as a group of individual instances and auto-scaled instances.</p></li><li><p><strong>Deployment Configuration:</strong>- It lets you side that how you want your code to be deployed:- one at a time/ half at a time/ all at once.</p></li></ul><p>Deploying Code Using AWS S3</p><p> We&#8217;ll take a simple example to deploy the code using S3. We are deploying the code in a single instance and are launching a single t2.micro instance. Launch the instance and install nginx in it as we are going to change the front page or index.html of the nginx default configuration. You can install nginx by logging into the instance and typing the following commands:&nbsp;</p><p><strong>sudo apt-get update&nbsp;</strong></p><p><strong>sudo apt-get install nginx -y</strong></p><p>Now lets move towards Code Deploy into an instance</p><p> Before starting with CodeDeploy, we need to have :-</p><ul><li><p>Two <strong>IAM ROLES</strong> : one role will be given to EC2-instances to access s3 buckets and the other role is given to CodeDeploy service to choose Ec2-instances based on their tags.</p></li><li><p>One <strong>S3 bucket</strong> containing the appspec file, scripts and other files into a tar,gz or bz2 file (compressed format file). You need to store the compressed file into the S3 bucket. The files will automatically be uncompressed at the time of Deployment.</p></li></ul><p> IAM Role Given to AWS CodeDeploy to access your EC2-instance:</p><p> =======================================================================</p><p><strong>{</strong></p><p><strong>"Version": "2012-10-17",</strong></p><p><strong>&nbsp;"Statement": [</strong></p><p><strong>&nbsp; &nbsp; {</strong></p><p><strong>&nbsp; &nbsp; &nbsp; "Action": [</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"autoscaling:PutLifecycleHook",</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"autoscaling:DeleteLifecycleHook",</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"autoscaling:RecordLifecycleActionHeartbeat",</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"autoscaling:CompleteLifecycleAction",</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"autoscaling:DescribeAutoscalingGroups",</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"autoscaling:PutInstanceInStandby",</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"autoscaling:PutInstanceInService",</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"ec2:Describe*"</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;],</strong></p><p><strong>&nbsp; "Effect": "Allow",</strong></p><p><strong>&nbsp; "Resource": "*"</strong></p><p><strong>&nbsp; &nbsp; }</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;]</strong></p><p><strong>&nbsp;}</strong></p><p> =======================================================================</p><p> IAM Role Given to EC2-instances to access S3 Buckets</p><p> =======================================================================</p><p><strong>{</strong></p><p><strong>"Version": "2012-10-17",</strong></p><p><strong>"Statement":</strong></p><p><strong>&nbsp; &nbsp; &nbsp;[</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"Action":</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"s3:Get*",</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"s3:List*"</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;],</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"Effect": "Allow",</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"Resource": "*"</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</strong></p><p><strong>&nbsp; &nbsp; &nbsp;]</strong></p><p><strong>}</strong></p><p> =======================================================================</p><p>Trusted Relationship With AWS CodeDeploy IAM Role</p><p><strong>{</strong></p><p><strong>&#8220;Version&#8221;: &#8220;2012-10-17&#8243;,</strong></p><p><strong>&#8220;Statement&#8221;: [</strong></p><p><strong>&nbsp; &nbsp; {</strong></p><p><strong>&nbsp; &nbsp; &#8220;Sid&#8221;: &#8220;&#8221;,</strong></p><p><strong>&nbsp; &nbsp; &#8220;Effect&#8221;: &#8220;Allow&#8221;,</strong></p><p><strong>&nbsp; &nbsp; &#8220;Principal&#8221;: {</strong></p><p><strong>&nbsp; &nbsp; &#8220;Service&#8221;:</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; "codedeploy.us-east-1.amazonaws.com",</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; "codedeploy.us-west-2.amazonaws.com"</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;]</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},</strong></p><p><strong>&nbsp; &nbsp; &#8220;Action&#8221;: &#8220;sts:AssumeRole&#8221;</strong></p><p><strong>&nbsp; &nbsp; }</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;]</strong></p><p><strong>}</strong></p><p> We also need to install AWS CodeDeploy Client to our instance. It will allow the code to be deployed into the instance. You can install the code-deploy client onto your instance by the following process:</p><p> Installing AWS CLI and AWS CodeDeploy Agent on <strong>Ubuntu 14.04 LTS </strong>:</p><p><strong>sudo apt-get update</strong></p><p><strong>sudo apt-get install awscli</strong></p><p><strong>sudo apt-get install ruby2.0</strong></p><p><strong>cd /home/ubuntu</strong></p><p><strong>sudo aws s3 cp s3://aws-codedeploy-us-east-1/latest/install . --region us-east-1</strong></p><p><strong>sudo chmod +x ./install</strong></p><p><strong>sudo ./install auto</strong></p><p><strong>Understanding APPSPEC FILE</strong></p><p> AppSpec is the heart of CodeDeploy and is written in YAML. AppSpec defines how the application code will be deployed on deployment targets and which deployment lifecycle event hooks to run in response to various deployment lifecycle events. It should be in the root of an application source code&#8217;s directory structure.</p><p><strong>High Level Structure of AppSpec File:</strong></p><p> 1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;version: 0.0</p><p> 2 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; os: operating-system-name</p><p> 3 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;files: source-destination-files-mappings</p><p> 4 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;permissions: permissions-specifications</p><p> 5 &nbsp; &nbsp; &nbsp;hooks: deployment-lifecycle-event-mappings</p><p><strong>Hooks</strong>: scripts to run at specific deployment lifecycle events during the deployment. The available event hooks are:</p><p><strong>ApplicationStop</strong>: events to be performed when application is stopped</p><p><strong>DownloadBundle</strong>: occurs when CodeDeploy agent downloads bundle from S3 bucket</p><p><strong>BeforeInstall</strong>: occurs before AWSCodeDeploy starts deployment of application code to deployment target</p><p><strong>Install</strong>: AWSCodeDeploy copies files to deployment targets</p><p><strong>AfterInstall</strong>: occurs once files are copied and installed to deployment targets</p><p><strong>ApplicationStart</strong>: occurs just before your application revision is started on the deployment target</p><p><strong>ValidateService</strong>: occurs after the service has been validated</p><p> The sample AppSpec file used is as shown below:</p><p><strong>version:</strong> 0.0</p><p><strong>os: </strong>linux</p><p><strong> files:</strong></p><p> - source: /</p><p><strong>destination: </strong>/usr/share/nginx/html</p><p><strong> hooks:</strong></p><p><strong> BeforeInstall:</strong></p><p> - location: scripts/install_dependencies.sh</p><p><strong>timeout: </strong>300</p><p><strong>runas: </strong>root</p><p><strong> AfterInstall:</strong></p><p> - location: scripts/afterinstall</p><p><strong>timeout: </strong>300</p><p><strong>runas: </strong>root</p><p><strong> ApplicationStart:</strong></p><p> - location: scripts/start_server</p><p><strong>timeout: </strong>300</p><p><strong>runas:</strong> root</p><p><strong> ApplicationStop:</strong></p><p> - location: scripts/stop_server</p><p><strong>timeout: </strong>300</p><p><strong>runas: </strong>root</p><p> While creating an instance you need to attach the s3 bucket role with your instance and after that you need to install AWS CLI and AWS Code Deploy Agent using the above procedure. Now you are ready to create the CodeDeploy Application.</p><p>Creating AWS CodeDeploy Application</p><p> Sign in to the AWS Console . Go to the services and click on &#8220;<strong>Code Deploy</strong>&#8221; &nbsp;as shown below.</p><a class="image-link image2" target="_blank" href="http://www.tothenew.com/blog/wp-content/uploads/2015/03/1075x331xSelection_005.png.pagespeed.ic.lmwB4g9SwJ.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="http://www.tothenew.com/blog/wp-content/uploads/2015/03/1075x331xSelection_005.png.pagespeed.ic.lmwB4g9SwJ.png 424w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/1075x331xSelection_005.png.pagespeed.ic.lmwB4g9SwJ.png 848w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/1075x331xSelection_005.png.pagespeed.ic.lmwB4g9SwJ.png 1272w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/1075x331xSelection_005.png.pagespeed.ic.lmwB4g9SwJ.png 1456w" sizes="100vw"><img src="http://www.tothenew.com/blog/wp-content/uploads/2015/03/1075x331xSelection_005.png.pagespeed.ic.lmwB4g9SwJ.png" width="400" height="123" data-attrs="{&quot;src&quot;:&quot;http://www.tothenew.com/blog/wp-content/uploads/2015/03/1075x331xSelection_005.png.pagespeed.ic.lmwB4g9SwJ.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:123,&quot;width&quot;:400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Selection_005&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Selection_005" title="Selection_005" srcset="http://www.tothenew.com/blog/wp-content/uploads/2015/03/1075x331xSelection_005.png.pagespeed.ic.lmwB4g9SwJ.png 424w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/1075x331xSelection_005.png.pagespeed.ic.lmwB4g9SwJ.png 848w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/1075x331xSelection_005.png.pagespeed.ic.lmwB4g9SwJ.png 1272w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/1075x331xSelection_005.png.pagespeed.ic.lmwB4g9SwJ.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p> Now a new window will open as shown below. Click on &#8220;<strong>Create New Application</strong>&#8221; button. It will open up the prompt to create a new application.</p><a class="image-link image2" target="_blank" href="http://www.tothenew.com/blog/wp-content/uploads/2015/03/1066x259xSelection_004.png.pagespeed.ic.Q5KblKasY6.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="http://www.tothenew.com/blog/wp-content/uploads/2015/03/1066x259xSelection_004.png.pagespeed.ic.Q5KblKasY6.png 424w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/1066x259xSelection_004.png.pagespeed.ic.Q5KblKasY6.png 848w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/1066x259xSelection_004.png.pagespeed.ic.Q5KblKasY6.png 1272w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/1066x259xSelection_004.png.pagespeed.ic.Q5KblKasY6.png 1456w" sizes="100vw"><img src="http://www.tothenew.com/blog/wp-content/uploads/2015/03/1066x259xSelection_004.png.pagespeed.ic.Q5KblKasY6.png" width="400" height="97" data-attrs="{&quot;src&quot;:&quot;http://www.tothenew.com/blog/wp-content/uploads/2015/03/1066x259xSelection_004.png.pagespeed.ic.Q5KblKasY6.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:97,&quot;width&quot;:400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Selection_004&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Selection_004" title="Selection_004" srcset="http://www.tothenew.com/blog/wp-content/uploads/2015/03/1066x259xSelection_004.png.pagespeed.ic.Q5KblKasY6.png 424w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/1066x259xSelection_004.png.pagespeed.ic.Q5KblKasY6.png 848w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/1066x259xSelection_004.png.pagespeed.ic.Q5KblKasY6.png 1272w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/1066x259xSelection_004.png.pagespeed.ic.Q5KblKasY6.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p> A new window will appear which ask about the details for creating an application. &nbsp;Enter <strong>Application</strong> <strong>Name, Application Group Name</strong> and choose instances to which you want to deploy the code using the Key and Value. Choose your <strong>Deploy Configuration</strong> :- &nbsp;One at a time /Half at a time /All at a time . This configuration lets you choose how you want to deploy your code.</p><a class="image-link image2" target="_blank" href="http://www.tothenew.com/blog/wp-content/uploads/2015/03/997x342xSelection_006.png.pagespeed.ic.SpZpqcCUC1.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="http://www.tothenew.com/blog/wp-content/uploads/2015/03/997x342xSelection_006.png.pagespeed.ic.SpZpqcCUC1.png 424w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/997x342xSelection_006.png.pagespeed.ic.SpZpqcCUC1.png 848w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/997x342xSelection_006.png.pagespeed.ic.SpZpqcCUC1.png 1272w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/997x342xSelection_006.png.pagespeed.ic.SpZpqcCUC1.png 1456w" sizes="100vw"><img src="http://www.tothenew.com/blog/wp-content/uploads/2015/03/997x342xSelection_006.png.pagespeed.ic.SpZpqcCUC1.png" data-attrs="{&quot;src&quot;:&quot;http://www.tothenew.com/blog/wp-content/uploads/2015/03/997x342xSelection_006.png.pagespeed.ic.SpZpqcCUC1.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Selection_006&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Selection_006" title="Selection_006" srcset="http://www.tothenew.com/blog/wp-content/uploads/2015/03/997x342xSelection_006.png.pagespeed.ic.SpZpqcCUC1.png 424w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/997x342xSelection_006.png.pagespeed.ic.SpZpqcCUC1.png 848w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/997x342xSelection_006.png.pagespeed.ic.SpZpqcCUC1.png 1272w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/997x342xSelection_006.png.pagespeed.ic.SpZpqcCUC1.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p> Enter the application name and Application Group Name.</p><a class="image-link image2" target="_blank" href="http://www.tothenew.com/blog/wp-content/uploads/2015/03/889x517xSelection_007.png.pagespeed.ic.zCub2LyOuj.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="http://www.tothenew.com/blog/wp-content/uploads/2015/03/889x517xSelection_007.png.pagespeed.ic.zCub2LyOuj.png 424w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/889x517xSelection_007.png.pagespeed.ic.zCub2LyOuj.png 848w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/889x517xSelection_007.png.pagespeed.ic.zCub2LyOuj.png 1272w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/889x517xSelection_007.png.pagespeed.ic.zCub2LyOuj.png 1456w" sizes="100vw"><img src="http://www.tothenew.com/blog/wp-content/uploads/2015/03/889x517xSelection_007.png.pagespeed.ic.zCub2LyOuj.png" width="400" height="232" data-attrs="{&quot;src&quot;:&quot;http://www.tothenew.com/blog/wp-content/uploads/2015/03/889x517xSelection_007.png.pagespeed.ic.zCub2LyOuj.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:232,&quot;width&quot;:400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Selection_007&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Selection_007" title="Selection_007" srcset="http://www.tothenew.com/blog/wp-content/uploads/2015/03/889x517xSelection_007.png.pagespeed.ic.zCub2LyOuj.png 424w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/889x517xSelection_007.png.pagespeed.ic.zCub2LyOuj.png 848w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/889x517xSelection_007.png.pagespeed.ic.zCub2LyOuj.png 1272w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/889x517xSelection_007.png.pagespeed.ic.zCub2LyOuj.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p> Choose instances based om their Key and Value</p><a class="image-link image2" target="_blank" href="http://www.tothenew.com/blog/wp-content/uploads/2015/03/906x298xSelection_008.png.pagespeed.ic.7HaLage8eQ.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="http://www.tothenew.com/blog/wp-content/uploads/2015/03/906x298xSelection_008.png.pagespeed.ic.7HaLage8eQ.png 424w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/906x298xSelection_008.png.pagespeed.ic.7HaLage8eQ.png 848w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/906x298xSelection_008.png.pagespeed.ic.7HaLage8eQ.png 1272w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/906x298xSelection_008.png.pagespeed.ic.7HaLage8eQ.png 1456w" sizes="100vw"><img src="http://www.tothenew.com/blog/wp-content/uploads/2015/03/906x298xSelection_008.png.pagespeed.ic.7HaLage8eQ.png" width="400" height="131" data-attrs="{&quot;src&quot;:&quot;http://www.tothenew.com/blog/wp-content/uploads/2015/03/906x298xSelection_008.png.pagespeed.ic.7HaLage8eQ.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:131,&quot;width&quot;:400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Selection_008&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Selection_008" title="Selection_008" srcset="http://www.tothenew.com/blog/wp-content/uploads/2015/03/906x298xSelection_008.png.pagespeed.ic.7HaLage8eQ.png 424w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/906x298xSelection_008.png.pagespeed.ic.7HaLage8eQ.png 848w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/906x298xSelection_008.png.pagespeed.ic.7HaLage8eQ.png 1272w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/906x298xSelection_008.png.pagespeed.ic.7HaLage8eQ.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p> Then Click on &#8220;<strong>CREATE APPLICATION </strong>&#8221; button. Your application will be created and new window will appear as shown below. &nbsp;</p><a class="image-link image2" target="_blank" href="http://www.tothenew.com/blog/wp-content/uploads/2015/03/542x423xSelection_010.png.pagespeed.ic.OhzKEPAO67.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="http://www.tothenew.com/blog/wp-content/uploads/2015/03/542x423xSelection_010.png.pagespeed.ic.OhzKEPAO67.png 424w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/542x423xSelection_010.png.pagespeed.ic.OhzKEPAO67.png 848w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/542x423xSelection_010.png.pagespeed.ic.OhzKEPAO67.png 1272w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/542x423xSelection_010.png.pagespeed.ic.OhzKEPAO67.png 1456w" sizes="100vw"><img src="http://www.tothenew.com/blog/wp-content/uploads/2015/03/542x423xSelection_010.png.pagespeed.ic.OhzKEPAO67.png" data-attrs="{&quot;src&quot;:&quot;http://www.tothenew.com/blog/wp-content/uploads/2015/03/542x423xSelection_010.png.pagespeed.ic.OhzKEPAO67.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Selection_010&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Selection_010" title="Selection_010" srcset="http://www.tothenew.com/blog/wp-content/uploads/2015/03/542x423xSelection_010.png.pagespeed.ic.OhzKEPAO67.png 424w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/542x423xSelection_010.png.pagespeed.ic.OhzKEPAO67.png 848w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/542x423xSelection_010.png.pagespeed.ic.OhzKEPAO67.png 1272w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/542x423xSelection_010.png.pagespeed.ic.OhzKEPAO67.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p> You have to create a new revision. Click on <strong>Deploy New Revision</strong> button to create a new revision.</p><a class="image-link image2 is-viewable-img" target="_blank" href="http://www.tothenew.com/blog/wp-content/uploads/2015/03/839x608xSelection_013.png.pagespeed.ic.zdFaY_Hxwi.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="http://www.tothenew.com/blog/wp-content/uploads/2015/03/839x608xSelection_013.png.pagespeed.ic.zdFaY_Hxwi.png 424w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/839x608xSelection_013.png.pagespeed.ic.zdFaY_Hxwi.png 848w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/839x608xSelection_013.png.pagespeed.ic.zdFaY_Hxwi.png 1272w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/839x608xSelection_013.png.pagespeed.ic.zdFaY_Hxwi.png 1456w" sizes="100vw"><img src="http://www.tothenew.com/blog/wp-content/uploads/2015/03/839x608xSelection_013.png.pagespeed.ic.zdFaY_Hxwi.png" width="400" height="289" data-attrs="{&quot;src&quot;:&quot;http://www.tothenew.com/blog/wp-content/uploads/2015/03/839x608xSelection_013.png.pagespeed.ic.zdFaY_Hxwi.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:289,&quot;width&quot;:400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Selection_013&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Selection_013" title="Selection_013" srcset="http://www.tothenew.com/blog/wp-content/uploads/2015/03/839x608xSelection_013.png.pagespeed.ic.zdFaY_Hxwi.png 424w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/839x608xSelection_013.png.pagespeed.ic.zdFaY_Hxwi.png 848w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/839x608xSelection_013.png.pagespeed.ic.zdFaY_Hxwi.png 1272w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/839x608xSelection_013.png.pagespeed.ic.zdFaY_Hxwi.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><p> Now enter the &nbsp;<strong>Application Name, Deployment Group Name</strong>. Choose <strong>Revision type</strong> :- &#8220;My application is stored in Amazon S3.&#8221;. Give the Revision Location i.e. location of Bucket and the file name. (You can also copy the full path of file from AWS S3 and paste it here). After entering all the details, click on <strong>Deploy Now</strong>. Now your application and code is being deployed. Wait for few seconds and then refresh.</p><a class="image-link image2" target="_blank" href="http://www.tothenew.com/blog/wp-content/uploads/2015/03/1351x270xSelection_012.png.pagespeed.ic.8dAV3sGw1Y.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="http://www.tothenew.com/blog/wp-content/uploads/2015/03/1351x270xSelection_012.png.pagespeed.ic.8dAV3sGw1Y.png 424w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/1351x270xSelection_012.png.pagespeed.ic.8dAV3sGw1Y.png 848w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/1351x270xSelection_012.png.pagespeed.ic.8dAV3sGw1Y.png 1272w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/1351x270xSelection_012.png.pagespeed.ic.8dAV3sGw1Y.png 1456w" sizes="100vw"><img src="http://www.tothenew.com/blog/wp-content/uploads/2015/03/1351x270xSelection_012.png.pagespeed.ic.8dAV3sGw1Y.png" width="400" height="78" data-attrs="{&quot;src&quot;:&quot;http://www.tothenew.com/blog/wp-content/uploads/2015/03/1351x270xSelection_012.png.pagespeed.ic.8dAV3sGw1Y.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:78,&quot;width&quot;:400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Selection_012&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Selection_012" title="Selection_012" srcset="http://www.tothenew.com/blog/wp-content/uploads/2015/03/1351x270xSelection_012.png.pagespeed.ic.8dAV3sGw1Y.png 424w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/1351x270xSelection_012.png.pagespeed.ic.8dAV3sGw1Y.png 848w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/1351x270xSelection_012.png.pagespeed.ic.8dAV3sGw1Y.png 1272w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/1351x270xSelection_012.png.pagespeed.ic.8dAV3sGw1Y.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><a class="image-link image2" target="_blank" href="http://www.tothenew.com/blog/wp-content/uploads/2015/03/1309x577xSelection_014.png.pagespeed.ic.iJWlephtLW.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="http://www.tothenew.com/blog/wp-content/uploads/2015/03/1309x577xSelection_014.png.pagespeed.ic.iJWlephtLW.png 424w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/1309x577xSelection_014.png.pagespeed.ic.iJWlephtLW.png 848w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/1309x577xSelection_014.png.pagespeed.ic.iJWlephtLW.png 1272w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/1309x577xSelection_014.png.pagespeed.ic.iJWlephtLW.png 1456w" sizes="100vw"><img src="http://www.tothenew.com/blog/wp-content/uploads/2015/03/1309x577xSelection_014.png.pagespeed.ic.iJWlephtLW.png" width="400" height="176" data-attrs="{&quot;src&quot;:&quot;http://www.tothenew.com/blog/wp-content/uploads/2015/03/1309x577xSelection_014.png.pagespeed.ic.iJWlephtLW.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:176,&quot;width&quot;:400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Selection_014&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Selection_014" title="Selection_014" srcset="http://www.tothenew.com/blog/wp-content/uploads/2015/03/1309x577xSelection_014.png.pagespeed.ic.iJWlephtLW.png 424w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/1309x577xSelection_014.png.pagespeed.ic.iJWlephtLW.png 848w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/1309x577xSelection_014.png.pagespeed.ic.iJWlephtLW.png 1272w, http://www.tothenew.com/blog/wp-content/uploads/2015/03/1309x577xSelection_014.png.pagespeed.ic.iJWlephtLW.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p> The status will appear as <strong>Succeeded</strong>. You can now hit the IP of your instance and you will get the index page that you deployed.</p><p>Hope this will help you!</p><p><br>Please Remember me in your prayers!</p><p><br>Enjoy&nbsp;</p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!xFPv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49c70900-92c1-432a-a2ea-8de684c4dca8_15x15.gif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!xFPv!,w_424,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49c70900-92c1-432a-a2ea-8de684c4dca8_15x15.gif 424w, https://substackcdn.com/image/fetch/$s_!xFPv!,w_848,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49c70900-92c1-432a-a2ea-8de684c4dca8_15x15.gif 848w, https://substackcdn.com/image/fetch/$s_!xFPv!,w_1272,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49c70900-92c1-432a-a2ea-8de684c4dca8_15x15.gif 1272w, https://substackcdn.com/image/fetch/$s_!xFPv!,w_1456,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49c70900-92c1-432a-a2ea-8de684c4dca8_15x15.gif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!xFPv!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49c70900-92c1-432a-a2ea-8de684c4dca8_15x15.gif" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/49c70900-92c1-432a-a2ea-8de684c4dca8_15x15.gif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;:-)&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt=":-)" title=":-)" srcset="https://substackcdn.com/image/fetch/$s_!xFPv!,w_424,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49c70900-92c1-432a-a2ea-8de684c4dca8_15x15.gif 424w, https://substackcdn.com/image/fetch/$s_!xFPv!,w_848,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49c70900-92c1-432a-a2ea-8de684c4dca8_15x15.gif 848w, https://substackcdn.com/image/fetch/$s_!xFPv!,w_1272,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49c70900-92c1-432a-a2ea-8de684c4dca8_15x15.gif 1272w, https://substackcdn.com/image/fetch/$s_!xFPv!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49c70900-92c1-432a-a2ea-8de684c4dca8_15x15.gif 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a>]]></content:encoded></item><item><title><![CDATA[Restrict IAM User to Particular Route53 Hosted Zone]]></title><description><![CDATA[Through AWS Internet Access Management (IAM) it&#8217;s possible to add people to manage all or parts of your AWS account.]]></description><link>https://www.groktechie.com/p/restrict-iam-user-to-particular-route53</link><guid isPermaLink="false">https://www.groktechie.com/p/restrict-iam-user-to-particular-route53</guid><dc:creator><![CDATA[Shashank Singh]]></dc:creator><pubDate>Tue, 20 Dec 2016 07:22:00 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/8053feb6-2298-4346-9ada-5528327dbb27_15x15.gif" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Through AWS Internet Access Management (<strong>IAM</strong>) it&#8217;s possible to add people to manage all or parts of your AWS account. It takes just a few minutes to setup permissions, roles and a new user but one item I battled to find was how to restrict the permissions of a certain user or group.<br><br>So, without further delay, here is the change that is needed to restrict permissions to a certain domain in IAM:<br><br><br></p><ul><li><p>Setup your new User and Permissions (and Roles if needed).</p></li><li><p>From within Route 53 copy the Hosted Zone ID for the domain you want to allow access.</p></li><li><p>From the IAM dashboard Create a new policy:</p></li><li><p>Change the Hosted zone ID with your hosted zone ID which you want to restrict.</p></li></ul><p><strong>{ &nbsp;</strong></p><p><strong>&nbsp; &nbsp;"Version": "2012-10-17",</strong></p><p><strong>&nbsp; &nbsp;"Statement":[</strong></p><p><strong>&nbsp; &nbsp; &nbsp; {</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"Action":[</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "route53:ChangeResourceRecordSets",</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "route53:GetHostedZone",</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "route53:ListResourceRecordSets"</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;],</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"Effect":"Allow",</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"Resource":[</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "arn:aws:route53:::hostedzone/&lt;Your zone ID&gt;"</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;]</strong></p><p><strong>&nbsp; &nbsp; &nbsp; },</strong></p><p><strong>&nbsp; &nbsp; &nbsp; {</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"Action":[</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "route53:ListHostedZones"</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;],</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"Effect":"Allow",</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"Resource":[</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "*"</strong></p><p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;]</strong></p><p><strong>&nbsp; &nbsp; &nbsp; }</strong></p><p><strong>&nbsp; &nbsp;]</strong></p><p><strong>}</strong></p><p> Hope this will help you!</p><p><br>Please Remember me in your prayers!</p><p><br>Enjoy&nbsp;</p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!JhEt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bb3dba3-517e-4cc7-96db-8341e0ab633c_15x15.gif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JhEt!,w_424,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bb3dba3-517e-4cc7-96db-8341e0ab633c_15x15.gif 424w, https://substackcdn.com/image/fetch/$s_!JhEt!,w_848,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bb3dba3-517e-4cc7-96db-8341e0ab633c_15x15.gif 848w, https://substackcdn.com/image/fetch/$s_!JhEt!,w_1272,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bb3dba3-517e-4cc7-96db-8341e0ab633c_15x15.gif 1272w, https://substackcdn.com/image/fetch/$s_!JhEt!,w_1456,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bb3dba3-517e-4cc7-96db-8341e0ab633c_15x15.gif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JhEt!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bb3dba3-517e-4cc7-96db-8341e0ab633c_15x15.gif" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5bb3dba3-517e-4cc7-96db-8341e0ab633c_15x15.gif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;:-)&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt=":-)" title=":-)" srcset="https://substackcdn.com/image/fetch/$s_!JhEt!,w_424,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bb3dba3-517e-4cc7-96db-8341e0ab633c_15x15.gif 424w, https://substackcdn.com/image/fetch/$s_!JhEt!,w_848,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bb3dba3-517e-4cc7-96db-8341e0ab633c_15x15.gif 848w, https://substackcdn.com/image/fetch/$s_!JhEt!,w_1272,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bb3dba3-517e-4cc7-96db-8341e0ab633c_15x15.gif 1272w, https://substackcdn.com/image/fetch/$s_!JhEt!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bb3dba3-517e-4cc7-96db-8341e0ab633c_15x15.gif 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a>]]></content:encoded></item><item><title><![CDATA[Deployment automation using AWS Code Depoly]]></title><description><![CDATA[Codedeploy is one of the deployment service by AWS.]]></description><link>https://www.groktechie.com/p/codedeploy-is-one-of-deployment-service</link><guid isPermaLink="false">https://www.groktechie.com/p/codedeploy-is-one-of-deployment-service</guid><dc:creator><![CDATA[Shashank Singh]]></dc:creator><pubDate>Tue, 20 Dec 2016 06:10:00 GMT</pubDate><enclosure url="http://blog.powerupcloud.com/content/images/2016/03/1-6.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<a class="image-link image2" target="_blank" href="http://blog.powerupcloud.com/content/images/2016/03/deployment-components-workflow.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="http://blog.powerupcloud.com/content/images/2016/03/deployment-components-workflow.png 424w, http://blog.powerupcloud.com/content/images/2016/03/deployment-components-workflow.png 848w, http://blog.powerupcloud.com/content/images/2016/03/deployment-components-workflow.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/deployment-components-workflow.png 1456w" sizes="100vw"><img src="http://blog.powerupcloud.com/content/images/2016/03/deployment-components-workflow.png" width="400" height="166" data-attrs="{&quot;src&quot;:&quot;http://blog.powerupcloud.com/content/images/2016/03/deployment-components-workflow.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:166,&quot;width&quot;:400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="http://blog.powerupcloud.com/content/images/2016/03/deployment-components-workflow.png 424w, http://blog.powerupcloud.com/content/images/2016/03/deployment-components-workflow.png 848w, http://blog.powerupcloud.com/content/images/2016/03/deployment-components-workflow.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/deployment-components-workflow.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a><p><br>Codedeploy is one of the deployment service by AWS. The application can be deployed using either a s3 bucket or a git repository which contains the deployable content like code, scripts, configurations files, executables etc.<br><br>In this blog post, we are going to deploy a wordpress application in an elastic, highly available and scalable environment using codedeploy.<br><br>Get things ready<br><br> Get a copy of the WordPress source code in the local system using git command:<br><br></p><pre><code>git clone https://github.com/WordPress/WordPress.git /tmp/WordPress  </code></pre><p><br>Create Scripts to run your Application. Make a directory .scripts in the WordPress folder:<br><br></p><pre><code>mkdir -p /tmp/WordPress/.scripts </code></pre><p><br>Create the following shell scripts in the .scripts folder: sudo vim install_dependencies.sh:<br><br></p><pre><code>#!/bin/bash
yum groupinstall -y "PHP Support"  
yum install -y php-mysql  
yum install -y nginx  
yum install -y php-fpm  </code></pre><p><br>Next sudo vim stop_server.sh:<br><br></p><pre><code>#!/bin/bash
isExistApp=`pgrep nginx`  
if [[ -n  \$isExistApp ]]; then  
   service nginx stop
fi  
isExistApp=`pgrep php-fpm`  
if [[ -n  \$isExistApp ]]; then  
    service php-fpm stop
fi  </code></pre><p><br>one more, sudo vim start_server.sh:<br><br></p><pre><code>#!/bin/bash
service nginx start  
service php-fpm start  </code></pre><p><br>and finally, sudo vim change_permissions.sh:<br><br></p><pre><code>#!/bin/bash
chmod -R 755 /var/www/WordPress  </code></pre><p><br>Make these scripts executable with this command:<br><br></p><pre><code>chmod +x /tmp/WordPress/.scripts/*  </code></pre><p><br>CodeDeploy uses an AppSpec file which is a unique file that defines the deployment actions you want CodeDeploy to execute. So along with the above scripts, create a appspec.yml file<br><strong>sudo vim appspec.yml</strong><br><br></p><pre><code>version: 0.0  
os: linux  
files:  
  - source: /
    destination: /var/www/WordPress
hooks:  
  BeforeInstall:
    - location: .scripts/install_dependencies.sh
      timeout: 300
      runas: root
  AfterInstall:
    - location: .scripts/change_permissions.sh
      timeout: 300
      runas: root
  ApplicationStart:
    - location: .scripts/start_server.sh
      timeout: 300
      runas: root
  ApplicationStop:
    - location: .scripts/stop_server.sh
      timeout: 300
      runas: root</code></pre><p><br>Now zip the WordPress folder and push it to your git repository.<br><br>Creating IAM Roles<br><br>Create an iam instance profile and attach AmazonEC2FullAccess policy and also attach the following inline policy:<br><br></p><pre><code>{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": [
                "s3:Get*",
                "s3:List*"
            ],
            "Effect": "Allow",
            "Resource": "*"
        }
    ]
}</code></pre><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!sClI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2422da1f-06a6-41dd-a2a9-e983503f11f0_400x145.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sClI!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2422da1f-06a6-41dd-a2a9-e983503f11f0_400x145.png 424w, https://substackcdn.com/image/fetch/$s_!sClI!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2422da1f-06a6-41dd-a2a9-e983503f11f0_400x145.png 848w, https://substackcdn.com/image/fetch/$s_!sClI!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2422da1f-06a6-41dd-a2a9-e983503f11f0_400x145.png 1272w, https://substackcdn.com/image/fetch/$s_!sClI!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2422da1f-06a6-41dd-a2a9-e983503f11f0_400x145.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sClI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2422da1f-06a6-41dd-a2a9-e983503f11f0_400x145.png" width="400" height="145" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2422da1f-06a6-41dd-a2a9-e983503f11f0_400x145.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:145,&quot;width&quot;:400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!sClI!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2422da1f-06a6-41dd-a2a9-e983503f11f0_400x145.png 424w, https://substackcdn.com/image/fetch/$s_!sClI!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2422da1f-06a6-41dd-a2a9-e983503f11f0_400x145.png 848w, https://substackcdn.com/image/fetch/$s_!sClI!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2422da1f-06a6-41dd-a2a9-e983503f11f0_400x145.png 1272w, https://substackcdn.com/image/fetch/$s_!sClI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2422da1f-06a6-41dd-a2a9-e983503f11f0_400x145.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br>Create a service role CodeDeployServiceRole. Select Role type AWS CodeDeploy. Attach the Policy AWSCodeDeployRole as shown in the below screenshots:<br><br></p><a class="image-link image2" target="_blank" href="http://blog.powerupcloud.com/content/images/2016/03/1-1.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="http://blog.powerupcloud.com/content/images/2016/03/1-1.png 424w, http://blog.powerupcloud.com/content/images/2016/03/1-1.png 848w, http://blog.powerupcloud.com/content/images/2016/03/1-1.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/1-1.png 1456w" sizes="100vw"><img src="http://blog.powerupcloud.com/content/images/2016/03/1-1.png" width="400" height="145" data-attrs="{&quot;src&quot;:&quot;http://blog.powerupcloud.com/content/images/2016/03/1-1.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:145,&quot;width&quot;:400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="http://blog.powerupcloud.com/content/images/2016/03/1-1.png 424w, http://blog.powerupcloud.com/content/images/2016/03/1-1.png 848w, http://blog.powerupcloud.com/content/images/2016/03/1-1.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/1-1.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><a class="image-link image2" target="_blank" href="http://blog.powerupcloud.com/content/images/2016/03/1-2.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="http://blog.powerupcloud.com/content/images/2016/03/1-2.png 424w, http://blog.powerupcloud.com/content/images/2016/03/1-2.png 848w, http://blog.powerupcloud.com/content/images/2016/03/1-2.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/1-2.png 1456w" sizes="100vw"><img src="http://blog.powerupcloud.com/content/images/2016/03/1-2.png" width="400" height="174" data-attrs="{&quot;src&quot;:&quot;http://blog.powerupcloud.com/content/images/2016/03/1-2.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:174,&quot;width&quot;:400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="http://blog.powerupcloud.com/content/images/2016/03/1-2.png 424w, http://blog.powerupcloud.com/content/images/2016/03/1-2.png 848w, http://blog.powerupcloud.com/content/images/2016/03/1-2.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/1-2.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br><br>How about Scale?<br><br>Create an autoscaling group for a scalable environment. Steps below:<br><br>Choose an ami and select an instance type for it:<br></p><a class="image-link image2" target="_blank" href="http://blog.powerupcloud.com/content/images/2016/03/1-3.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="http://blog.powerupcloud.com/content/images/2016/03/1-3.png 424w, http://blog.powerupcloud.com/content/images/2016/03/1-3.png 848w, http://blog.powerupcloud.com/content/images/2016/03/1-3.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/1-3.png 1456w" sizes="100vw"><img src="http://blog.powerupcloud.com/content/images/2016/03/1-3.png" width="400" height="130" data-attrs="{&quot;src&quot;:&quot;http://blog.powerupcloud.com/content/images/2016/03/1-3.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:130,&quot;width&quot;:400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="http://blog.powerupcloud.com/content/images/2016/03/1-3.png 424w, http://blog.powerupcloud.com/content/images/2016/03/1-3.png 848w, http://blog.powerupcloud.com/content/images/2016/03/1-3.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/1-3.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br>Attach the iam instance profile which we created in the earlier step:<br><br></p><a class="image-link image2" target="_blank" href="http://blog.powerupcloud.com/content/images/2016/03/1-4.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="http://blog.powerupcloud.com/content/images/2016/03/1-4.png 424w, http://blog.powerupcloud.com/content/images/2016/03/1-4.png 848w, http://blog.powerupcloud.com/content/images/2016/03/1-4.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/1-4.png 1456w" sizes="100vw"><img src="http://blog.powerupcloud.com/content/images/2016/03/1-4.png" width="400" height="147" data-attrs="{&quot;src&quot;:&quot;http://blog.powerupcloud.com/content/images/2016/03/1-4.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:147,&quot;width&quot;:400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="http://blog.powerupcloud.com/content/images/2016/03/1-4.png 424w, http://blog.powerupcloud.com/content/images/2016/03/1-4.png 848w, http://blog.powerupcloud.com/content/images/2016/03/1-4.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/1-4.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br>Now go to Advanced Settings and type the following commands in &#8220;User Data&#8221; field to install codedeploy agent on your machine (if it&#8217;s not already installed on your ami):<br><br></p><pre><code>#!/bin/bash
yum -y update  
yum install -y ruby  
yum install -y aws-cli  
sudo su -  
aws s3 cp s3://bucket-n&#65532;&#65532;ame/latest/install . --region region-name  
chmod +x ./install  
./install auto</code></pre><p><br>where, bucket-name represents one of the following based on the instances in the specified region:<br></p><ul><li><p>aws-codedeploy-us-east-1</p></li><li><p>aws-codedeploy-us-west-2</p></li><li><p>aws-codedeploy-us-west-1</p></li><li><p>aws-codedeploy-eu-west-1</p></li><li><p>aws-codedeploy-eu-central-1</p></li><li><p>aws-codedeploy-ap-southeast-1</p></li><li><p>aws-codedeploy-ap-southeast-2</p></li><li><p>aws-codedeploy-ap-northeast-1</p></li><li><p>aws-codedeploy-ap-south-1</p></li><li><p>aws-codedeploy-eu-west-2</p></li><li><p>aws-codedeploy-ca-central-1</p></li><li><p>aws-codedeploy-us-east-2</p></li><li><p>aws-codedeploy-ap-northeast-2</p></li><li><p>aws-codedeploy-sa-east-1</p></li></ul><p><br>and region-name will be one of the following:<br><br></p><ul><li><p>us-east-1</p></li><li><p>us-west-2</p></li><li><p>us-west-1</p></li><li><p>eu-west-1</p></li><li><p>eu-central-1</p></li><li><p>ap-southeast-1</p></li><li><p>ap-southeast-2</p></li><li><p>ap-northeast-1</p></li><li><p>ap-south-1</p></li><li><p>eu-west-2</p></li><li><p>ca-central-1</p></li><li><p>us-east-2</p></li><li><p>ap-northeast-2</p></li><li><p>sa-east-1</p></li></ul><p><br>Select Security Group in the next step and create the launch configuration for the autoscaling group. Now using the launch configuration created in the above step, create an Autoscaling group.<br><br>Select the launch configuration from the given options:<br><br></p><a class="image-link image2" target="_blank" href="http://blog.powerupcloud.com/content/images/2016/03/1-5.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="http://blog.powerupcloud.com/content/images/2016/03/1-5.png 424w, http://blog.powerupcloud.com/content/images/2016/03/1-5.png 848w, http://blog.powerupcloud.com/content/images/2016/03/1-5.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/1-5.png 1456w" sizes="100vw"><img src="http://blog.powerupcloud.com/content/images/2016/03/1-5.png" width="400" height="148" data-attrs="{&quot;src&quot;:&quot;http://blog.powerupcloud.com/content/images/2016/03/1-5.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:148,&quot;width&quot;:400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="http://blog.powerupcloud.com/content/images/2016/03/1-5.png 424w, http://blog.powerupcloud.com/content/images/2016/03/1-5.png 848w, http://blog.powerupcloud.com/content/images/2016/03/1-5.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/1-5.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br>Give the name of the group in the next screen and select a subnet for it.<br></p><a class="image-link image2" target="_blank" href="http://blog.powerupcloud.com/content/images/2016/03/2.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="http://blog.powerupcloud.com/content/images/2016/03/2.png 424w, http://blog.powerupcloud.com/content/images/2016/03/2.png 848w, http://blog.powerupcloud.com/content/images/2016/03/2.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/2.png 1456w" sizes="100vw"><img src="http://blog.powerupcloud.com/content/images/2016/03/2.png" width="400" height="138" data-attrs="{&quot;src&quot;:&quot;http://blog.powerupcloud.com/content/images/2016/03/2.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:138,&quot;width&quot;:400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="http://blog.powerupcloud.com/content/images/2016/03/2.png 424w, http://blog.powerupcloud.com/content/images/2016/03/2.png 848w, http://blog.powerupcloud.com/content/images/2016/03/2.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/2.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p> Keep the remaining settings at its default and create the autoscaling group.<br><br>Time to Deploy<br><br>Choose Create New Application. Give some name for the application and a name for the deployment group as well.<br></p><a class="image-link image2" target="_blank" href="http://blog.powerupcloud.com/content/images/2016/03/1-6.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="http://blog.powerupcloud.com/content/images/2016/03/1-6.png 424w, http://blog.powerupcloud.com/content/images/2016/03/1-6.png 848w, http://blog.powerupcloud.com/content/images/2016/03/1-6.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/1-6.png 1456w" sizes="100vw"><img src="http://blog.powerupcloud.com/content/images/2016/03/1-6.png" data-attrs="{&quot;src&quot;:&quot;http://blog.powerupcloud.com/content/images/2016/03/1-6.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="http://blog.powerupcloud.com/content/images/2016/03/1-6.png 424w, http://blog.powerupcloud.com/content/images/2016/03/1-6.png 848w, http://blog.powerupcloud.com/content/images/2016/03/1-6.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/1-6.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br>Select Autoscaling Group in <strong>Search By Tags</strong> field to deploy the application on the group and select <strong>CodeDeployDefault.OneAtATime</strong> in the Deployment Config field.<br><br><br></p><a class="image-link image2" target="_blank" href="http://blog.powerupcloud.com/content/images/2016/03/1-7.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="http://blog.powerupcloud.com/content/images/2016/03/1-7.png 424w, http://blog.powerupcloud.com/content/images/2016/03/1-7.png 848w, http://blog.powerupcloud.com/content/images/2016/03/1-7.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/1-7.png 1456w" sizes="100vw"><img src="http://blog.powerupcloud.com/content/images/2016/03/1-7.png" width="400" height="110" data-attrs="{&quot;src&quot;:&quot;http://blog.powerupcloud.com/content/images/2016/03/1-7.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:110,&quot;width&quot;:400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="http://blog.powerupcloud.com/content/images/2016/03/1-7.png 424w, http://blog.powerupcloud.com/content/images/2016/03/1-7.png 848w, http://blog.powerupcloud.com/content/images/2016/03/1-7.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/1-7.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br>Select <strong>ServiceRoleARN</strong> for the service role which we created in the &#8220;Creating IAM Roles&#8221; section of this post. Go to Deployments and choose Create New Deployment. Select Application and Deployment Group and select the revision type for your source code (i.e. an S3 bucket or a GitHub repository).<br><br><br></p><a class="image-link image2" target="_blank" href="http://blog.powerupcloud.com/content/images/2016/03/1-8.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="http://blog.powerupcloud.com/content/images/2016/03/1-8.png 424w, http://blog.powerupcloud.com/content/images/2016/03/1-8.png 848w, http://blog.powerupcloud.com/content/images/2016/03/1-8.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/1-8.png 1456w" sizes="100vw"><img src="http://blog.powerupcloud.com/content/images/2016/03/1-8.png" data-attrs="{&quot;src&quot;:&quot;http://blog.powerupcloud.com/content/images/2016/03/1-8.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="http://blog.powerupcloud.com/content/images/2016/03/1-8.png 424w, http://blog.powerupcloud.com/content/images/2016/03/1-8.png 848w, http://blog.powerupcloud.com/content/images/2016/03/1-8.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/1-8.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br>On the successful deployment of the application, something like this will appear on the screen:<br><br><br></p><a class="image-link image2" target="_blank" href="http://blog.powerupcloud.com/content/images/2016/03/1-9.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="http://blog.powerupcloud.com/content/images/2016/03/1-9.png 424w, http://blog.powerupcloud.com/content/images/2016/03/1-9.png 848w, http://blog.powerupcloud.com/content/images/2016/03/1-9.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/1-9.png 1456w" sizes="100vw"><img src="http://blog.powerupcloud.com/content/images/2016/03/1-9.png" width="400" height="139" data-attrs="{&quot;src&quot;:&quot;http://blog.powerupcloud.com/content/images/2016/03/1-9.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:139,&quot;width&quot;:400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="http://blog.powerupcloud.com/content/images/2016/03/1-9.png 424w, http://blog.powerupcloud.com/content/images/2016/03/1-9.png 848w, http://blog.powerupcloud.com/content/images/2016/03/1-9.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/1-9.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br>The WordPress is now deployed on the AutoScaling Group. So when you hit the public IP of the instance which belongs to the autoscaling group, nginx test page will load.<br><br>Configurring WordPress&nbsp;<br><br>Since nginx needs <strong>php-fpm</strong> to work with php pages, we need to configure <strong>php-fpm</strong>. Also we need to configure WordPress script as well. For this we need to do certain changes in the files as shown below:<br><br></p><pre><code>sudo vim /etc/php.ini  </code></pre><p><br>Uncomment <strong>cgi.fix_pathinfo=0</strong> and change the value from 1 to 0.<br><br></p><pre><code>sudo vim /etc/php-fpm.d/www.conf</code></pre><p><br>Change <strong>user=nginx</strong> and <strong>group=nginx</strong> and also make sure the following values are uncommented:<br><br></p><pre><code>  pm.min_spare_servers = 5
  pm.max_spare_servers = 35</code></pre><p><br>Add this following script to the configuration file <strong>sudo vim /etc/nginx/conf.d/virtual.conf</strong><br><br></p><pre><code>server {  
listen 80;  
server_name example.com;  
location / {  
    root /var/www/WordPress;
    index index.php index.html index.htm; 
    if (-f $request_filename) {
    expires 30d;
    break;
    }
    if (!-e $request_filename) {
    rewrite ^(.+)$ /index.php?q=$1 last;
    }
    } 
location ~ .php$ {  
    fastcgi_pass   localhost:9000;  #port where FastCGI processes were spawned
    fastcgi_index  index.php;
    fastcgi_param SCRIPT_FILENAME   
    /var/www/WordPress$fastcgi_script_name; #same path as above
fastcgi_param PATH_INFO $fastcgi_script_name;  
include /etc/nginx/fastcgi_params;  
}
}</code></pre><p><br>Hit the server name on the browser and It will load the WordPress Application.To avoid this manual work of configuring the application for other instances in the AutoScaling Group, you can create an image of the instance in which you have done these changes and provide the ami of the created image to the Launch Configuration and update the Launch Configuration in the AutoScaling Group. Hence, the new instances will be created with the updated image.<br><br><br></p><a class="image-link image2" target="_blank" href="http://blog.powerupcloud.com/content/images/2016/03/1-10.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="http://blog.powerupcloud.com/content/images/2016/03/1-10.png 424w, http://blog.powerupcloud.com/content/images/2016/03/1-10.png 848w, http://blog.powerupcloud.com/content/images/2016/03/1-10.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/1-10.png 1456w" sizes="100vw"><img src="http://blog.powerupcloud.com/content/images/2016/03/1-10.png" width="400" height="201" data-attrs="{&quot;src&quot;:&quot;http://blog.powerupcloud.com/content/images/2016/03/1-10.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:201,&quot;width&quot;:400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="http://blog.powerupcloud.com/content/images/2016/03/1-10.png 424w, http://blog.powerupcloud.com/content/images/2016/03/1-10.png 848w, http://blog.powerupcloud.com/content/images/2016/03/1-10.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/1-10.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br>After the successful installation, the wordpress dashboard will appear as shown in the below screenshot:<br><br></p><a class="image-link image2" target="_blank" href="http://blog.powerupcloud.com/content/images/2016/03/1-11.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="http://blog.powerupcloud.com/content/images/2016/03/1-11.png 424w, http://blog.powerupcloud.com/content/images/2016/03/1-11.png 848w, http://blog.powerupcloud.com/content/images/2016/03/1-11.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/1-11.png 1456w" sizes="100vw"><img src="http://blog.powerupcloud.com/content/images/2016/03/1-11.png" data-attrs="{&quot;src&quot;:&quot;http://blog.powerupcloud.com/content/images/2016/03/1-11.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="http://blog.powerupcloud.com/content/images/2016/03/1-11.png 424w, http://blog.powerupcloud.com/content/images/2016/03/1-11.png 848w, http://blog.powerupcloud.com/content/images/2016/03/1-11.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/1-11.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br>Make It Stateless&nbsp;<br><br>If you would like to scale at will and deploy at will, you need to make sure that the web/app is stateless. Make sure that you manage plugins in github repo and static content is stored outside the server, on S3.<br><br>To store the static media content of your WordPress Application in an S3 Bucket, we will need a plugin named <strong>WP Offload S3</strong>.<br>This plugin automatically copies the media files uploaded by WordPress into an S3 bucket. But this plugin has a dependency on another plugin, Amazon Web Services<br><br>So, after downloading the both plugins, we got the two zip files of these plugins now. Unzip these files to <strong>WordPress/wp-content/plugins</strong> path. If not already done, zip the WordPress folder again, push it to the git repository and redeploy the application through CodeDeploy using the CommitID of the latest commit.<br><br><br></p><a class="image-link image2" target="_blank" href="http://blog.powerupcloud.com/content/images/2016/03/1-12.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="http://blog.powerupcloud.com/content/images/2016/03/1-12.png 424w, http://blog.powerupcloud.com/content/images/2016/03/1-12.png 848w, http://blog.powerupcloud.com/content/images/2016/03/1-12.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/1-12.png 1456w" sizes="100vw"><img src="http://blog.powerupcloud.com/content/images/2016/03/1-12.png" width="400" height="127" data-attrs="{&quot;src&quot;:&quot;http://blog.powerupcloud.com/content/images/2016/03/1-12.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:127,&quot;width&quot;:400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="http://blog.powerupcloud.com/content/images/2016/03/1-12.png 424w, http://blog.powerupcloud.com/content/images/2016/03/1-12.png 848w, http://blog.powerupcloud.com/content/images/2016/03/1-12.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/1-12.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br>Go to plugins, the two plugins(Amazon Web Services and WP Offload S3) will be shown. Activate these two plugins. Also, after activating the Amazon Web Services plugin, AWS console will be added to the left bar. Go to AWS and define your Access keys and Secret keys in the wp-config.php.<br><br><br></p><a class="image-link image2" target="_blank" href="http://blog.powerupcloud.com/content/images/2016/03/1-13.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="http://blog.powerupcloud.com/content/images/2016/03/1-13.png 424w, http://blog.powerupcloud.com/content/images/2016/03/1-13.png 848w, http://blog.powerupcloud.com/content/images/2016/03/1-13.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/1-13.png 1456w" sizes="100vw"><img src="http://blog.powerupcloud.com/content/images/2016/03/1-13.png" data-attrs="{&quot;src&quot;:&quot;http://blog.powerupcloud.com/content/images/2016/03/1-13.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="http://blog.powerupcloud.com/content/images/2016/03/1-13.png 424w, http://blog.powerupcloud.com/content/images/2016/03/1-13.png 848w, http://blog.powerupcloud.com/content/images/2016/03/1-13.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/1-13.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br>After activating the WP Offload S3, go to its Settings and enter the name of the bucket in which you want to store the media contents of your blog posts. Save the settings.<br><br><br></p><a class="image-link image2" target="_blank" href="http://blog.powerupcloud.com/content/images/2016/03/1-14.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="http://blog.powerupcloud.com/content/images/2016/03/1-14.png 424w, http://blog.powerupcloud.com/content/images/2016/03/1-14.png 848w, http://blog.powerupcloud.com/content/images/2016/03/1-14.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/1-14.png 1456w" sizes="100vw"><img src="http://blog.powerupcloud.com/content/images/2016/03/1-14.png" data-attrs="{&quot;src&quot;:&quot;http://blog.powerupcloud.com/content/images/2016/03/1-14.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="http://blog.powerupcloud.com/content/images/2016/03/1-14.png 424w, http://blog.powerupcloud.com/content/images/2016/03/1-14.png 848w, http://blog.powerupcloud.com/content/images/2016/03/1-14.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/1-14.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br>Now try posting some media content in your blog post.<br><br>A folder <strong>wp-content</strong> will be created in the S3 bucket and the content will get stored in the same folder.<br><br> Let there be a loadbalancer&nbsp;<br><br>We are now almost done. In order to achieve the 'highly available' part of our initial goal, lets create a loadbalancer :)<br><br>Create an Elastic Load Balancer for high availability of your application. Give it a name.<br><br></p><a class="image-link image2" target="_blank" href="http://blog.powerupcloud.com/content/images/2016/03/1-17.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="http://blog.powerupcloud.com/content/images/2016/03/1-17.png 424w, http://blog.powerupcloud.com/content/images/2016/03/1-17.png 848w, http://blog.powerupcloud.com/content/images/2016/03/1-17.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/1-17.png 1456w" sizes="100vw"><img src="http://blog.powerupcloud.com/content/images/2016/03/1-17.png" data-attrs="{&quot;src&quot;:&quot;http://blog.powerupcloud.com/content/images/2016/03/1-17.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="http://blog.powerupcloud.com/content/images/2016/03/1-17.png 424w, http://blog.powerupcloud.com/content/images/2016/03/1-17.png 848w, http://blog.powerupcloud.com/content/images/2016/03/1-17.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/1-17.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p> Select a security group for it in the next screen and configure the health checks:<br><br></p><a class="image-link image2" target="_blank" href="http://blog.powerupcloud.com/content/images/2016/03/1-18.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="http://blog.powerupcloud.com/content/images/2016/03/1-18.png 424w, http://blog.powerupcloud.com/content/images/2016/03/1-18.png 848w, http://blog.powerupcloud.com/content/images/2016/03/1-18.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/1-18.png 1456w" sizes="100vw"><img src="http://blog.powerupcloud.com/content/images/2016/03/1-18.png" width="400" height="130" data-attrs="{&quot;src&quot;:&quot;http://blog.powerupcloud.com/content/images/2016/03/1-18.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:130,&quot;width&quot;:400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="http://blog.powerupcloud.com/content/images/2016/03/1-18.png 424w, http://blog.powerupcloud.com/content/images/2016/03/1-18.png 848w, http://blog.powerupcloud.com/content/images/2016/03/1-18.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/1-18.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p> Review and Create.<br>Now, Attach this ELB with the autoscaling group:<br><br><br></p><a class="image-link image2" target="_blank" href="http://blog.powerupcloud.com/content/images/2016/03/1-19.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="http://blog.powerupcloud.com/content/images/2016/03/1-19.png 424w, http://blog.powerupcloud.com/content/images/2016/03/1-19.png 848w, http://blog.powerupcloud.com/content/images/2016/03/1-19.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/1-19.png 1456w" sizes="100vw"><img src="http://blog.powerupcloud.com/content/images/2016/03/1-19.png" data-attrs="{&quot;src&quot;:&quot;http://blog.powerupcloud.com/content/images/2016/03/1-19.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="http://blog.powerupcloud.com/content/images/2016/03/1-19.png 424w, http://blog.powerupcloud.com/content/images/2016/03/1-19.png 848w, http://blog.powerupcloud.com/content/images/2016/03/1-19.png 1272w, http://blog.powerupcloud.com/content/images/2016/03/1-19.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><p><br><br>Also, to access the application through the ELB endpoint, add the public DNS of the ELB to the server_name in <strong>/etc/nginx/conf.d/virtual.conf</strong>.<br><br><strong>Happy CodeDeploy-ing! :)</strong><br><br></p><p> Hope this will help you!</p><p><br>Please Remember me in your prayers!</p><p><br>Enjoy&nbsp;</p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_6W8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e61ab85-7fd4-45b5-b334-c43bf08711c5_15x15.gif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_6W8!,w_424,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e61ab85-7fd4-45b5-b334-c43bf08711c5_15x15.gif 424w, https://substackcdn.com/image/fetch/$s_!_6W8!,w_848,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e61ab85-7fd4-45b5-b334-c43bf08711c5_15x15.gif 848w, https://substackcdn.com/image/fetch/$s_!_6W8!,w_1272,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e61ab85-7fd4-45b5-b334-c43bf08711c5_15x15.gif 1272w, https://substackcdn.com/image/fetch/$s_!_6W8!,w_1456,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e61ab85-7fd4-45b5-b334-c43bf08711c5_15x15.gif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_6W8!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e61ab85-7fd4-45b5-b334-c43bf08711c5_15x15.gif" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7e61ab85-7fd4-45b5-b334-c43bf08711c5_15x15.gif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;:-)&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt=":-)" title=":-)" srcset="https://substackcdn.com/image/fetch/$s_!_6W8!,w_424,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e61ab85-7fd4-45b5-b334-c43bf08711c5_15x15.gif 424w, https://substackcdn.com/image/fetch/$s_!_6W8!,w_848,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e61ab85-7fd4-45b5-b334-c43bf08711c5_15x15.gif 848w, https://substackcdn.com/image/fetch/$s_!_6W8!,w_1272,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e61ab85-7fd4-45b5-b334-c43bf08711c5_15x15.gif 1272w, https://substackcdn.com/image/fetch/$s_!_6W8!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e61ab85-7fd4-45b5-b334-c43bf08711c5_15x15.gif 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a>]]></content:encoded></item><item><title><![CDATA[Tuning Your Apache Server]]></title><description><![CDATA[&#65532; Apache configuration has a major affect on your Linode&#8217;s performance.]]></description><link>https://www.groktechie.com/p/tuning-your-apache-server</link><guid isPermaLink="false">https://www.groktechie.com/p/tuning-your-apache-server</guid><dc:creator><![CDATA[Shashank Singh]]></dc:creator><pubDate>Sun, 18 Dec 2016 09:55:00 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/b527fc9a-1769-41d1-83be-b4c092c4bc26_324x400.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!kJu4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F978ba7b7-cb5d-404f-914e-47c88e73f555_324x400.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!kJu4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F978ba7b7-cb5d-404f-914e-47c88e73f555_324x400.jpeg 424w, https://substackcdn.com/image/fetch/$s_!kJu4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F978ba7b7-cb5d-404f-914e-47c88e73f555_324x400.jpeg 848w, https://substackcdn.com/image/fetch/$s_!kJu4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F978ba7b7-cb5d-404f-914e-47c88e73f555_324x400.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!kJu4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F978ba7b7-cb5d-404f-914e-47c88e73f555_324x400.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!kJu4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F978ba7b7-cb5d-404f-914e-47c88e73f555_324x400.jpeg" width="323" height="400" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/978ba7b7-cb5d-404f-914e-47c88e73f555_324x400.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:400,&quot;width&quot;:323,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!kJu4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F978ba7b7-cb5d-404f-914e-47c88e73f555_324x400.jpeg 424w, https://substackcdn.com/image/fetch/$s_!kJu4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F978ba7b7-cb5d-404f-914e-47c88e73f555_324x400.jpeg 848w, https://substackcdn.com/image/fetch/$s_!kJu4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F978ba7b7-cb5d-404f-914e-47c88e73f555_324x400.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!kJu4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F978ba7b7-cb5d-404f-914e-47c88e73f555_324x400.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><p> &#65532;</p><p> Apache configuration has a major affect on your Linode&#8217;s performance. The easiest way to increase server performance is to turn off unneeded modules. This guide covers Apache modules, information on which modules to turn off, and other Apache performance tuning options.</p><p> The steps in this guide require root privileges. Be sure to run the steps below as root or with the sudo prefix.</p><p><strong>Tools</strong></p><p> There are a variety of tools that can assist in determining if you need to alter resource settings, including the top command and the load-testing program Siege. Siege&#8217;s own Longview service can also help in server monitoring. At minimum, familiarize yourself with the RAM and CPU usage of your server. Discover usage statistics with these commands:</p><p><strong>echo [PID] &nbsp;[MEM] &nbsp;[PATH] &amp;&amp; &nbsp;ps aux | awk '{print $2, $4, $11}' | sort -k2rn | head -n 20</strong></p><p><strong>ps -eo pcpu,pid,user,args | sort -k 1 -r | head -20</strong></p><p> More specific resources for resource tuning Apache includes <strong>Apache mod_status</strong> and Apache2Buddy.</p><p><strong>Apache mod_status</strong></p><p> Apache mod_status diplays information related to incoming server connections by generating a detailed status page. View an example of this page at Apache&#8217;s own website.</p><p> Open your website&#8217;s configuration file. This file is located at <strong>/etc/apache2/sites-available/example.com.conf</strong> on Debian/Ubuntu systems or <strong>/etc/httpd/conf.d/vhost.conf</strong> on CentOS/Fedora systems.</p><p> Add the following to the<strong> &lt;virtual_hosts&gt;</strong> block:</p><p><strong>/etc/apache2/sites-available/example.com.conf</strong> (Debian/Ubuntu)</p><p><strong>/etc/httpd/conf.d/vhost.conf</strong> (CentOS/Fedora)</p><p><em><strong>&lt;Location /server-status&gt; &nbsp;SetHandler server-status &nbsp;Order Deny,Allow &nbsp;Deny from all &nbsp;Allow from localhost&lt;/Location&gt;</strong></em></p><p><strong>Apache mod_status</strong> also offers an option called <strong>ExtendedStatus</strong>, which provides additional information about each request made to Apache. To enable <strong>ExtendedStatus</strong> edit your Apache configuration file:</p><p> /etc/apache2/apache2.conf(Debian/Ubuntu)</p><p> /etc/httpd/confd/httpd.conf(CentOS/Fedora)</p><p><strong>ExtendedStatus On</strong></p><p><strong>NOTE:</strong> Enabling ExtendedStatus consumes additional system resources.</p><p><strong>Restart Apache:</strong></p><p> Debian/Ubuntu:</p><p><strong>service apache2 restart</strong></p><p> CentOS/Fedora:</p><p><strong>/bin/systemctl reload httpd.service</strong></p><p> To view the file generated, download Lynx:</p><p> Debian/Ubuntu:</p><p><strong>apt-get install lynx</strong></p><p> Fedora/CentOS:</p><p><strong>yum install lynx</strong></p><p> Open the file:</p><p><strong>lynx http://localhost/server-status</strong></p><p><strong>Apache2Buddy</strong></p><p> The Apache2Buddy script, similar to MySQLTuner, reviews your Apache setup, and makes suggestions based on your Apache process memory and overall RAM. Although it is a fairly basic program, focusing on the MaxClients directive, Apache2Buddy is useful, and can be run through a single command:</p><p><strong>curl -L http://apache2buddy.pl/ | perl</strong></p><p><strong>Multi Processing Modules</strong></p><p> Before making any changes to your Apache configuration, be sure to back up the configuration file:</p><p> On Debian/Ubuntu:</p><p><strong>cp /etc/apache2/apache2.config ~/apache2.conf.backup</strong></p><p> On CentOS/Fedora:</p><p><strong>cp /etc/httpd/conf/httpd.config ~/httpd.conf.backup</strong></p><p> Apache offers two Multi-Processing Modules, three if on Apache 2.4, for managing your settings.</p><p> Each module creates child processes, differing primarily in how they handle threads.</p><p><strong>Prefork</strong></p><p> The prefork module creates a number of child processes at launch, each child handles only one thread. Since these processes deal solely with one thread at a time, making request speed suffer should there be too many concurrent requests. Should this occur, some requests essentially have to wait in line to be acted upon. To handle this, increase the number of child processes spawned, but be aware that this increases the amount of RAM being used. Prefork is the safest module and should be used when using mods that are not thread safe.</p><p><strong>Worker</strong></p><p> The worker module&#8217;s child processes spawn many threads per process, each thread ready to take on new requests. This allows for a greater number of concurrent requests to come in, and in turn is easier on the server&#8217;s RAM usage. Overall, the worker module offers higher performance, but is less secure than prefork and cannot be used with modules that are not thread safe.</p><p><strong>Event</strong></p><p> The event module is only available on Apache 2.4 and is based off the worker MPM. Like the worker, it creates multiple threads per child process, with a thread dedicated to KeepAlive connections that are handed down to child threads once the request has been made. This is good for multiple concurrent connections, especially those that are not all active at the same time but make the occasional request. The event MPM functions the same as worker in the event of SSL connections.</p><p><strong>Module Values</strong></p><p> Once you select your MPM, you will need to change the values inside the configuration. These settings are located in the <strong>/etc/apache2/apache2.conf</strong> file on Debian/Ubuntu, and the <strong>/etc/httpd/conf/httpd.conf</strong> file on CentOS/Fedora. The MPM looks like this:</p><p><strong>/etc/apache2/apache2.conf</strong> (Debian/Ubuntu)</p><p><strong>/etc/httpd/conf/httpd.conf</strong> (CentOS/Fedora)</p><p> &lt;IfModule mpm_prefork_module&gt;</p><p> StartServers &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;4</p><p> MinSpareServers &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;20</p><p> MaxSpareServers &nbsp; &nbsp; &nbsp; &nbsp; 40</p><p> MaxClients &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 200</p><p> MaxRequestsPerChild &nbsp;4500</p><p> &lt;/IfModule&gt;</p><p> For other MPMs replace <strong>&lt;IfModule mpm_prefork_module&gt;</strong> &nbsp;with <strong>&lt;IfModule mpm_worker_module&gt;</strong> &nbsp;or <strong>&lt;IfModule mpm_event_module&gt;</strong> for worker and event, respectively.</p><p> The next step to reconfiguring your Apache server is altering the above settings. To do this, you need to be aware of what each value does, and how best to change it.</p><p> Again, the best way to make configuration changes is to make incremental changes and then monitor the effects.</p><p> After making alterations to the Apache configuration, restart the service using <strong>service apache restart</strong> on Debian/Ubuntu or <strong>/bin/systemctl reload httpd.service</strong> on CentOS/Fedora.</p><p><strong>StartServers</strong></p><p> The StartServers value indicates the number of child processes created at startup, and is dynamically controlled depending on load. There is often little reason to alter this number, unless your server is restarted frequently and contains a large number of requests upon reboot.</p><p><strong>MinSpareServers</strong></p><p> Sets the minimum number of idle child processes. If there are fewer processes than the <strong>MinSpareServer</strong> number, more processes are created at the rate of one per second on Apache 2.2 or lower. With Apache 2.4, this rate increases exponentially starting with 1 and ending with 32 children spawned per second. The benefit of this value is that when a request comes in it can take an idle thread; should a thread not be available, Apache would have to spawn a new child, taking up resources and extending the time it takes for the request to go through. Note, too many idle processes would also have an adverse effect on the server.</p><p><strong>MaxSpareServers</strong></p><p> Sets the maximum number of idle child processes. If there are more idle processes than this number, then they are terminated. Unless your website is extremely busy, this number should not be set too high, since even idle processes consume resources.</p><p><strong>MaxClients</strong></p><p> The maximum amount of requests that can be served simultaneously, with any number going past the limit being queued. If this is set too low, connections sent to queue eventually time-out; however, if set too high, it causes the memory to start swapping. If this value is increased past 256, the ServerLimit value must also be increased.</p><p> One way to calculate the best value for this is to divide the amount of RAM each Apache process uses by the amount of RAM available, leaving some room for other processes. Use <a href="https://tecknobody.blogspot.in/2016/12/tuning-your-apache-server.html">ApacheBuddy</a> to help determine these values, or the commands below.</p><p> To determine the RAM each Apache process uses, replace httpd with &nbsp;apache2 on Debian or Ubuntu systems:</p><p><strong>ps -ylC httpd --sort:rss</strong></p><p> Divide the number by 2048 for megabytes.</p><p> To get information on memory usage:</p><p><strong>free -m</strong></p><p> To receive a fuller view of the resources Apache is using, use the top command.</p><p><strong>MaxRequestsPerChild</strong></p><p> This limits the number of requests a child server handles during its life. Once the limit has been hit, the child server dies. If set to 0, the child servers are set to never expire. The suggested value for this is a few thousand, to prevent memory leakage. Be aware that setting this too low can slow down the system, since creating new processes does take up resources.</p><p><strong>ServerLimit</strong></p><p> If you need to increase the <strong>MaxClients </strong>above <strong>256</strong>, then increase your ServerLimit to match. To do this, add the ServerLimit line to your MPM code and alter the value:</p><p><strong>ServerLimit &nbsp; &nbsp; &nbsp; &nbsp;256</strong></p><p><strong>KeepAlive</strong></p><p> The KeepAlive directive, when set to on allows for multiple requests to come from the same TCP connection. When a KeepAlive connection is used, it counts as only one request against the <strong>MaxRequestsPerChild</strong> directive. This value is kept outside of your MPM, but can tie in closely to your MPM choices.</p><p><strong>More Information</strong></p><p> You may wish to consult the following resources for additional information on this topic. While these are provided in the hope that they will be useful, please note that we cannot vouch for the accuracy or timeliness of externally hosted materials.</p><ul><li><p><a href="http://httpd.apache.org/docs/2.2/misc/perf-tuning.html">Apache Performance Tuning</a></p></li><li><p><a href="http://httpd.apache.org/docs/2.2/mod/mpm_common.html">Apache MPM Common Directives</a></p></li><li><p><a href="http://httpd.apache.org/docs/2.4/">Apache 2.4 Documentation</a></p></li></ul>]]></content:encoded></item><item><title><![CDATA[Load Testing Web Servers with Siege]]></title><description><![CDATA[Siege is an HTTP load testing and benchmarking utility that can be used to measure the performance of a web server when under duress.]]></description><link>https://www.groktechie.com/p/load-testing-web-servers-with-siege</link><guid isPermaLink="false">https://www.groktechie.com/p/load-testing-web-servers-with-siege</guid><dc:creator><![CDATA[Shashank Singh]]></dc:creator><pubDate>Sun, 18 Dec 2016 09:46:00 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/91a10874-43d0-4ebf-bd78-3010091e7b03_15x15.gif" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Siege is an HTTP load testing and benchmarking utility that can be used to measure the performance of a web server when under duress. It evaluates the amount of data transferred, the response time of the server, transaction rate, throughput, concurrency, and times the program returned okay. Siege offers three modes of operation: Regression, internet simulation, and brute force.<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</p><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!HcsG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F666d8798-9ccf-4cc8-af1a-16159585821e_400x277.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!HcsG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F666d8798-9ccf-4cc8-af1a-16159585821e_400x277.png 424w, https://substackcdn.com/image/fetch/$s_!HcsG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F666d8798-9ccf-4cc8-af1a-16159585821e_400x277.png 848w, https://substackcdn.com/image/fetch/$s_!HcsG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F666d8798-9ccf-4cc8-af1a-16159585821e_400x277.png 1272w, https://substackcdn.com/image/fetch/$s_!HcsG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F666d8798-9ccf-4cc8-af1a-16159585821e_400x277.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!HcsG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F666d8798-9ccf-4cc8-af1a-16159585821e_400x277.png" width="400" height="276" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/666d8798-9ccf-4cc8-af1a-16159585821e_400x277.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:276,&quot;width&quot;:400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!HcsG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F666d8798-9ccf-4cc8-af1a-16159585821e_400x277.png 424w, https://substackcdn.com/image/fetch/$s_!HcsG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F666d8798-9ccf-4cc8-af1a-16159585821e_400x277.png 848w, https://substackcdn.com/image/fetch/$s_!HcsG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F666d8798-9ccf-4cc8-af1a-16159585821e_400x277.png 1272w, https://substackcdn.com/image/fetch/$s_!HcsG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F666d8798-9ccf-4cc8-af1a-16159585821e_400x277.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><p><br>&#65532;<br><br><br>This guide is for Debian or Ubuntu systems.<br><br>Download and Configure Siege<br><br>1. Prior to installing any new programs, update your system:<br><br><strong>sudo apt-get update &amp;&amp; sudo apt-get upgrade --show-upgraded</strong><br><br>2. Download the latest version of Siege (3.0.9 at the time of this publication), which is always available at Siege&#8217;s website:<br><br><strong>wget http://download.joedog.org/siege/siege-latest.tar.gz</strong><br><br>3. Extract the program:<br><br><strong>tar -zxvf siege-latest.tar.gz</strong><br><br>4. Navigate to the Siege directory:<br><br><strong>cd siege-*/</strong><br><br>5. If the GNU Compiler Collection (gcc) is not installed, install now:<br><br><strong>sudo apt-get install build-essential</strong><br><br>6. Configure and complete the installation:<br><br><strong>./configure</strong><br><br><strong>make</strong><br><br><strong>sudo make install</strong><br><br>7. Generate a configuration file:<br><br><strong>siege.config</strong><br><br>8. Open the .siegerc file located in your home directory.<br><br>9. The suggested Siege configuration is for 25 concurrent users over a period of 1 minute. Set a location for your log file. Be sure to uncomment the variables shown below, and any other commented settings you want to use by removing the pound sign (#):<br><br><strong>File Excerpt:- ~/.siegerc</strong><br><br>...<br><br>&nbsp; &nbsp; &nbsp; <br><br>#<br><br># Variable declarations. You can set variables here<br><br># for use in the directives below. Example:<br><br># PROXY = proxy.joedog.org<br><br># Reference variables inside ${} or $(), example:<br><br># proxy-host = ${PROXY}<br><br># You can also reference ENVIRONMENT variables without<br><br># actually declaring them, example:<br><br><strong>logfile = $(HOME)/siege.log</strong><br><br><br>...<br><br><br>#<br><br># Default number of simulated &nbsp;concurrent users<br><br># ex: concurrent = 25<br><br>#<br><br><strong>concurrent = 25</strong><br><br><br>#<br><br># Default duration of the siege. &nbsp;The right hand argument has<br><br># a modifier which specifies the time units, H=hours, M=minutes,<br><br># and S=seconds. If a modifier is not specified, then minutes<br><br># are assumed.<br><br># ex: time = 50M<br><br>#<br><br><strong>time = 1M</strong><br><br>You are now ready to run Siege!<br><br><strong>Run Siege</strong><br><br>To run Siege with the default settings, input the following command, replacingwww.example.com with your domain name or IP address:<br><br>siege www.example.com<br><br>Siege outputs the results:<br><br>** SIEGE 2.70<br><br>** Preparing 25 concurrent users for battle.<br><br>The server is now under siege...<br><br>Lifting the server siege... &nbsp; &nbsp; &nbsp; done.<br><br>Transactions: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2913 hits<br><br>Availability: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;100.00 %<br><br>Elapsed time: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;59.51 secs<br><br>Data transferred: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0.41 MB<br><br>Response time: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0.00 secs<br><br>Transaction rate: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 48.95 trans/sec<br><br>Throughput: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0.01 MB/sec<br><br>Concurrency: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0.04<br><br>Successful transactions: &nbsp; &nbsp; &nbsp; &nbsp; 2913<br><br>Failed transactions: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0<br><br>Longest transaction: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0.01<br><br>Shortest transaction: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0.00<br><br><br>FILE: /var/log/siege.log<br><br>You can disable this annoying message by editing<br><br>the .siegerc file in your home directory; change<br><br>the directive 'show-logfile' to false.<br><br>If there are no failed connections and the availability remains at 100%, there are no problems.<br><br>Further Configuring and Commands<br><br>Creating a URL File<br><br>If you want Siege to hit a number of pages on your website at random, configure the program to read from a urls.txt file that lists the selected pages.<br><br>1. Open the urls.txt file generally created at /usr/local/etc/urls.txt. Add a list of URLs or IP addresses to that file:<br><br>File:- /usr/local/etc/urls.txt<br><br># URLS file for siege<br><br># --<br><br># Format the url entries in any of the following formats:<br><br># http://www.whoohoo.com/index.html<br><br># http://www/index.html<br><br># www/index.html<br><br># http://www.whoohoo.com/cgi-bin/howto/display.cgi?1013<br><br># Use the POST directive for pages that require it:<br><br># http://www.whoohoo.com/cgi-bin/haha.cgi POST ha=1&amp;ho=2<br><br># &nbsp; &nbsp; &nbsp;or POST content from a file:<br><br># http://www.whoohoo.com/melvin.jsp POST &lt;/home/jeff/haha<br><br># http://www.whoohoo.com/melvin.jsp POST &lt;./haha<br><br># You may also set and reference variables inside this file,<br><br># for more information, man urls_txt<br><br># -------------------------------------------------------<br><br><br>www.example.com<br><br>www.example.org<br><br>123.45.67.89<br><br>2. To run Siege with this file use the siege command:<br><br>siege<br><br>If using a separate file, run:<br><br><strong>siege -f your/file/path.txt</strong><br><br><strong>Commands</strong><br><br>Siege features a number of command line options to use when you want to deviate from the default configuration but do not wish to edit the file.<br><br><br></p><ul><li><p><strong>-c [num]:</strong> Set the number of concurrent users. Most web servers have less than a couple hundred users trying to access their website at the same time, so setting this to more than a few hundred is often not needed.</p></li><li><p><strong>-t [num]: </strong>Set a time limit for which Siege runs. Siege can run with the modifiers s for seconds, m for minutes, or h for hours. There should be no space between the number and the modifier (-t10s not -t10 s).</p></li><li><p><strong>-d [num]:</strong> Set the delay for each Siege user. Each user is then delayed for a random amount of seconds in between 1 and the set number. The default value is 3.</p></li><li><p><strong>-i:</strong> Used in conjunction with a URLs file, this causes each user to randomly hit one of the URLs, with no predetermined pattern. Similar to real life (the &#8216;i&#8217; stands for &#8220;internet&#8221;), where you will not know where site visitors go, not all pages may be hit.</p></li><li><p><strong>-v:</strong> Verbose output. This outputs the results Siege gets in real time before printing the final results.</p></li><li><p><strong>-f [file]:</strong> Run Siege with a file containing a list of URLs that is not the default urls.txt file.</p></li><li><p><strong>-g [url]:</strong> Pull down the HTTP headers.</p></li><li><p><strong>-l:</strong> Generates a log file.</p></li><li><p><strong>-m "[message]":</strong> Include a message in the log file.</p></li><li><p><strong>-C:</strong> Outputs Siege&#8217;s current configuration profile.</p></li><li><p><strong>-V:</strong> Outputs Siege&#8217;s version information.</p></li><li><p><strong>-h:</strong> Outputs help information.</p></li></ul><p><br><strong><br></strong> <strong>More Information</strong><br><br>You may wish to consult the following resources for additional information on this topic. While these are provided in the hope that they will be useful, please note that we cannot vouch for the accuracy or timeliness of externally hosted materials.<br><a href="https://www.joedog.org/siege-home/">Siege Home</a><br><br></p><p> Hope this will help you!</p><p><br>Please Remember me in your prayers!</p><p><br>Enjoy&nbsp;</p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Re1I!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda2f3015-44a9-49ec-bcf8-fae7ee6d97f4_15x15.gif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Re1I!,w_424,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda2f3015-44a9-49ec-bcf8-fae7ee6d97f4_15x15.gif 424w, https://substackcdn.com/image/fetch/$s_!Re1I!,w_848,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda2f3015-44a9-49ec-bcf8-fae7ee6d97f4_15x15.gif 848w, https://substackcdn.com/image/fetch/$s_!Re1I!,w_1272,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda2f3015-44a9-49ec-bcf8-fae7ee6d97f4_15x15.gif 1272w, https://substackcdn.com/image/fetch/$s_!Re1I!,w_1456,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda2f3015-44a9-49ec-bcf8-fae7ee6d97f4_15x15.gif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Re1I!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda2f3015-44a9-49ec-bcf8-fae7ee6d97f4_15x15.gif" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/da2f3015-44a9-49ec-bcf8-fae7ee6d97f4_15x15.gif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;:-)&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt=":-)" title=":-)" srcset="https://substackcdn.com/image/fetch/$s_!Re1I!,w_424,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda2f3015-44a9-49ec-bcf8-fae7ee6d97f4_15x15.gif 424w, https://substackcdn.com/image/fetch/$s_!Re1I!,w_848,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda2f3015-44a9-49ec-bcf8-fae7ee6d97f4_15x15.gif 848w, https://substackcdn.com/image/fetch/$s_!Re1I!,w_1272,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda2f3015-44a9-49ec-bcf8-fae7ee6d97f4_15x15.gif 1272w, https://substackcdn.com/image/fetch/$s_!Re1I!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda2f3015-44a9-49ec-bcf8-fae7ee6d97f4_15x15.gif 1456w" sizes="100vw"></picture><div></div></div></a>]]></content:encoded></item><item><title><![CDATA[How to find and Kill all ‘Zombie processes’ running on server?]]></title><description><![CDATA[Did you ever notice some processes with status &#8220;Z&#8221; on your server/system?]]></description><link>https://www.groktechie.com/p/how-to-find-and-kill-all-zombie</link><guid isPermaLink="false">https://www.groktechie.com/p/how-to-find-and-kill-all-zombie</guid><dc:creator><![CDATA[Shashank Singh]]></dc:creator><pubDate>Sun, 18 Dec 2016 09:22:00 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/71dd83b8-6dfb-4c82-912a-003d96376bc5_300x300.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Did you ever notice some processes with status &#8220;Z&#8221; on your server/system?&nbsp;</p><p> &#65532;</p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9Dq0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95a1c14f-4e86-4388-8ef4-dd4dbc0427d0_300x300.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9Dq0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95a1c14f-4e86-4388-8ef4-dd4dbc0427d0_300x300.jpeg 424w, https://substackcdn.com/image/fetch/$s_!9Dq0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95a1c14f-4e86-4388-8ef4-dd4dbc0427d0_300x300.jpeg 848w, https://substackcdn.com/image/fetch/$s_!9Dq0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95a1c14f-4e86-4388-8ef4-dd4dbc0427d0_300x300.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!9Dq0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95a1c14f-4e86-4388-8ef4-dd4dbc0427d0_300x300.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9Dq0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95a1c14f-4e86-4388-8ef4-dd4dbc0427d0_300x300.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/95a1c14f-4e86-4388-8ef4-dd4dbc0427d0_300x300.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!9Dq0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95a1c14f-4e86-4388-8ef4-dd4dbc0427d0_300x300.jpeg 424w, https://substackcdn.com/image/fetch/$s_!9Dq0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95a1c14f-4e86-4388-8ef4-dd4dbc0427d0_300x300.jpeg 848w, https://substackcdn.com/image/fetch/$s_!9Dq0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95a1c14f-4e86-4388-8ef4-dd4dbc0427d0_300x300.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!9Dq0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95a1c14f-4e86-4388-8ef4-dd4dbc0427d0_300x300.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a><p> These are Zombies. On this article I&#8217;m explaining the ways to find and kill all Zombies on the server.</p><p> A process is called a zombie process if the process has been completed, but its PID and process entry remains in the Linux process table. A process is removed from the process table when the process is completed, and its parent process reads the completed process' exit status by using the wait() system call. If a parent process fails to call wait() for whatever reason, its child process will be left in the process table, becoming a zombie. It almost always means that the parent is still around. If the parent exited, the child would be orphaned and re-parented to init, which would immediately perform the wait. In other words, they should go away once the parent process is done.</p><p> A zombie process doesn&#8217;t react to signals.</p><p><strong>1. How can I get the Zombies from process list?</strong></p><p> Its very simple! You can find out the Zombie processes in different ways:</p><p> # ps aux |grep "defunct"</p><p> Shashank &nbsp;3366 &nbsp;0.0 &nbsp;0.0 &nbsp; &nbsp;0 &nbsp; &nbsp; 0 ? &nbsp; &nbsp; &nbsp; &nbsp;Z &nbsp; &nbsp;07:34 &nbsp; 0:00 [chrome] defunct&nbsp;</p><p> Shashank &nbsp;3435 &nbsp;0.0 &nbsp;0.0 &nbsp; &nbsp;0 &nbsp; &nbsp; 0 ? &nbsp; &nbsp; &nbsp; &nbsp;Z &nbsp; &nbsp;07:44 &nbsp; 0:19 [chrome] defunct&nbsp;</p><p> Shashank &nbsp;3722 &nbsp;0.0 &nbsp;0.0 &nbsp; &nbsp;0 &nbsp; &nbsp; 0 ? &nbsp; &nbsp; &nbsp; &nbsp;Z &nbsp; &nbsp;08:21 &nbsp; 0:00 [pidgin] defunct&nbsp;</p><p> Shashank &nbsp;4287 &nbsp;0.1 &nbsp;0.0 &nbsp; &nbsp;0 &nbsp; &nbsp; 0 ? &nbsp; &nbsp; &nbsp; &nbsp;Z &nbsp; &nbsp;09:26 &nbsp; 0:38 [chrome] defunct&nbsp;</p><p> Shashank &nbsp;5378 &nbsp;0.1 &nbsp;0.0 &nbsp; &nbsp;0 &nbsp; &nbsp; 0 ? &nbsp; &nbsp; &nbsp; &nbsp;Z &nbsp; &nbsp;11:24 &nbsp; 0:15 [chrome] defunct</p><p> # ps aux |grep Z</p><p><strong>USER &nbsp; &nbsp; &nbsp; &nbsp; PID &nbsp;%CPU &nbsp;%MEM &nbsp; &nbsp;VSZ &nbsp; RSS &nbsp;TTY &nbsp; &nbsp;STAT &nbsp; &nbsp; START &nbsp; TIME &nbsp; &nbsp;COMMAND</strong></p><p> Shashank &nbsp; 3366 &nbsp; &nbsp;0.0 &nbsp; &nbsp; &nbsp; &nbsp; 0.0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0 &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp; ? &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Z &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;07:34 &nbsp; &nbsp; 0:00 &nbsp; &nbsp; &nbsp;[chrome]&nbsp;</p><p> Shashank &nbsp; 3435 &nbsp; &nbsp;0.0 &nbsp; &nbsp; &nbsp; &nbsp; 0.0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0 &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp; ? &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Z &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;07:44 &nbsp; &nbsp; 0:19 &nbsp; &nbsp; &nbsp;[chrome]&nbsp;</p><p> Shashank &nbsp; 3722 &nbsp; &nbsp;0.0 &nbsp; &nbsp; &nbsp; &nbsp; 0.0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0 &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp; ? &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Z &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;08:21 &nbsp; &nbsp; 0:00 &nbsp; &nbsp; &nbsp;[pidgin]&nbsp;</p><p> Shashank &nbsp; 4287 &nbsp; &nbsp;0.1 &nbsp; &nbsp; &nbsp; &nbsp; 0.0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0 &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp; ? &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Z &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;09:26 &nbsp; &nbsp; 0:38 &nbsp; &nbsp; &nbsp;[chrome]&nbsp;</p><p> Shashank &nbsp; 5378 &nbsp; &nbsp;0.1 &nbsp; &nbsp; &nbsp; &nbsp; 0.0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0 &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp; ? &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Z &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;11:24 &nbsp; &nbsp; 0:15 &nbsp; &nbsp; &nbsp;[chrome]</p><p><strong>2. How many Zombie processes running on your server? Juz count it out!</strong></p><p> This is just to make a count of Zombie processes on the server. It can be done in different ways.</p><p> Please see some examples.</p><p> # ps aux | awk {'print $8'} | grep -c Z</p><p> 5</p><p> # ps aux | awk '{ print $8 " " $2 }' | grep -wc Z</p><p> 5</p><p> # ps aux | awk {'print $8'} | grep Z | wc -l</p><p> 5</p><p><strong>3. List the PID of Zombie?</strong></p><p> # ps aux | awk '{ print $8 " " $2 }' | grep -w Z</p><p> Z 3366</p><p> Z 3435</p><p> Z 3722</p><p> Z 4287</p><p> Z 5378</p><p> In order to kill these processes, you need to find the parent process first.</p><p> # pstree -paul</p><p> See the sample output:</p><p> [root@vps ~]# pstree -paul</p><p> init,1</p><p> &nbsp; |-crond,542</p><p> &nbsp; |-dovecot,6576</p><p> &nbsp; | &nbsp; |-anvil,6577,dovecot</p><p> &nbsp; | &nbsp; |-config,25099</p><p> &nbsp; | &nbsp; `-log,6578</p><p> &nbsp; |-httpd,5047</p><p> &nbsp; | &nbsp; |-httpd,1900,apache</p><p> &nbsp; | &nbsp; |-httpd,9428,apache</p><p> &nbsp; | &nbsp; | &nbsp; |-php-cgi,1904,ctalk</p><p> &nbsp; | &nbsp; | &nbsp; |-php-cgi,11989,ctalk</p><p> &nbsp; | &nbsp; | &nbsp; `-php-cgi,11994,ctalk</p><p> &nbsp; | &nbsp; |-httpd,19203,apache</p><p> &nbsp; | &nbsp; |-httpd,22975,apache</p><p> &nbsp; | &nbsp; |-httpd,25197,apache</p><p> &nbsp; | &nbsp; `-httpd,30417,apache</p><p> &nbsp; |-(kthreadd/3929,2)</p><p> &nbsp; | &nbsp; `-(khelper/3929,3)</p><p> &nbsp; |-master,5227</p><p> ........</p><p> This will show the pid of the of the parent of the zombie process. Now you need to kill the parent process or restart the service.</p><p><strong>4. To find zombie processes with PPID(Parent PID) on Linux:</strong></p><p> # ps axo stat,ppid,pid,comm | grep -w defunct&nbsp;</p><p> Z &nbsp; &nbsp;27698 &nbsp; 3366 chrome &lt;defunct&gt;</p><p> Z &nbsp; &nbsp;27698 &nbsp; 3435 chrome &lt;defunct&gt;</p><p> Z &nbsp; &nbsp;27758 &nbsp; 3722 pidgin &lt;defunct&gt;</p><p> Z &nbsp; &nbsp;27698 &nbsp; 4287 chrome &lt;defunct&gt;</p><p> Z &nbsp; &nbsp;27698 &nbsp; 5378 chrome &lt;defunct&gt;&nbsp;</p><p> The above command searches for processes with zombie (defunct) state, and displays them in (state, PPID, PID, command-name) format. The sample output shows that there is two zombie processes associated with "chrome &amp; pidgin", and these were spawned by parent process with PIDs 27698 &amp; 27758 respectively.</p><p> Killing zombie processes is not obvious since zombie processes are already dead. You can try two options to kill a zombie process on Linux as follows.</p><p> First, you can try sending SIGCHLD signal to the zombie's parent process using the kill command. Note that the above command gives you PPID (PID of parent process) of each zombie. In our example, PPID of the zombie are 27698 &amp; 27758.</p><p> # sudo kill -s SIGCHLD 27698</p><p> # sudo kill -s SIGCHLD 27758</p><p> If a zombie process still does not go away, you can kill the parent process (e.g., 27698 or 27758) of the zombie.</p><p> # sudo kill -9 27698</p><p> # sudo kill -9 27758</p><p> Once its parent process gets killed, the zombie will be adopted by the init process, which is a parent of all processes in Linux. The init process periodically calls wait() to reap any zombie process.</p><p> Hope this will help you!</p><p><br>Please Remember me in your prayers!</p><p><br>Enjoy&nbsp;</p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!FF2Y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7d08a82-8b23-4d27-a33f-ad688690d059_15x15.gif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!FF2Y!,w_424,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7d08a82-8b23-4d27-a33f-ad688690d059_15x15.gif 424w, https://substackcdn.com/image/fetch/$s_!FF2Y!,w_848,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7d08a82-8b23-4d27-a33f-ad688690d059_15x15.gif 848w, https://substackcdn.com/image/fetch/$s_!FF2Y!,w_1272,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7d08a82-8b23-4d27-a33f-ad688690d059_15x15.gif 1272w, https://substackcdn.com/image/fetch/$s_!FF2Y!,w_1456,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7d08a82-8b23-4d27-a33f-ad688690d059_15x15.gif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!FF2Y!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7d08a82-8b23-4d27-a33f-ad688690d059_15x15.gif" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e7d08a82-8b23-4d27-a33f-ad688690d059_15x15.gif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;:-)&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt=":-)" title=":-)" srcset="https://substackcdn.com/image/fetch/$s_!FF2Y!,w_424,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7d08a82-8b23-4d27-a33f-ad688690d059_15x15.gif 424w, https://substackcdn.com/image/fetch/$s_!FF2Y!,w_848,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7d08a82-8b23-4d27-a33f-ad688690d059_15x15.gif 848w, https://substackcdn.com/image/fetch/$s_!FF2Y!,w_1272,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7d08a82-8b23-4d27-a33f-ad688690d059_15x15.gif 1272w, https://substackcdn.com/image/fetch/$s_!FF2Y!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7d08a82-8b23-4d27-a33f-ad688690d059_15x15.gif 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a>]]></content:encoded></item><item><title><![CDATA[Block copy paste in Blogspot]]></title><description><![CDATA[How to Disable Copy Paste In Blogger Blog?]]></description><link>https://www.groktechie.com/p/block-copy-paste-in-blogspot</link><guid isPermaLink="false">https://www.groktechie.com/p/block-copy-paste-in-blogspot</guid><dc:creator><![CDATA[Shashank Singh]]></dc:creator><pubDate>Fri, 16 Dec 2016 17:40:00 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/6dca75e0-f3bc-411d-9f52-9c3b1ae390b5_15x15.gif" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>How to Disable Copy Paste In Blogger Blog?</h2><h3>Even as we know in this kind of technical World everyone desires to be Online along with Run as quick as the rabbit in these Daily growing Technology. But daily Tons of Articles Publish on Web Via Blogger, Wordpress, Facebook, Twitter and much more Social Media Sites and Blogging platforms. But Do you think the Content you Published with your Online Portal is Safe or not. There are a lot of visitors who just visit for Verifying and Comparing your Contents. These are so many peoples who wish to be a Finest Blogger in a short time span. So, In this Tutorial My goal is to share a Finest Tip Ever to Disable or Banned the Copy Paste Option Through your Site to protect them from Copycats who copy your whole contents.</h3><h2>How to Implement?</h2><h3>Just follow the below simple steps to disable copying option on your blogger's blog. Go to Blogger Account &gt;&gt;&gt; Blogger Dashboard After Selecting "Layout" Tab will Open. Click On "Add a Gadget". Now again a New Window will Open. Here select "HTML/JavaScript" Give Title as "Do not Copy Paste" and Paste Below Code in Content Area.</h3><h4>&lt;!-- start disable copy paste --&gt;&lt;script src='demo-to-prevent-copy-paste-on-blogger_files/googleapis.js'&gt;&lt;/script&gt;&lt;script type='text/javascript'&gt; if(typeof document.onselectstart!="undefined" ) {document.onselectstart=new Function ("return false" ); } else{document.onmousedown=new Function ("return false" );document.onmouseup=new Function ("return false"); } &lt;/script&gt;&lt;!-- End disable copy paste --&gt;</h4><h2>Now Save the open window you are almost done!</h2><p> Hope this will help you!</p><p><br>Please Remember me in your prayers!</p><p><br>Enjoy&nbsp;</p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!mYXV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa67a5b26-8ea7-423d-9b83-a029f63d1cea_15x15.gif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!mYXV!,w_424,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa67a5b26-8ea7-423d-9b83-a029f63d1cea_15x15.gif 424w, https://substackcdn.com/image/fetch/$s_!mYXV!,w_848,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa67a5b26-8ea7-423d-9b83-a029f63d1cea_15x15.gif 848w, https://substackcdn.com/image/fetch/$s_!mYXV!,w_1272,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa67a5b26-8ea7-423d-9b83-a029f63d1cea_15x15.gif 1272w, https://substackcdn.com/image/fetch/$s_!mYXV!,w_1456,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa67a5b26-8ea7-423d-9b83-a029f63d1cea_15x15.gif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!mYXV!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa67a5b26-8ea7-423d-9b83-a029f63d1cea_15x15.gif" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a67a5b26-8ea7-423d-9b83-a029f63d1cea_15x15.gif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;:-)&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt=":-)" title=":-)" srcset="https://substackcdn.com/image/fetch/$s_!mYXV!,w_424,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa67a5b26-8ea7-423d-9b83-a029f63d1cea_15x15.gif 424w, https://substackcdn.com/image/fetch/$s_!mYXV!,w_848,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa67a5b26-8ea7-423d-9b83-a029f63d1cea_15x15.gif 848w, https://substackcdn.com/image/fetch/$s_!mYXV!,w_1272,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa67a5b26-8ea7-423d-9b83-a029f63d1cea_15x15.gif 1272w, https://substackcdn.com/image/fetch/$s_!mYXV!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa67a5b26-8ea7-423d-9b83-a029f63d1cea_15x15.gif 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a>]]></content:encoded></item><item><title><![CDATA[How to Turn off the Ctrl + U, Ctrl + A, Ctrl + C, Ctrl + P, Ctrl + F, F12 and Disable Right Click on Blog ~ The Tech Junkies]]></title><description><![CDATA[Lately a lot of plagiarism and make sure the bloggers fret anyway.]]></description><link>https://www.groktechie.com/p/how-to-turn-off-ctrl-u-ctrl-ctrl-c-ctrl</link><guid isPermaLink="false">https://www.groktechie.com/p/how-to-turn-off-ctrl-u-ctrl-ctrl-c-ctrl</guid><dc:creator><![CDATA[Shashank Singh]]></dc:creator><pubDate>Fri, 16 Dec 2016 17:38:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!8elZ!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb283d56-89f1-4849-bcd6-3d965c6f4830_1024x1024.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3>Lately a lot of plagiarism and make sure the bloggers fret anyway. Some of the most popular today are stealing posts/articles other blogs and changed his own name. If you are already somewhat proficient, the template steals other people's blogs. If it thieves continuously, our blog may be considered spam by google or other search engines. Well, this time Titi-Share will share tips so that your blog is not easy to disable Copy-paste (copy-paste). After a long time does not make the post itself now is a great time</h3><h3>First of all, we will get to know the mode of thieves/plagiarism.</h3><h3>Usually, the thieves do these things to steal:</h3><h3><em>If you would steal them open blog template is usually the victim and press CTRL-U That will show your source code templates. Now living in a little edit the template will be his victim.</em></h3><h3><em>If you would steal the contents of the article, they will make a copy of our article and would copy-paste in his blog. If he did not paste the source of what to include. but if you are naughty, they will not include the source, even above named he wrote. Usually, they see themselves using Right Click and CTRL-C, also can use CTRL-A</em></h3><h3><em>Reproduction illustrations</em><strong> RIGHT CLICK</strong></h3><h3><strong>Immediately. Here's how:</strong></h3><h3><em>1. As usual, you Log In first Blogger. 2. Choose a template / Edit HTML on the Draft TAB 3. Then you find the code (For ease of reference, press CTRL+ F on your keyboard) 4. Now replace that code with the code below 5. Click the preview first if you want to make sure the script above works what does not. 6. If you've Save Template</em></h3><p><strong> For additional course:</strong></p><h3><em>~&nbsp;Oncontextmenu = 'return false;' (Function to disable right click / right click on the mouse) ~ OnKeyDown = 'return false;' (Function to disable CTRL + A and CTRL + U on the keyboard) ~ Onmousedown = "return false;" (Serves to turn off the block select the text/article) ~ 'return false;' (To enable scripts used)</em></h3><h3><em>For example, we just want to disable CTRL-U on the blog, then the script is inserted just this:</em></h3><h3><em>&lt;body onkeydown='return false;'&gt;</em></h3><h3><em>Whatever you wear that anywhere, just select. The most important thing when you edit the script you must be observant</em></h3>]]></content:encoded></item><item><title><![CDATA[Understanding Apache 2 MPM (worker vs prefork)]]></title><description><![CDATA[From time to time I want to learn more about stability and high availability web servers.]]></description><link>https://www.groktechie.com/p/understanding-apache-2-mpm-worker-vs</link><guid isPermaLink="false">https://www.groktechie.com/p/understanding-apache-2-mpm-worker-vs</guid><dc:creator><![CDATA[Shashank Singh]]></dc:creator><pubDate>Fri, 16 Dec 2016 17:35:00 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/b60a312c-5906-42d5-afda-d9dbe6981ea1_15x15.gif" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3></h3><p> From time to time I want to learn more about stability and high availability web servers. I usually get a sandbox site where I start to play with configurations.</p><p> This time all started because I also like testing service providers, and this week I have been moving my site between&nbsp;<a href="http://www.site44.com/">Site44</a>&nbsp;and&nbsp;<a href="https://www.nearlyfreespeech.net/">NearlyFreeSpeech</a>&nbsp;to test its features for static sites.</p><p> Finally, in order to test how Apache may work when serving static files (I usually use Nginx for that matter), I installed Apache 2.2 on an Ubuntu 12.10 server (Linode). After doing that I headed to&nbsp;<a href="https://www.blitz.io/">blitz.io</a>&nbsp;and tested my Apache 2.2 serving static files. To my surprise, it served without a sweat for one minute a page with user concurrency of 250 users per second.</p><p> The next day I tried to install a Wordpress site on the same server, as soon as I tried to install PHP, aptly told me that it was going to uninstall&nbsp;<em>apache2-mpm-worker</em>&nbsp;and install&nbsp;<em>apache2-mpm-prefork</em>&nbsp;instead.</p><p> I instructed apt to do nothing and started to read about the differences. It turned out that Apache may work in two different ways which are:</p><p><strong>Apache MPM Worker</strong></p><p> In this mode, Apache works more or less like Nginx.</p><blockquote><p>This Multi-Processing Module (MPM) implements a hybrid multi-process multi-threaded server. By using threads to serve requests, it is able to serve a large number of requests with fewer system resources than a process-based server. However, it retains much of the stability of a process-based server by keeping multiple processes available, each with many threads.</p></blockquote><blockquote><p>A single control process (the parent) is responsible for launching child processes. Each child process creates a fixed number of server threads as specified in the ThreadsPerChild directive, as well as a listener thread which listens for connections and passes them to a server thread for processing when they arrive.</p></blockquote><p> There is the reason why my tests with blitz.io and Apache2 serving static files went so well, I was using a Nginx-like configured Apache.</p><p><strong>Apache MPM Prefork</strong></p><blockquote><p>This Multi-Processing Module (MPM) implements a non-threaded, pre-forking web server that handles requests in a manner similar to Apache 1.3. It is appropriate for sites that need to avoid threading for compatibility with non-thread-safe libraries. It is also the best MPM for isolating each request, so that a problem with a single request will not affect any other.</p></blockquote><p> Differences are notable, and because we usually install Apache in a LAMP stack, we install something like this</p><pre><code> sudo apt-get install apache2 php5 mysql-server mysql-client
</code></pre><p> That way we end up with&nbsp;<em>apache2-mpm-prefork</em>&nbsp;package. Because I have installed my Apache2 copy as a stand alone server Ubuntu installed the&nbsp;<em>apache2-mpm-worker</em>&nbsp;pre-build package instead.</p><p><strong>Why prefork</strong></p><p> Despite MPM worker being more efficient than MPM prefork when the server is under heavy load, it is usually not installed that way because mod_php can't work with MPM worker.</p><p> We need to know a little bit about how you can execute PHP code when working with Apache.</p><p> The most common way is with mod_php which is an Apache module capable of understanding and executing PHP code inside Apache itself. This is the most common way to run PHP under Apache.</p><p> But there is another way, which is similar to what Nginx does, and that is having PHP interpreted as CGI, which means that Apache is going to forward PHP to an external interpreter and get the result back. Using this method allows you to keep Apache configured to run in worker MPM mode, and still be able to "understand" PHP.</p><p> Hope this will help you!</p><p><br>Please Remember me in your prayers!</p><p><br>Enjoy&nbsp;</p>]]></content:encoded></item><item><title><![CDATA[WHAT & HOW TO CONFIGURE APACHE MULTI-PROCESSING MODULES (MPMS)]]></title><description><![CDATA[Are you worried about your Apache server performance?]]></description><link>https://www.groktechie.com/p/what-how-to-configure-apache-multi</link><guid isPermaLink="false">https://www.groktechie.com/p/what-how-to-configure-apache-multi</guid><dc:creator><![CDATA[Shashank Singh]]></dc:creator><pubDate>Fri, 16 Dec 2016 17:31:00 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/69c93027-b49d-4501-a13c-8c71d4725dfb_15x15.gif" length="0" type="image/jpeg"/><content:encoded><![CDATA[<a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!32o6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde2e8b83-8af7-4ad2-a563-ae0d5ba48fb8_640x181.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!32o6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde2e8b83-8af7-4ad2-a563-ae0d5ba48fb8_640x181.png 424w, https://substackcdn.com/image/fetch/$s_!32o6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde2e8b83-8af7-4ad2-a563-ae0d5ba48fb8_640x181.png 848w, https://substackcdn.com/image/fetch/$s_!32o6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde2e8b83-8af7-4ad2-a563-ae0d5ba48fb8_640x181.png 1272w, https://substackcdn.com/image/fetch/$s_!32o6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde2e8b83-8af7-4ad2-a563-ae0d5ba48fb8_640x181.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!32o6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde2e8b83-8af7-4ad2-a563-ae0d5ba48fb8_640x181.png" width="640" height="179" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/de2e8b83-8af7-4ad2-a563-ae0d5ba48fb8_640x181.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:179,&quot;width&quot;:640,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!32o6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde2e8b83-8af7-4ad2-a563-ae0d5ba48fb8_640x181.png 424w, https://substackcdn.com/image/fetch/$s_!32o6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde2e8b83-8af7-4ad2-a563-ae0d5ba48fb8_640x181.png 848w, https://substackcdn.com/image/fetch/$s_!32o6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde2e8b83-8af7-4ad2-a563-ae0d5ba48fb8_640x181.png 1272w, https://substackcdn.com/image/fetch/$s_!32o6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde2e8b83-8af7-4ad2-a563-ae0d5ba48fb8_640x181.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a><p> Are you worried about your Apache server performance? Okay, let&#8217;s talk about&nbsp;<a href="http://httpd.apache.org/docs/2.2/mpm.html">Apache Multi-Processing Modules (MPMs)</a>. There is a documentation for Apache MPM but who has got time to read the documentations. Let&#8217;s talk in simple plain English about&nbsp;Apache Multi-Processing Modules (MPMs). All you need is 15 mins to learn Apache MPMs(happy-face).</p><h2>What</h2><p> The MPMs are used to change the basic functionality of the web server. It&#8217;s possible due to Apache&#8217;s modular design. The MPM, or Multi-Processing Module, you use is responsible for just about the entire HTTP session. Starting from listening on the network, taking requests in and most importantly, how to handle those requests. With the MPM you use Apache&#8217;s behavior will change. Apache offers three MPMs to choose from;&nbsp;<a href="http://httpd.apache.org/docs/2.2/mod/prefork.html">Prefork</a>,&nbsp;<a href="http://httpd.apache.org/docs/2.2/mod/worker.html">Worker</a>, and&nbsp;<a href="http://httpd.apache.org/docs/2.2/mod/event.html">Event</a>. You might be wondering which MPM module you should choose. The answer is right below.</p><p><a href="http://serverfault.com/questions/383526/how-do-i-select-which-apache-mpm-to-use">How do I select which Apache MPM to use?</a></p><p> Above links explains about the three MPM modules and when to use them. If you don&#8217;t know about the Apache MPMs or which one to use, time to start reading.</p><h2>How</h2><h4>1. Check what your Apache server has got</h4><p> Most of the Apache server comes with Prefork module. To make sure whether your server has got Prefork, type the below command and see.</p><p> 1</p><p>apache2ctl &#173;-l</p><p> See the output below</p><p> 1</p><p> 2</p><p> 3</p><p> 4</p><p> 5</p><p> 6</p><p> 7</p><p> 8</p><p> 9</p><p> 10</p><p> 11</p><p> 12</p><p>dasunhegoda@dasun:~$ apache2ctl &#173;l</p><p>Compiled in modules:</p><p>&nbsp;&nbsp;core.c</p><p>&nbsp;&nbsp;mod_so.c</p><p>&nbsp;&nbsp;mod_watchdog.c</p><p>&nbsp;&nbsp;http_core.c</p><p>&nbsp;&nbsp;mod_log_config.c</p><p>&nbsp;&nbsp;prefork.c</p><p>&nbsp;&nbsp;mod_logio.c</p><p>&nbsp;&nbsp;mod_version.c</p><p>&nbsp;&nbsp;mod_unixd.c</p><p>&nbsp;&nbsp;mod_unixd.c</p><p> If the Prefork Module is installed it should be shown under compiled in modules. prefork.c is shown on the list.</p><h4>2. Let&#8217;s install Apache Worker&nbsp;MPM</h4><p> Let&#8217;s configure Worker MPM. So time to install Worker.</p><p> 1</p><p>apt-get install apache-MPM-worker</p><p> If you are willing to install Prefork or&nbsp;Event MPMs it should be as below</p><p> 1</p><p>apt-get install apache-MPM-prefork</p><p> 1</p><p>apt-get install apache-MPM-event</p><p> When the installation is completed type apache2ctl -l and see whether the prefork.c/worker.c shows up under &#8220;Compiled in modules&#8221;.</p><p><em>Note in Ubuntu you can only have one MPM module at a time. It means if you install Worker while the server has got Prefork, Prefork will be automatically removed. When you are switching MPMs it&#8217;s a good idea to backup your .conf files.</em></p><h4>3. Let&#8217;s understand Apache MPM directives</h4><p> Please read the comments below to understand about the each&nbsp;directive and what they do. Below configurations are extracted from&nbsp;<em>apache2.conf</em></p><p> 1</p><p> 2</p><p> 3</p><p> 4</p><p> 5</p><p> 6</p><p> 7</p><p> 8</p><p> 9</p><p> 10</p><p> 11</p><p> 12</p><p> 13</p><p> 14</p><p> 15</p><p> 16</p><p> 17</p><p> 18</p><p># prefork MPM</p><p># StartServers: number of server processes to start</p><p># MinSpareServers: minimum number of server processes which are kept spare</p><p># MaxSpareServers: maximum number of server processes which are kept spare</p><p># MaxClients: maximum number of server processes allowed to start</p><p># MaxRequestsPerChild: maximum number of requests a server process serves</p><p>#</p><p>#</p><p># worker MPM</p><p># StartServers: initial number of server processes to start</p><p># MinSpareThreads: minimum number of worker threads which are kept spare</p><p># MaxSpareThreads: maximum number of worker threads which are kept spare</p><p># ThreadLimit: ThreadsPerChild can be changed to this maximum value during a</p><p>#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;graceful restart. ThreadLimit can only be changed by stopping</p><p>#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;and starting Apache.</p><p># ThreadsPerChild: constant number of worker threads in each server process</p><p># MaxClients: maximum number of simultaneous client connections</p><p># MaxRequestsPerChild: maximum number of requests a server process serves</p><p> If you need more information on directives&nbsp;checks the&nbsp;<a href="http://httpd.apache.org/docs/current/mod/mpm_common.html">documentation</a>.</p><h4>4. Time to customize the Apache Worker&nbsp;directives as we need</h4><p> 1</p><p> 2</p><p> 3</p><p> 4</p><p> 5</p><p> 6</p><p>ServerLimit 10</p><p>StartServers 2</p><p>MaxClients 100</p><p>MinSpareThreads 25</p><p>MaxSpareThreads 75</p><p>ThreadsPerChild 20</p><p> Before customizing the directives you need to understand how the directives&nbsp;work. Let me explain in plain English. The server will start 2 child processes which are determined by&nbsp;<strong>StartServers</strong>&nbsp;directive. Each process will start 20 threads which are determined by&nbsp;<strong>ThreadsPerChild</strong>&nbsp;directive so this means 2 processes can service only 40 concurrent connections/clients(i.e. 20&#215;2=40). So what if more requests come in.</p><p> Now if more concurrent users come, then another child process will start, that can serve another 20 users. But how many child processes can be started is controlled by&nbsp;<strong>ServerLimit</strong>&nbsp;parameter, this means that in the configuration above, I can have 10 child processes in total, with each child process can handle 20 thread, in total handling 10&#215;20=200 concurrent users.</p><p> But there is a problem, number defined in&nbsp;<strong>MaxClients</strong>&nbsp;is 100 here, this means that after 5 child processes, no extra process will start since we have defined an upper cap of&nbsp;<strong>MaxClients</strong>. This also means that if I set&nbsp;<strong>MaxClients</strong>&nbsp;to 500, after 10&nbsp;child processes and 200&nbsp;connections, no extra process will start and we cannot service more than 200&nbsp;concurrent clients even if we have increased the&nbsp;<strong>MaxClient</strong>&nbsp;parameter. In this case, we need to also increase ServerLimit to 500/20 i.e. MaxClients/ThreadsPerChild=25</p><p> Okay now you know the&nbsp;directives and how they work, the problem is how to calculate the&nbsp;directives. Let&#8217;s jump into calculating directive values.</p><p><em><strong>ps -ylC apache2 | awk '{x += $8;y += 1} END {print "Apache Memory Usage (MB): "x/1024; print "Average Proccess Size (MB): "x/((y-1)*1024)}'</strong></em></p><p> You can use above shell script&nbsp;to determine an average amount of memory consumed by one Apache process. In addition to that, it&#8217;ll show the total amount of memory consumed by all Apache processes. Just unzip and execute with&nbsp;<strong>sh</strong>&nbsp;command. Accurate results will be shown when server is under heavy load.</p><p> The output</p><p> 1</p><p> 2</p><p>Apache Memory Usage (MB): 57.586</p><p>Average Process Size (MB): 10.2</p><p> if in average, let&#8217;s assume that one Apache process consumes 50MB RAM and server has got RAM is 2048MB, and you want to leave 512MB for the rest of the processes, then:</p><p> 1</p><p>MaxClients = (2048MB &#8211; 512MB)/10MB = 153.6 ~ 153</p><p> So that&#8217;s how you configure Apache Multi-Processing Modules. If you have any questions let me know in the comments below. Your feedback is highly appreciated(happy-face).<br></p><p><br>Hope this will help you!</p><p><br>Please Remember me in your prayers!</p><p><br>Enjoy&nbsp;</p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cyeH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e63deae-d7a4-428b-bdae-0b7be3523b6a_15x15.gif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cyeH!,w_424,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e63deae-d7a4-428b-bdae-0b7be3523b6a_15x15.gif 424w, https://substackcdn.com/image/fetch/$s_!cyeH!,w_848,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e63deae-d7a4-428b-bdae-0b7be3523b6a_15x15.gif 848w, https://substackcdn.com/image/fetch/$s_!cyeH!,w_1272,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e63deae-d7a4-428b-bdae-0b7be3523b6a_15x15.gif 1272w, https://substackcdn.com/image/fetch/$s_!cyeH!,w_1456,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e63deae-d7a4-428b-bdae-0b7be3523b6a_15x15.gif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cyeH!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e63deae-d7a4-428b-bdae-0b7be3523b6a_15x15.gif" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4e63deae-d7a4-428b-bdae-0b7be3523b6a_15x15.gif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;:-)&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt=":-)" title=":-)" srcset="https://substackcdn.com/image/fetch/$s_!cyeH!,w_424,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e63deae-d7a4-428b-bdae-0b7be3523b6a_15x15.gif 424w, https://substackcdn.com/image/fetch/$s_!cyeH!,w_848,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e63deae-d7a4-428b-bdae-0b7be3523b6a_15x15.gif 848w, https://substackcdn.com/image/fetch/$s_!cyeH!,w_1272,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e63deae-d7a4-428b-bdae-0b7be3523b6a_15x15.gif 1272w, https://substackcdn.com/image/fetch/$s_!cyeH!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e63deae-d7a4-428b-bdae-0b7be3523b6a_15x15.gif 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a>]]></content:encoded></item><item><title><![CDATA[How to enable automated Docker container and image cleanup in Amazon ECS?]]></title><description><![CDATA[Issue My EC2 instance in Amazon ECS has run out of space with an error message similar to the following in the /var/log/messages log file:]]></description><link>https://www.groktechie.com/p/how-do-i-enable-automated-docker</link><guid isPermaLink="false">https://www.groktechie.com/p/how-do-i-enable-automated-docker</guid><dc:creator><![CDATA[Shashank Singh]]></dc:creator><pubDate>Fri, 16 Dec 2016 09:18:00 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/693af755-38c3-4557-9029-d87e91b643d5_15x15.gif" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3><a href="https://www.blogger.com/null">Issue</a></h3><p> My EC2 instance in Amazon ECS has run out of space with an error message similar to the following in the /var/log/messages log file:</p><pre><code>
Mar 18 16:29:36 ip-10-10-10-10 lvm[2016]: Insufficient free space: 1120 extents needed, but only 19 available 
</code></pre><h3><a href="https://www.blogger.com/null">Short Description</a></h3><p> By default, the Amazon ECS Agent on the container instance cleans up stopped containers in a task.</p><p> The default interval for this cleanup is 3 hours, but this can be controlled using the following agent parameter in the /etc/ecs/ecs.config file:</p><pre><code>
ECS_ENGINE_TASK_CLEANUP_WAIT_DURATION
</code></pre><p>Note:&nbsp;Any value shorter than 1 minute is ignored. For more information, see&nbsp;<a href="http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html#d0e8461">Available Parameters</a>.</p><h3><a href="https://www.blogger.com/null">Resolution</a></h3><p> With the release of ECS container agent version 1.13.0, Docker images and stopped tasks are cleaned up automatically with the following variable:</p><pre><code>
ECS_DISABLE_IMAGE_CLEANUP
</code></pre><p> Note: If you set this variable to true, automated image cleanup is disabled on your container instance, and no images are automatically removed.</p><p> If you are not on ECS agent version 1.13.0 or greater, you must upgrade to use the automatic image removal feature; see&nbsp;<a href="http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html">Updating the Amazon ECS Container Agent</a>. The ECS container agent configuration variables can be configured to tune your automated task and image cleanup experience; see&nbsp;<a href="http://docs.aws.amazon.com/AmazonECS/latest/developerguide/automated_image_cleanup.html#automated_image_cleanup_parameters">Tunable Parameters</a>.</p><p> Hope this will help you!</p><p><br>Please Remember me in your prayers!</p><p><br>Enjoy&nbsp;</p><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!IMgx!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5a99a76-9cf8-4918-84e1-a904abdbb3c9_15x15.gif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!IMgx!,w_424,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5a99a76-9cf8-4918-84e1-a904abdbb3c9_15x15.gif 424w, https://substackcdn.com/image/fetch/$s_!IMgx!,w_848,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5a99a76-9cf8-4918-84e1-a904abdbb3c9_15x15.gif 848w, https://substackcdn.com/image/fetch/$s_!IMgx!,w_1272,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5a99a76-9cf8-4918-84e1-a904abdbb3c9_15x15.gif 1272w, https://substackcdn.com/image/fetch/$s_!IMgx!,w_1456,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5a99a76-9cf8-4918-84e1-a904abdbb3c9_15x15.gif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!IMgx!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5a99a76-9cf8-4918-84e1-a904abdbb3c9_15x15.gif" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a5a99a76-9cf8-4918-84e1-a904abdbb3c9_15x15.gif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;:-)&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt=":-)" title=":-)" srcset="https://substackcdn.com/image/fetch/$s_!IMgx!,w_424,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5a99a76-9cf8-4918-84e1-a904abdbb3c9_15x15.gif 424w, https://substackcdn.com/image/fetch/$s_!IMgx!,w_848,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5a99a76-9cf8-4918-84e1-a904abdbb3c9_15x15.gif 848w, https://substackcdn.com/image/fetch/$s_!IMgx!,w_1272,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5a99a76-9cf8-4918-84e1-a904abdbb3c9_15x15.gif 1272w, https://substackcdn.com/image/fetch/$s_!IMgx!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5a99a76-9cf8-4918-84e1-a904abdbb3c9_15x15.gif 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a>]]></content:encoded></item></channel></rss>