Information
When you use the AWS Management Console to create a load balancer in a VPC, you can choose an existing security group for the VPC or create a new security group for the VPC. If you choose an existing security group, it must allow traffic in both directions to the listener and health check ports for the load balancer. If you choose to create a security group, the console automatically adds rules to allow all traffic on these ports.
Be sure to review the security group rules to ensure that they allow traffic on the listener and health check ports for the new load balancer. When you delete your load balancer, this security group is not deleted automatically.
If you add a listener to an existing load balancer, you must review your security groups to ensure they allow traffic on the new listener port in both directions.
The web-tier ELB is the only one public facing and should have rules to allow inbound traffic the application ports (ex: HTTP and HTTPS) from any IP source (0.0.0.0/0).
The outbound security group rules for the web-tier ELB should be restricted to only the backend web-server instances for the appropriate application ports.
Associating the web-tier ELB security group to any other instances that shouldn't be publicly accessible exposes them to unauthorized access.
Solution
Using the Amazon unified command line interface:
* Create new launch configuration using the correct security groups for Web and/or App tier:
aws autoscaling create-launch-configuration --launch-configuration-name _<web_tier_launch_config>_ --image-id _<web_tier_ami>_ --key-name _<your_key_pair>_ --security-groups _<web_tier_security_group>/<app_tier_security_group>_ --instance-type _<desired_instance_type>_ --iam-instance-profile <we_b_tier_instance_profile>/_<_app_tier_instance_profile>_