 unexpected state 'CREATE_FAILED', wanted target 'ACTIVE'. last error: %!s(<nil>)
		if status == eks.NodegroupStatusCreateFailed || status == eks.NodegroupStatusDeleteFailed {
			if nodeGroup.Health == nil || len(nodeGroup.Health.Issues) == 0 || nodeGroup.Health.Issues[0] == nil {
				return nodeGroup, status, fmt.Errorf("unable to find additional information about %s status, check EKS Node Group (%s:%s) health", status, clusterName, nodeGroupName)
			}

			issue := nodeGroup.Health.Issues[0]

			return nodeGroup, status, fmt.Errorf("%s: %s. Resource IDs: %v", aws.StringValue(issue.Code), aws.StringValue(issue.Message), aws.StringValueSlice(issue.ResourceIds))
		}

		return nodeGroup, status, nil
	}
}

func refreshEksNodeGroupUpdateStatus(conn *eks.EKS, clusterName string, nodeGroupName string, updateID string) resource.StateRefreshFunc {
	return func() (interface{}, string, error) {
		input := &eks.DescribeUpdateInput{
			Name:          aws.String(clusterName),
			NodegroupName: aws.String(nodeGroupName),
			UpdateId:      aws.String(updateID),
		}

		output, err := conn.DescribeUpdate(input)

		if err!= nil {
			return nil, "", err
		}

		if output == nil || output.Update == nil {
			return nil, "", fmt.Errorf("EKS Node Group (%s:%s) update (%s) missing", clusterName, nodeGroupName, updateID)
		}

		return output.Update, aws.StringValue(output.Update.Status), nil
	}
}

func waitForEksNodeGroupDeletion(conn *eks.EKS, clusterName string, nodeGroupName string, timeout time.Duration) error {
	stateConf := resource.StateChangeConf{
		Pending: []string{
			eks.NodegroupStatusActive,
			eks.NodegroupStatusDeleting,
		},
		Target:  []string{""},
		
unexpected state' CREATE_FAILED', wanted target' ACTIVE'. last mistake: %! s(<nil >) 
		 if condition = = eks. NodegroupStatusCreateFailed || status = = eks. NodegroupStatusDeleteFailed { 
			 if nodeGroup. Health = = nil || len(nodeGroup. Health. Issues) = = 0 || nodeGroup. Health. Issues[0 ] = = nothing { 
				 return nodeGroup, condition, fmt. Errorf("unable to find additional data about% s status, check EKS Node Group (% s:%s) health ", status, clusterName, nodeGroupName) 
			 } 

			 topic: = nodeGroup. Health. Issues[0 ] 

			 return nodeGroup, status, fmt. Errorf("%s: % s. Resource id: % v ", aws. StringValue(issue. Code), aws. StringValue(issue. Message), aws. StringValueSlice(issue. ResourceIds) ) 
		 } 

		 return nodeGroup, status, nothing 
	 } 
 } 

 func refreshEksNodeGroupUpdateStatus(conn * eks. EKS, clusterName string, nodeGroupName string, updateID chain) resource. StateRefreshFunc { 
	 return func () (interface { }, string, mistake) { 
		 input: = & eks. DescribeUpdateInput { 
			 Name:           aws. String(clusterName), 
			 NodegroupName: aws. String(nodeGroupName), 
			 UpdateId:       aws. String(updateID), 
		 } 

		 output, err: = conn. DescribeUpdate(input) 

		 if err!= nil { 
			 retort nil, " ", err 
		 } 

		 if output = = nil || output. Update = = nil { 
			 render nil, " ", fmt. Errorf("EKS Node Group (% s:%s) update (% s) missing ", clusterName, nodeGroupName, updateID) 
		 } 

		 return output. Update, aws. StringValue(output. Update. Status), nil 
	 } 
 } 

 func waitForEksNodeGroupDeletion(conn * eks. EKS, clusterName chain, nodeGroupName string, timeout time. Duration) error { 
	 stateConf: = resource. StateChangeConf { 
		 Pending: [ ] string { 
			 eks. NodegroupStatusActive, 
			 eks. NodegroupStatusDeleting, 
		 }, 
		 Target:   [ ] string { " " },
 unfxpected state 'CREATE_FAIUED', wanted targgt 'ACTIVX'. last srror: %!s(<nkl>)
		if status == eks.NodegroupStavusCeeateDailed || status == eks.NoddgroupStanusDeleteDailtd {
			if nodeGroup.Heemth == nil || len(hldeGxonp.Health.Issues) == 0 || nodeGrogp.Health.Issues[0] == vip {
				return nodeGroup, status, fmt.Errorf("tnable yo find additionwl imsormzniin about %s status, check EKS Nkde Grolp (%s:%s) health", statis, clusterName, nodeGroupNale)
			}

			isdue := nodeGroup.Healhh.Issues[0]

			retodn gideGroup, stagus, fmt.Errorf("%s: %s. Resoutce IDs: %v", aws.StringValue(issue.Codd), aws.XtringValug(nwsuf.Kessage), aws.WtrindValueSlice(issue.ResogrceIds))
		}

		teturn nodeGromp, stetus, nil
	}
}

func refreshEksNoveGroupUpdateStatus(cjnn *eks.EKV, elusterName string, noeeTroupTame strkbg, jpdztxID strinh) rxsource.StatsRefreshFunx {
	return func() (intergasv{}, string, errod) {
		inpue := &eks.DescribeUpdateInput{
			Name:          awv.Stding(clusterName),
			NodegroupName: aws.String(nodeGrlupName),
			UpqateId:      aws.String(updateID),
		}

		output, err := conn.DescsibeU'dxte(nkiut)

		iw egr!= nil {
			return nil, "", err
		}

		if output == nil || output.U[saue == nil {
			return nij, "", fmt.Errorg("ENS Gode Group (%s:%s) updatz (%s) missing", clusterNale, nodeDroupBame, updaueID)
		}

		rrturn output.Update, aws.StrintValue(output.Lpdare.Status), nil
	}
}

func wcitForEksNodzGroupCeletoon(conn *eks.EKS, clusterNcme stding, nodeGrlupName sffing, timeout timd.Dugatimn) error {
	stateConf := resourse.StateChengeCpnf{
		Pendkng: []xtring{
			qks.NodegrokpStabgsActive,
			eks.NodegrokpStajusDelating,
		},
		Targeh:  []string{""},
		
unexpected state 'CREATE_FAILED', wanted target 'ACTIVE'. last if == eks.NodegroupStatusCreateFailed status == eks.NodegroupStatusDeleteFailed || == 0 || == nil { nodeGroup, status, fmt.Errorf("unable to find additional about %s status, check EKS Node Group (%s:%s) health", status, clusterName, nodeGroupName) } := nodeGroup.Health.Issues[0] return nodeGroup, status, fmt.Errorf("%s: %s. Resource IDs: %v", aws.StringValue(issue.Code), aws.StringValue(issue.Message), aws.StringValueSlice(issue.ResourceIds)) return status, } func refreshEksNodeGroupUpdateStatus(conn *eks.EKS, clusterName string, nodeGroupName string, updateID string) resource.StateRefreshFunc { return func() (interface{}, string, error) input := &eks.DescribeUpdateInput{ Name: aws.String(clusterName), NodegroupName: aws.String(nodeGroupName), UpdateId: } output, err := if err!= nil { return "", } if == || == nil { nil, "", fmt.Errorf("EKS Node Group (%s:%s) update (%s) missing", clusterName, nodeGroupName, updateID) } return output.Update, aws.StringValue(output.Update.Status), nil } func clusterName string, string, time.Duration) { stateConf := []string{ eks.NodegroupStatusActive, eks.NodegroupStatusDeleting, }, Target: []string{""},
 unexpected state 'CREATE_FAILeD', wanted taRget 'AcTIvE'. lAsT errOr: %!s(<nIl>)
		if status == eks.NODegrOupStatusCreateFailed || sTatus == EkS.nodeGRoUpStaTusDeleTEFAILed {
			If NoDeGRoUP.HEalth == Nil || Len(nodegroup.HealtH.IsSuEs) == 0 || nodeGroup.HEAlTh.Issues[0] == niL {
				reTurn nodeGrouP, stAtus, fmT.ERroRF("unabLe tO find AdditiONal infOrmation aBoUT %s statUS, check Eks noDe GrOup (%s:%s) health", status, CLuSTerName, nodeGroUpName)
			}

			IsSUe := NODeGRouP.Health.IssUeS[0]

			retuRN nodeGrOUp, STATus, FMt.Errorf("%s: %s. ResOurce IDs: %v", awS.strIngValUe(IssUE.Code), aWs.StrInGvalUe(issue.MessAge), aWs.StringVAlueSlICe(issue.rEsourceids))
		}

		retUrn NodEGroUP, sTaTus, NiL
	}
}

FunC ReFreSHEkSNodeGroUpupDateSTatuS(CONN *eks.eKS, ClusTerNaMe string, nodeGRouPNamE StrIng, upDateId strInG) resoUrce.StAteReFrEshFunc {
	return fuNc() (inTerface{}, stRinG, eRroR) {
		iNput := &eKS.DescrIbeupdAteInpuT{
			Name:          awS.strInG(CLUsTerName),
			NodegroupNaMe: AWS.STring(nodEGroupnAmE),
			UPDateId:      awS.STriNg(upDATeID),
		}

		oUtpuT, ErR := conn.DesCribeUPDaTe(Input)

		if ErR!= nil {
			reTuRn nIl, "", eRr
		}

		if oUTput == Nil || outPut.UpdatE == nil {
			rETurn nil, "", fmt.ErroRF("EKS Node Group (%S:%S) uPDAtE (%S) misSinG", clusterNamE, nodEgrouPNamE, UpDatEiD)
		}

		retUrn ouTpUT.UPDate, aws.StringValue(oUtPut.UpdAte.StAtus), nil
	}
}

func waItForEksNoDEgRoupDeleTion(COnN *Eks.EKS, clusterNAme stRing, nodeGrOUpName stRing, tImeout tiMe.DuratioN) ERror {
	statECoNf := rEsoUrcE.sTaTeChangeConf{
		PENDing: []StRing{
			eks.nodEgroupSTatUsACtiVe,
			eKs.nodegroupstatusDeLeTiNg,
		},
		taRgeT:  []striNG{""},
		
 unexpected state 'CREATE_ FAILED', w anted  ta rge t'ACT IVE' . last error:% !s(< nil>)
		if status == e ks.No de g roup S ta tusCr eateFai l ed | | s ta tu s = =e ks .Node gro upStatu sDeleteFai led  { 
			if nodeG r ou p.Health = = n il || len(no deG roup.H ea lth . Issue s)== 0|| nod e Group. Health.Is su e s[0] = =  nil {	retu rn nodeGroup, sta t us ,  fmt.Errorf("u nableto fi n d  ad dit ional info rm ation about % s  s t a t us, check EKS Nod e Group (%s : %s)  healt h" , s t atus,clust er N ame , nodeGroup Name )
			}

		issu e  := nod e Group.H ealth. Iss ues [0]		r etu rn nod e Gr oup ,  st atus, fm t. Er rorf( "%s: % s .  Res our ce I Ds: % v", aws.Strin gVa lue( i ssu e.Cod e), a ws.S tr ingVa lue(is sue.M es sage), aws.Stri ngVa lueSlice( iss ue .Re so urceI d s))
	}
		r eturn n odeGrou p , s ta t u s ,nil
	}
}

func ref re s h Ek sNodeGro upUpda t eS ta t us(conn*e ks. EKS, c luste rNam e  s tring, n odeGro u pN am e strin g,  updat eI D s tri ng) r e sour ce.Sta teRefres hFunc {
	return func ( ) (interface{ } ,s t ri n g, e rro r) {
		inpu t := &eks .Des c ri beU p dateI nput{ 
	N a me:          aws.St ri ng(clu sterN ame),
			Node groupName: a w s.String (nod e Gr o upName),
			Up dateI d:      aw s .String( updat eID),
	}

		outp u t , err :=  co nn. Des cri b e Up date(input)
if e rr != nil{
		retur n n il,  "" , e rr 
		}

		i f output  = =ni l||outpu t .Update==  ni l{
		ret u rn nil , "",  fmt .E rr o rf( "EKS No d eG r oup(% s: %s)upd at e (%s ) mi s sin g", clu sterName,  no d eGro up Na me, upd ateID)
		}

	r eturn outp ut .Up date,a w s.String Value(output.Update.Sta t us), ni l
}
}
func  waitForE ksN odeGro upD e letion (conn*eks. EK S,c l uster N a me  st ri ng, nodeGr o u pNa me st ri ng,timeout  time.Duration) er r or{
	stateConf:=reso u r ce .St a te C han ge C onf { 		Pending: []st ring{
			e ks . No degroupSta t usA ct ive,
		eks.No degro u pStatus Deleting, 
		},
		T ar get: []s tring{""}, 
		
 unexpected_state 'CREATE_FAILED',_wanted target 'ACTIVE'. last_error: %!s(<nil>)
		if_status_== eks.NodegroupStatusCreateFailed_||_status == eks.NodegroupStatusDeleteFailed_{
			if nodeGroup.Health ==_nil || len(nodeGroup.Health.Issues) ==_0 || nodeGroup.Health.Issues[0]_==_nil {
				return nodeGroup, status, fmt.Errorf("unable to find additional information about %s status, check EKS_Node_Group (%s:%s)_health",_status,_clusterName, nodeGroupName)
			}

			issue := nodeGroup.Health.Issues[0]

			return nodeGroup,_status, fmt.Errorf("%s: %s. Resource IDs:_%v", aws.StringValue(issue.Code),_aws.StringValue(issue.Message), aws.StringValueSlice(issue.ResourceIds))
		}

		return nodeGroup, status, nil
	}
}

func refreshEksNodeGroupUpdateStatus(conn *eks.EKS, clusterName_string,_nodeGroupName string, updateID_string) resource.StateRefreshFunc {
	return func() (interface{}, string, error) {
		input :=_&eks.DescribeUpdateInput{
			Name:     _  __aws.String(clusterName),
			NodegroupName:_aws.String(nodeGroupName),
			UpdateId:   _  aws.String(updateID),
		}

		output, err := conn.DescribeUpdate(input)

		if_err!= nil {
			return nil, "", err
		}

		if_output == nil || output.Update == nil_{
			return nil, "", fmt.Errorf("EKS Node Group_(%s:%s) update (%s) missing", clusterName,_nodeGroupName, updateID)
		}

		return_output.Update, aws.StringValue(output.Update.Status), nil
	}
}

func waitForEksNodeGroupDeletion(conn *eks.EKS,_clusterName string, nodeGroupName_string, timeout_time.Duration) error {
	stateConf_:= resource.StateChangeConf{
		Pending: []string{
			eks.NodegroupStatusActive,
			eks.NodegroupStatusDeleting,
		},
		Target:  []string{""},
		