func (c *ClusterStateImpl) markUpdateCompleted(instanceId string) {
	c.mu.Lock()
	defer c.mu.Unlock()
	if c.instanceUpdateInProgress(instanceId) {
		c.updateInstanceState(instanceId, updateCompleted)
	}
}
markUpdateCompleted updates the instance state to completed iff it is in-progress
package controllers
import (
	"sync"
	"github.com/aws/aws-sdk-go/service/autoscaling"
)
const (
	updateInitialized = "new"
	updateInProgress = "in-progress"
	updateCompleted = "completed"
)
type ClusterState interface {
	markUpdateInitialized(instanceId string)
	markUpdateInProgress(instanceId string)
	markUpdateCompleted(instanceId string)
	instanceUpdateInitialized(instanceId string) bool
	instanceUpdateInProgress(instanceId string) bool
	instanceUpdateCompleted(instanceId string) bool
	deleteAllInstancesInAsg(asgName string) bool
	getNextAvailableInstanceIdInAz(asgName string, azName string) string
	initializeAsg(asgName string, instances []*autoscaling.Instance)
	addInstanceState(instanceData *InstanceData)
	updateInstanceState(instanceId, instanceState string)
	getInstanceState(instanceId string) string
}
type InstanceData struct {
	Id            string
	AmiId         string
	AsgName       string
	AzName        string
	InstanceState string
}
type ClusterStateImpl struct {
	mu sync.RWMutex
	store sync.Map
}
func NewClusterState() ClusterState {
	return &ClusterStateImpl{}
}
func (c *ClusterStateImpl) markUpdateInProgress(instanceId string) {
	c.updateInstanceState(instanceId, updateInProgress)
}