AWS - Understanding Security Group
![Image](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9KTeiTHIfV6s7I4ROhz6Nc5JyuozGkUgQ92e1BSwnoe5jGmRlTpwM-BZbk3oL7Ao3Gmn-MYi9qI-VE8GclQ2ZVyjXRq3AphW2qIwOIjVhi8DnoahVbyWW7kHCOpLcDnYo8wvNF2481AvkRJcwOv_DhcGkGP8QHlImo8OufZXU6sMmZjwthLFyLlpTaM8/s320/63178de0492be32979c9acf7_aws-logo.png)
In this post will go in detail on a simple ALB to EC2 setup. I am configuring NodeJS on my EC2 instance. [root@ip-172-31-9-46 ~]# yum install npm [root@ip-172-31-9-46 ~]# npm install express Starting the application using the below command. [root@ip-172-31-9-46 ~]# node app.js App1 is listening on port 3000 App2 is listening on port 4000 Now, I configured a target group: In the target group we must give the application port and health check port . NOTE: We cannot mention any security group under Target group. Next, I am going to create a ALB. Our ALB listens on port 80. So the ABL DNS/welcome should route the traffic to backend machine. Eg: http:// demo-alb-123456.us-east-1.elb.amazonaws.com/welcome Now, our EC2 instance at the backend should accept traffic from ALB on port 3000/4000. Even though ALB has an IP address range which is dynamic, so create a security group based on IP is not the right solution. Hence, we will create a security group and attach to ALB. This ...