func MakeReplicaUpdater() http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		log.Info("Update replicas")
		request := types.ScaleServiceRequest{}
		if r.Body != nil {
			defer r.Body.Close()
			bytesIn, _ := ioutil.ReadAll(r.Body)
			marshalErr := json.Unmarshal(bytesIn, &request)
			if marshalErr != nil {
				w.WriteHeader(http.StatusBadRequest)
				msg := "Cannot parse request. Please pass valid JSON."
				w.Write([]byte(msg))
				log.Errorln(msg, marshalErr)
				return
			}
		}
		service, err := awsutil.UpdateECSServiceDesiredCount(request.ServiceName, int(request.Replicas))
		if err != nil {
			w.WriteHeader(http.StatusBadRequest)
			w.Write([]byte(err.Error()))
			return
		}
		log.Infof("Updated service replica count for %s with arn %s", request.ServiceName, aws.StringValue(service.ServiceArn))
	}
}
MakeReplicaUpdater updates desired count of replicas
package handlers
import (
	"encoding/json"
	"io/ioutil"
	"net/http"
	"github.com/gorilla/mux"
	"github.com/openfaas/faas-netes/types"
	"github.com/openfaas/faas/gateway/requests"
	"github.com/aws/aws-sdk-go/aws"
	awsutil "github.com/ewilde/faas-fargate/aws"
	log "github.com/sirupsen/logrus"
)