<?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 Sathish Kumar Elangoven on Medium]]></title>
        <description><![CDATA[Stories by Sathish Kumar Elangoven on Medium]]></description>
        <link>https://medium.com/@sathishkumar13121998?source=rss-d388c5703c14------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Sathish Kumar Elangoven on Medium</title>
            <link>https://medium.com/@sathishkumar13121998?source=rss-d388c5703c14------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 15:03:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sathishkumar13121998/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[AWS VPC for Production]]></title>
            <link>https://medium.com/@sathishkumar13121998/aws-secure-vpc-deployment-with-ec2-instances-and-scalable-application-hosting-2975b7f15f5b?source=rss-d388c5703c14------2</link>
            <guid isPermaLink="false">https://medium.com/p/2975b7f15f5b</guid>
            <dc:creator><![CDATA[Sathish Kumar Elangoven]]></dc:creator>
            <pubDate>Mon, 06 Jan 2025 01:23:45 GMT</pubDate>
            <atom:updated>2025-01-25T22:54:22.600Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Project Description</strong></p><p>This project focuses on creating a secure and scalable Virtual Private Cloud (VPC) using AWS services. The VPC will have both public and private subnets across two Availability Zones for high availability. EC2 instances will be launched in the private subnets, ensuring they are not directly accessible from the internet. Public subnets will host a Load Balancer and NAT Gateway to manage traffic and provide internet access to the private servers. This setup includes configuring proper network security, routing, and using Auto Scaling to ensure that your infrastructure can handle varying traffic loads.</p><p><strong>Project Implementation</strong></p><ul><li>Create a VPC with custom IP ranges.</li><li>Set up public and private subnets in two Availability Zones for high availability.</li><li>Implement route tables and associate them with the respective subnets.<br>Set up security groups for EC2 instances to allow necessary traffic (e.g., HTTP, HTTPS, SSH).</li><li>Configure network ACLs to control inbound and outbound traffic to/from subnets.</li><li>Deploy a Load Balancer in the public subnet to distribute traffic to EC2 instances.</li><li>Set up Auto Scaling for EC2 instances to automatically scale up or down based on traffic.</li><li>Deploy EC2 instances in private subnets and configure them to receive traffic from the Load Balancer.</li><li>Set up a NAT Gateway in the public subnet to allow EC2 instances in private subnets to access the internet.</li><li>Implement IAM roles and policies for EC2 instances to control access to AWS resources.</li><li>Generate an SSH key pair for secure access to the EC2 instances.</li><li>Test and validate connectivity by SSH in the instances, and test traffic flow between the public and private subnets.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/611/0*66tFj-S23kG0tBXF.png" /></figure><p><strong>Step 1 : Create a VPC (Virtual Private Cloud)</strong></p><p>A VPC is a private network in the AWS cloud where you can set up and control your resources, like servers (EC2 instances), databases, and storage. It’s isolated from other networks for security.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*LZ6fZTUU4bSA8RPEO2ITDA.png" /></figure><p>Click on ‘Create VPC’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Gdap5I5BDcQePaIo7UdQ3g.png" /></figure><p>An IPv4 CIDR block is a range of IP addresses used in your VPC. It defines the network’s address space. For example, 10.0.0.0/16 means the range of IPs from 10.0.0.0 to 10.0.255.255.</p><p>An IPv6 CIDR block is a range of IPv6 addresses, just like IPv4, but it uses a longer address format. It allows for a much larger pool of IP addresses, necessary for modern internet devices.</p><p>Tenancy refers to how your EC2 instances are placed on physical servers :</p><ul><li>Default Tenancy : EC2 instances share physical servers with other AWS customers, which is more cost-effective.</li><li>Dedicated Tenancy : EC2 instances run on dedicated physical servers just for your use, providing more isolation but costing more.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*oDUX7E1WQ52gkaj3kwpNoQ.png" /></figure><p>Availability Zones (AZs) are separate data centers within a region, each with its own power, cooling, and networking. They allow you to deploy resources in multiple locations for better reliability and fault tolerance.</p><p>A public subnet is a part of your VPC where resources (like EC2 instances) can directly access the internet, usually via an internet gateway.</p><p>A private subnet is a part of your VPC where resources (like EC2 instances) cannot directly access the internet. They are used for internal services, and they access the internet via a NAT Gateway.</p><p>A NAT Gateway allows instances in private subnets to connect to the internet for things like updates or API calls, without letting external internet traffic directly reach those instances.</p><p>VPC Endpoints allow your VPC to connect directly to AWS services without using the internet. They provide a secure, private connection to services like S3 and DynamoDB. There are two types: Interface Endpoints (using private IPs) and Gateway Endpoints (for services like S3 and DynamoDB).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*mMR91HAT1HLCY4cfeviVJQ.png" /></figure><p>A Route Table in AWS VPC is like a map that tells your network how to send traffic. It contains rules (called routes) that define where data should go based on the destination IP address.</p><ul><li>Each route has a destination (a range of IP addresses) and a target (where to send the traffic, like the internet or another network).</li><li>The default route table is automatically created when you make a VPC, and it allows communication between all subnets inside the VPC.</li><li>You can also create custom route tables to control traffic, like making sure private subnets can access the internet through a NAT Gateway.</li></ul><p>In simple terms, route tables help AWS know where to send traffic inside your VPC or to the outside world (like the internet).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/791/1*P8bw3PYzAkUbQgmDDY8bGQ.png" /></figure><p>Enable DNS hostnames : This option allows EC2 instances in your VPC to have public DNS names (like ec2-xx-xx-xx-xx.compute-1.amazonaws.com). These names help identify and access instances easily. You should enable this if you need your instances to be reachable by a DNS name (for example, when using services like load balancers or connecting with a web browser).</p><p>Enable DNS resolution : This option allows the VPC to resolve DNS queries for resources inside the VPC, like private hostnames or domain names. It enables communication with internal AWS services using their DNS names (like connecting to a private RDS database by its DNS name).</p><p>Click on ‘Create VPC’.</p><p><strong>Step 2 : Create an Auto Scaling Group</strong></p><p>Navigate to the EC2 dashboard and access the Auto Scaling Groups section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*_1QBtopCcAEZdt7nKo3b4g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*ChW-WmHT4LisWTpN47Zq4Q.png" /></figure><p>An Auto Scaling Group in AWS automatically adjusts the number of EC2 instances based on traffic. It adds more instances when traffic is high and removes them when traffic is low, helping to manage resources efficiently and save costs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*RH3T29lZJQ7ypSoYXStocg.png" /></figure><p>Click on ‘Create a launch template’.</p><p>A Launch Template in AWS is a configuration that defines the settings for launching EC2 instances in an Auto Scaling Group. It includes details like the AMI (Amazon Machine Image) to use, instance type, key pair for SSH access, security groups, and storage settings. Launch templates simplify the process of creating and managing consistent EC2 instances by reusing the same configuration across the Auto Scaling Group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*WHiLKOduBgvUGZetO1owzg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*cx4YMgBqz_1_qzRg__Cftg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*kEev0GxGMUULVhsKRXKmwg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*YPg0pEgMAv-YUIptagHy4Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*MfinCEou8L00CfzTMaM2lA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*lQ9EjgLFbsqj67ejInXmYQ.png" /></figure><p>Click on ‘Create launch template’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*1dibRhRWA3v0IObilW0hcw.png" /></figure><p>Now, go back to create the Auto Scaling Group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*FPs3MoS9ElsS_GSHUVw3kQ.png" /></figure><p>Choose the launch template that we just created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*r575F-x-nOhDx-fLW7KRqw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*PIRO4X_D8qh42AkmVANzpg.png" /></figure><p>Choose the VPC that we just created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*1QMn-3nt707eEuwz_8vD6Q.png" /></figure><p>Choose the private subnets where we will host the application.</p><p>Availability Zone Distribution refers to how your EC2 instances in an Auto Scaling Group are spread across different Availability Zones (AZs) for high availability and fault tolerance. By distributing instances across multiple AZs, your application can handle failures in one AZ without affecting overall performance.</p><p>Balanced Best Effort and Balanced Only are scaling policies for Auto Scaling Groups:</p><ul><li>Balanced Best Effort : This option tries to evenly distribute instances across AZs, but with a bit more flexibility for scaling.</li><li>Balanced Only : This option strictly ensures that the number of instances is balanced equally across AZs.</li></ul><p>In short, these options help you decide how to distribute and balance your EC2 instances across multiple AZs in an Auto Scaling Group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*XJrMHEGmrY68Y0UIiR5p6g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*YOehYKHu6WLVMS7N8djmuQ.png" /></figure><p>Health Check Grace Period is the time given to new EC2 instances to start and become fully operational before Auto Scaling starts checking their health. During this period, Auto Scaling does not consider the instance unhealthy, even if it isn’t responding yet.</p><p>This is useful to avoid terminating instances prematurely before they have a chance to initialize properly. You can set this period based on how long your instances typically need to be fully ready.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*fy69WBiyx0-FFm3MpAUn0g.png" /></figure><p>Desired Capacity in AWS Auto Scaling refers to the ideal number of EC2 instances you want running in your Auto Scaling Group. This is the target number of instances that Auto Scaling will try to maintain based on the demand and scaling policies.</p><p>Scaling Limits :</p><ul><li>Min Desired Capacity : This is the minimum number of EC2 instances that Auto Scaling will maintain, even during low traffic periods. It ensures there are always at least this many instances running.</li><li>Max Desired Capacity : This is the maximum number of EC2 instances that Auto Scaling can scale up to, based on traffic or demand. It sets an upper limit on the number of instances to avoid excessive resource usage.</li></ul><p>In short, Desired Capacity is your target instance count, while Min and Max Desired Capacity define the lower and upper limits for scaling.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*9NgICsWDX0bcRzP6ac72_w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*OojLkHWKhKHCP2bCbDOQUQ.png" /></figure><p>Capacity Reservation Preference in AWS Auto Scaling allows you to specify whether you want your Auto Scaling Group to use Capacity Reservations to guarantee the availability of EC2 instances in a specific Availability Zone (AZ). Capacity reservations ensure that resources are reserved for your instances, preventing delays in instance launches due to insufficient capacity in the chosen AZ.</p><ul><li>Default : If you select the default option, Auto Scaling does not use Capacity Reservations. Instances will be launched based on available capacity in the selected AZ, without reserving any capacity.</li><li>None : No capacity reservation is used. Auto Scaling will not attempt to reserve capacity for instances, and instances will be launched when capacity is available.</li><li>Capacity Reservations Only : This option forces Auto Scaling to only launch instances in already reserved capacity. The group will use only the capacity that you’ve specifically reserved in a Capacity Reservation.</li><li>Capacity Reservations First : This option will attempt to launch instances using reserved capacity first, and if there’s not enough reserved capacity, it will fall back to using available capacity without reservations.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*mWUrqnVu45Kphov9sY5Ceg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*2cjIt8Wb1ym1EpHCTmSs9w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Mw90incNSMKBcUfoJ40yvQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*vrrkU4K8S7HQffoB5t3FiQ.png" /></figure><p>Click on ‘Create Auto Scaling group’.</p><p>Now, go and check the EC2 instances.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*bD5tNI-fTHHxWBwXt10OGQ.png" /></figure><p>An EC2 instance is a virtual server that you can use to run applications and services in the cloud. It provides computing power, storage, and networking capabilities, similar to a physical server but on a virtual machine. You can choose the size, operating system, and other configurations for the EC2 instance based on your requirements.</p><p><strong>Step 3 : Create a Bastion Host</strong></p><p>A Bastion Host is a special EC2 instance used to securely access other instances in a private subnet. It acts as a jump server, allowing you to connect to private instances through SSH (for Linux) or RDP (for Windows) from the public internet while keeping your private instances safe from direct internet access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*XjgLD4gr_WMCudk1TuyYnA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*hoL_hNH93MbO4m_Y1XAKVg.png" /></figure><p>An AMI (Amazon Machine Image) is a pre-configured template in AWS that contains the operating system, software, and settings required to launch an EC2 instance. It acts as a blueprint for creating new instances quickly and consistently.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*fgVrWq4QnlvyRP-9uFcygA.png" /></figure><p>An Instance type defines the size and resources (CPU, memory, storage) of an EC2 instance. It determines the performance and cost of the instance based on your needs.</p><p>A Key pair is a set of security credentials used to log in to an EC2 instance. It includes a public key (stored on AWS) and a private key (downloaded by you). The private key is used to securely access the instance via SSH (for Linux) or RDP (for Windows).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*4cGZ9yddL2ctkfQApL3Chw.png" /></figure><p>Choose the VPC that we just created.</p><p>Choose the public subnet.</p><p>Auto-assign public IP automatically assigns a public IP address to an EC2 instance when it’s launched in a public subnet, allowing the instance to be accessed from the internet.</p><p>A Firewall (Security Group) is a virtual barrier that controls incoming and outgoing traffic to your EC2 instances. It acts as a filter, allowing only certain types of network traffic (such as specific IP addresses or ports) to reach your instance, helping secure it from unauthorized access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*ZWKGFAFuqUQFmxX-BCcxMg.png" /></figure><p>Inbound Security Group rules control the incoming network traffic to your EC2 instance. These rules specify which sources (IP addresses, ports, or protocols) are allowed to access the instance. They act as a filter to control which traffic can enter the instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*tQf53whywjh11K1boj4xeg.png" /></figure><p>Configure Storage refers to setting up the disk space (storage) for your EC2 instance. You can choose the type, size, and number of storage volumes (such as EBS) to be attached to the instance for storing data or applications.</p><p>Click on ‘Launch instance’.</p><p><strong>Step 4 : Connect to the bastion-host EC2 instance using MobaXterm</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*acP5_y6K-CnVpkMq5C3m5w.png" /></figure><p>Now, upload the private key (.pem file) to the bastion host using the command below in the command prompt. The private key is used to securely access the instance via SSH (for Linux) or RDP (for Windows).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Hh6I8YnP0TIYvzwJxPF01g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*7KuRx5RlB1EAedaM--aPqw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*fvn--G_S9VcVhKiJbBzMtg.png" /></figure><p>We need the private key (.pem file) here because it is required to log into the other EC2 instances in the private subnet, which does not have a public IP address.</p><p>Now, let’s log in to the EC2 instance in the private subnet and copy the private IP address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*wpBZrrSOzAdSz5xW_ABp5A.png" /></figure><p>Copy the private IPv4 address of one of the EC2 instances in the private subnet and run the command below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*d7HOPte8M6Lp2MeCC-6shg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*UyE4C1l6u_M6uJeEytVomQ.png" /></figure><p>Ensure that the private key file is only readable by the file owner. SSH will reject keys with overly permissive permissions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*AMQD0ykOFiODMy-wPHv8zw.png" /></figure><p>Now, create a file named index.html and add some HTML code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*WKzbOMtNEJKbTyo68MlNTg.png" /></figure><p>Now, run the Python server on port 8000.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*6pQiu8JXsSAAlY1ogxuWpw.png" /></figure><p><strong>Step 5 : Create a load balancer and attach the instances in the private subnet as target groups</strong></p><p>Navigate to the EC2 page and go to the Load Balancers section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*yc-i19twTmKWLifFqnDTgw.png" /></figure><p>Click on ‘Create load balancer’.</p><p>Let us create an Application Load Balancer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*DI4cagCQxLVUkYn4PV1xRw.png" /></figure><p>A Load Balancer is a service that distributes incoming traffic across multiple EC2 instances to ensure no single instance gets overwhelmed. It helps improve the availability and fault tolerance of your application.</p><p>An Application Load Balancer (ALB) is a type of load balancer designed to handle HTTP and HTTPS traffic. It works at the application layer (Layer 7) and can route traffic based on specific URL paths or hostnames, making it ideal for web applications and microservices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Fsx72f5qTps2Ym8eDo3CKQ.png" /></figure><p>The scheme defines whether the load balancer is accessible from the internet or only within a private network.</p><ul><li>Internet-facing : This means the load balancer is accessible from the internet, allowing external users to access your application.</li><li>Internal : This means the load balancer is only accessible within your private network, and traffic can’t come from the internet. It’s used for internal services or applications.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*q272L5DBOgz6xH7XggdsNw.png" /></figure><p>Load Balancer IP Address Type defines the types of IP addresses the Application Load Balancer can use :</p><ul><li>IPv4 : The load balancer uses only IPv4 addresses to handle traffic. It’s suitable for networks that only support IPv4.</li><li>Dualstack : The load balancer uses both IPv4 and IPv6 addresses, allowing it to handle traffic from both IPv4 and IPv6 clients.</li><li>Dualstack without public IPv4 : The load balancer uses both IPv6 and private IPv4 addresses but does not have a public IPv4 address. This setup is used for internal services that don’t need public-facing IPv4 addresses.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*6DIkchOPVMkf2mh9--3cYA.png" /></figure><p>Network mapping refers to how the load balancer is connected to your network infrastructure, specifically :</p><ul><li>VPC : The Virtual Private Cloud (VPC) defines the network where the load balancer will operate, specifying the private network environment for your application.</li><li>Availability Zones : Availability Zones (AZs) are separate data centers within a region. When configuring a load balancer, you map it to one or more AZs to ensure high availability and distribute traffic across multiple locations for better fault tolerance.</li></ul><p>Select the VPC that we just created.</p><p>Select the public subnets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*rhU0g074vVxHFB6_TjzxQw.png" /></figure><p>A Security Group acts as a virtual firewall that controls the traffic allowed to reach the load balancer. It defines rules for inbound and outbound connections, such as which IP addresses or ports can send traffic to the load balancer. This helps protect the load balancer from unauthorized access and ensures that only valid traffic can reach your application, enhancing security. For example, you might allow HTTP and HTTPS traffic from the internet while blocking other types of traffic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*8OONEy1NGJGxjwP_2vdDjw.png" /></figure><p>Click on ‘Create target group’.</p><p>A Target Group is a group of resources, such as EC2 instances, that an Application Load Balancer (ALB) directs traffic to. When a request comes to the load balancer, it routes the traffic to one of the instances in the target group based on the defined routing rules. The target group helps manage and organize the instances that the load balancer forwards traffic to, enabling efficient load distribution and health checks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*G_VEkZjiLAV0p--UOk7OeQ.png" /></figure><p>Target Type defines the type of resource that the load balancer routes traffic to in a target group.</p><ul><li>Instances : The target group routes traffic to EC2 instances.</li><li>IP addresses : The target group routes traffic to IP addresses, which can be used for resources outside of AWS or within a VPC.</li><li>Lambda function : The target group routes traffic to AWS Lambda functions.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*lNrmlJ5ofvqfPtnhy49l5Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Pu6r08worRtpvJlDc1W0JQ.png" /></figure><p>Protocol and Port define how traffic is communicated between the load balancer and the target in a target group.</p><ul><li>Protocol : Specifies the communication protocol (e.g., HTTP, HTTPS, TCP) used to send traffic between the load balancer and the target.</li><li>Port : Specifies the port number on the target (e.g., port 80 for HTTP or port 443 for HTTPS) that the load balancer uses to send traffic.</li></ul><p>Together, they define how the traffic is routed and how the load balancer communicates with the target.</p><p>IP Address Type defines the type of IP addresses the load balancer will use.</p><p>VPC ensures that the load balancer can route traffic to the correct resources (like EC2 instances) within the same network. It helps ensure proper routing and security within your cloud environment.</p><p>Protocol Version refers to the version of the communication protocol used for routing traffic to the target group. The options are :</p><ul><li>HTTP/1.1 : The standard version of HTTP used by most web applications. It handles requests one at a time, which can slow down performance with many simultaneous requests.</li><li>HTTP/2 : A newer version of HTTP that allows multiple requests to be sent over a single connection, improving performance and efficiency.</li><li>gRPC : A modern, high-performance protocol mainly used for communication between services, supporting features like streaming and bidirectional communication, making it suitable for microservices.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*piS52AMAr7HwRPk440_n-A.png" /></figure><p>Health Checks are used to monitor the status of targets (like EC2 instances) in a target group. They ensure that the load balancer only sends traffic to healthy, functional instances.</p><ul><li>Health Check Protocol : This specifies the protocol (e.g., HTTP, HTTPS, TCP) that the load balancer uses to check the health of the target. For example, if the protocol is HTTP, the load balancer will try to make an HTTP request to the target.</li><li>Health Check Path : This is the specific URL path that the load balancer uses to check the health of the target (e.g., “/health” or “/status”). The target should respond successfully to this request for it to be considered healthy.</li></ul><p>These settings help the load balancer avoid sending traffic to instances that are not functioning properly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*bjJi7B4IQVQ-Zqwo6kfP9w.png" /></figure><p>Register Targets refers to the process of adding resources (such as EC2 instances or IP addresses) to a target group so that the load balancer can route traffic to them. When you register targets, you’re telling the load balancer which resources to send traffic to based on the routing rules you define. Only the registered targets in the target group will receive traffic from the load balancer.</p><p>Select the EC2 instances in the private subnet.</p><p>Click on ‘Include as pending below’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*P3QiilYIhHToxMKxH4yfxQ.png" /></figure><p>Click on ‘Create target group’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*JluKrlyUGRT7imW__I38EQ.png" /></figure><p>Now, go back to the Load Balancer creation page and select the target group you created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*DJxyCWLrupdvcxTZNqjvWg.png" /></figure><p>Listeners and Routing help manage how an Application Load Balancer (ALB) handles incoming traffic :</p><ul><li>Listeners : They are processes that listen for incoming requests on specific ports (like port 80 for HTTP or port 443 for HTTPS). They define how the load balancer will respond to incoming traffic.</li><li>Routing : It is the process of directing the incoming traffic to the appropriate target group based on rules, such as URL paths or request types. In short, listeners receive the traffic, and routing decides where to send it based on defined rules.</li></ul><p>Attaching a target group to the listener in an Application Load Balancer (ALB) is essential because it defines where the incoming traffic should be sent.</p><p>A target group contains the resources (like EC2 instances) that will handle the requests from the load balancer. When the listener receives incoming traffic, it uses the routing rules to determine which target group should receive the traffic.</p><p>In short, attaching a target group ensures that the ALB knows where to forward the traffic for processing by your application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*guNNctDSvmPXLvCmZ1tSxw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*ziOTpbzrLnQBX_6GOyP8vA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*b_GZYXFgxeTjwDuBvQ8kCw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*pEx9uHykqc5ttnoAgUkhtw.png" /></figure><p>Click on ‘Create load balancer’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*pmxvmFMP5eRhhrhn_x5K5A.png" /></figure><p><strong>Step 6 : Edit the security group and create a new inbound rule to allow access to port 80</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*7LfLX9s0zDci2-Cyq3zOXQ.png" /></figure><p>Click on ‘Edit inbound rules’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*I96aEYf2RCBFToYcvSAUoQ.png" /></figure><p>Add a new inbound rule to allow access to port 80.</p><p>Click on ‘Save rules’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*6HGUibJjV5_AaF13fwhzqg.png" /></figure><p>Copy the DNS name.</p><p><strong>Step 7 : Access the Web Application Using the DNS Name</strong></p><p>Paste the copied DNS name into the browser’s address bar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*1KrKlK4vCbsGc1mguId1_w.png" /></figure><p>We have now demonstrated an app in the private subnet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*3StAvpvNqXPE30gmBqx3LA.png" /></figure><p>We have not implemented a project on another EC2 instance in the private subnet. The target group we created has a health check, and it only forwards traffic to the healthiest EC2 instance.</p><p>Now, we can log in to the EC2 instance in the other private subnet and deploy an app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*T_NGWeByf3douZk6upHBJg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*18PxEYUdmVMXLxmlkhF-Kw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*eZuPkjlaOrmfQsJpPIFOqQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*SBUWbdjuBDRwrRHUMrr2tQ.png" /></figure><p>Now, let us modify the HTML page on one of the EC2 instances in the private subnet and check if the response received from this EC2 instance is different from the other.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*FxvLhUqWQ0q4GS5XbRHB8Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*ZArJyh6iOkTARYZvlcj_bw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2975b7f15f5b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>