code: func (c *Cloud) ensureLoadBalancerInstances(loadBalancerName string, lbInstances []*elb.Instance, instanceIDs map[InstanceID]*ec2.Instance) error {
  	expected := sets.NewString()
  	for id := range instanceIDs {
  		expected.Insert(string(id))
  	}
  
  	actual := sets.NewString()
  	for _, lbInstance := range lbInstances {
  		actual.Insert(aws.StringValue(lbInstance.InstanceId))
  	}
  
  	additions := expected.Difference(actual)
  	removals := actual.Difference(expected)
  
  	addInstances := []*elb.Instance{}
  	for _, instanceID := range additions.List() {
  		addInstance := &elb.Instance{}
  		addInstance.InstanceId = aws.String(instanceID)
  		addInstances = append(addInstances, addInstance)
  	}
  
  	removeInstances := []*elb.Instance{}
  	for _, instanceID := range removals.List() {
  		removeInstance := &elb.Instance{}
  		removeInstance.InstanceId = aws.String(instanceID)
  		removeInstances = append(removeInstances, removeInstance)
  	}
  
  	if len(addInstances) > 0 {
  		registerRequest := &elb.RegisterInstancesWithLoadBalancerInput{}
  		registerRequest.Instances = addInstances
  		registerRequest.LoadBalancerName = aws.String(loadBalancerName)
  		_, err := c.elb.RegisterInstancesWithLoadBalancer(registerRequest)
  		if err != nil {
  			return err
  		}
  		klog.V(1).Infof("Instances added to load-balancer %s", loadBalancerName)
  	}
  
  	if len(removeInstances) > 0 {
  		deregisterRequest := &elb.DeregisterInstancesFromLoadBalancerInput{}
  		deregisterRequest.Instances = removeInstances
  		deregisterRequest.LoadBalancerName = aws.String(loadBalancerName)
  		_, err := c.elb.DeregisterInstancesFromLoadBalancer(deregisterRequest)
  		if err != nil {
  			return err
  		}
  		klog.V(1).Infof("Instances removed from load-balancer %s", loadBalancerName)
  	}
  
  	return nil
  }
docs: // Makes sure that exactly the specified hosts are registered as instances with the load balancer