AWS Internal Load Balancer Using CLI
The Classic Load Balancer & Application Load Balancer are the external load balancers which could be access by external client over Internet having public IP addresses hence external load balancer routes the request from client over Internet but some times we need to load balance internal services which are not accessible by external clients.
For example: In AWS bunch of micro services which is only used by AWS Infrastructure internally so to balance the load of these internal services we can use Internal Load Balancer.
The Internal load balancer only have private IP address and therefore internal load balancer only route request from client which have VPC access.
For example: If our application has multiple tiers like web server connected to Internet and Database server that only connected to Web server. So in this case we can create a Internal Load Balancer for Database Server. Web Server will receive request from External Load Balancer and send request to Database Server via Internal Load Balancer and DB Server receives request from Internal Load Balancer and will respond to Web Server.
Lets see...
How To Create Internal Load Balancer Using AWS CLI:
$ aws elb create-load-balancer --load-balancer-name pgelbinternal --listeners "Protocol=HTTP,LoadBalancerPort=80,InstanceProtocol=HTTP,InstancePort=80" --scheme internal --subnets EnterSubnetsIds --security-groups EnterSecurityGroupID
aws elb create-load-balancer --load-balancer-name my-internal-loadbalancer --listeners Protocol=HTTP,LoadBalancerPort=80,InstanceProtocol=HTTP,InstancePort=80
--subnets subnet-4e05f721 --scheme internal --security-groups sg-b9ffedd5
To create internal load balancer we need to use following command and parameters:
Command: aws elb create-load-balancer
Parameters:
load-balancer-name : Load Balancer Name
listeners : Load balancer listener
scheme : IN this parameter we need to pass value 'internal' because by default it will consider 'external' which means public internet facing load balancer.
subnets : Subnet Ids
security-group : Security group Ids
Output: It will show one DNS with prefix 'internal' like "internal-pgelbinternal-021252222.region.elb.amazonaws.com"
We can also verify it from AWS management console by clicking on Load Balancer menu.
Lets see...
How To Register Instances With Internal Load Balancer:
$ aws elb register-instances-with-load-balancer --load-balancer-name pgelbinternal --instances EnterInstanceID
To register instance with internal load balancer we need to use following command and parameters:
Command: aws elb register-instances-with-load-balancer
Parameters:
load-balancer-name : Internal Load Balancer Name which we want to register with instance
instances : Instance Id which we want to register with Internal Load Balancer
We can verify it from AWS console by clicking 'Load Balancer' menu and click on "Instance" tab
or
CLI command aws elb describe-load-balancers --load-balancer-name pgelbinternal
How To De-register Instances From Internal Load Balancer:
$ aws elb deregister-instance-from-load-balancer --load-balancer-name pgelbinternal --instances EnterInstanceID
To de-register instance with internal load balancer we need to use following command and parameters:
Command: aws elb deregister-instances-from-load-balancer
Parameters:
load-balancer-name : Internal Load Balancer Name which we want to deregister from instance
instances : Instance Id which we want to deregister from Internal Load Balancer
We can verify it from AWS console by clicking 'Load Balancer' menu and click on "Instance" tab
How To Delete Internal / External Load Balancer Via AWS CLI:
$ aws elb delete-load-balancer --load-balancer-name pgelbinternal
PHP Web Technology Funda | AWS Cloud
Read my blog here : https://www.howtoinmagento.com/
Tips & Tricks of PHP Frameworks & AWS Cloud Computing
aws certification,aws config,install aws cli,aws iam,aws tutorial,aws docker,elb,amazon certification,amazon ecs,aws autoscaling,aws elb,aws load balancer,aws cert,aws server,aws command line tools,elastic load balancer,aws alb,aws application load balancer,aws cdn,aws cli configure,aws cli ec2,aws container service,amazon elb,application load balancer,aws cli lambda,aws elastic load balancer,aws nlb,aws ssl certificate,aws getting started,aws ssl,update aws cli,amazon cli,aws auto scaling group,aws cli environment variables,aws cli login,aws elb pricing,cloudformation tutorial,elb pricing,pip install awscli,aws cli cloudformation,aws cli ubuntu,aws load balancer pricing,configure aws cli,amazon load balancer,aws asg,aws cli cloudwatch,aws cli reference,aws cli route53,aws cli setup,aws cli tools,aws cloudformation cli,aws ecs cli,aws ecs tutorial,aws s3 status,install aws cli ubuntu,terraform ecs,terraform elb,aws cli config,aws cli iam,aws cli update