<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by AadityaSuhag on Medium]]></title>
        <description><![CDATA[Stories by AadityaSuhag on Medium]]></description>
        <link>https://medium.com/@adityasuhag?source=rss-ec60f624b2eb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*5bHmtWp_KUTHYsgUrvFTHQ.png</url>
            <title>Stories by AadityaSuhag on Medium</title>
            <link>https://medium.com/@adityasuhag?source=rss-ec60f624b2eb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 11:25:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@adityasuhag/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to remove public IP from ec2 and route its all traffic through ALB(Application Load Balancer)]]></title>
            <link>https://medium.com/@adityasuhag/how-to-remove-public-ip-from-ec2-and-route-its-all-traffic-through-alb-application-load-balancer-c31114b8ecac?source=rss-ec60f624b2eb------2</link>
            <guid isPermaLink="false">https://medium.com/p/c31114b8ecac</guid>
            <dc:creator><![CDATA[AadityaSuhag]]></dc:creator>
            <pubDate>Wed, 10 Jun 2020 08:47:29 GMT</pubDate>
            <atom:updated>2020-06-11T08:45:29.805Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello Everyone,</p><p>Most of the times, to add an extra layer of security we want to remove public DNS of ec2 instance and want to make it completely private.</p><p>Apparently I faced a lot of issues while making an EC2 private and route the traffic through ALB.</p><p>After tons of research — I found these simple steps:-</p><ol><li>Create the image of the instance from the Actions drop-down by select create image option from the images.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/527/1*ZBmtXTgRjfLubZe14huTVA.png" /></figure><p>2. Let’s add public and private subnets for this demonstration. You can use existing VPC and follow rest of the applicable steps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*asM9obo52PE1uJR7J9Jy2w.png" /></figure><p>3. Create Internet Gateway and attach it with the VPC</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*Ajuu769ZhMfT1Ol3uXcmQw.png" /></figure><p>4. Create a NAT Gateway and map an Elastic IP address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/937/1*KF-5N8vVmBwp2KySmrVZDA.png" /></figure><p>5. Create one route table each for public and private subnets. Edit the route table for the public subnet and add default route of 0.0.0.0/0 to go through Internet Gateway. Similarly, edit the route table for the private subnet and add default route of 0.0.0.0/0 to go through NAT gateway.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qmd5ybfc7aH9HGL-wWWa1Q.png" /></figure><p>6. Let’s create a new security group which will be used. This security group will have NO inbound rules and all the outbound traffic will be allowed, which also default in case of security groups.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I6iuhGCQo3BWxvtesTnvQA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xs7QBCoG-2FXH0ey-OAp_A.png" /></figure><p>7. Create an AMI of the instance and launch the instance in a private subnet, in availability zone “xx-xxxxx-xx”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*OWu_J0DgJUqmDQjZfV3KDA.png" /></figure><p>Note: The public subnet should be in the same VPC and availability zone as the instance.</p><p>8. Create an application load balancer and ensure that “Same subnet of the Instance” is enabled.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CXdeMZYN_EijSo7Xo6sp-A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PHXunhbx_lv3lNhVP8TDvg.png" /><figcaption>Click on Create an Application Load Balancer panel</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RyIw_hf8NIBIXf06rgwIxQ.png" /><figcaption>Choose internet-facing</figcaption></figure><p>You want HTTPS site redirection also then you can add HTTPS listener by clicking on <strong>Add listener</strong>. You also need to have an <a href="https://ap-south-1.console.aws.amazon.com/acm/home">ACM</a> certificate in the same region else you can’t create ALB with HTTPS listener.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OT6mZIqVITYug3TaqgTRrQ.png" /><figcaption>Only required to incase you want to redirect an HTTPS website</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y9tNNHBxfaqNK36270tKdw.png" /><figcaption>Select at least 2 subnets</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LNte19Z8QBkUcGJLeh3zOQ.png" /><figcaption>Select a certificate matching to the site domain names</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mSUKyGtkll2XMGCTnLnVcA.png" /><figcaption>You can use custom TCP or the HTTPS option here</figcaption></figure><p>Add a rule on the instance security group to allow traffic from the security group assigned to the load balancer</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rIuPZ2er108AkiYyLe2nLg.png" /></figure><p>Create a target group and register the instance launched in the private subnet from the AMI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f1DXGSFEXBkStBjo_3dRgQ.png" /><figcaption>Select or Create Target Group</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EJVS-CcAeM8oPkpUSY8_rw.png" /><figcaption>Review Target Instances</figcaption></figure><p>9. Test the load balancer DNS to see if it works</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JwB4-udC9RS6rnaDkh2PYA.png" /><figcaption>Copy the DNS of the Load Balancer.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r684IordCuKNizKKYT8OxA.png" /><figcaption>Copy the DNS in a new tab of the browser and confirm your website it’s working.</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c31114b8ecac" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>