func JudgeTargetNeedUpdate(t *Target) {
	if !CompareString(&t.Arn, t.ActualTarget.Arn) ||
		!CompareString(&t.ID, t.ActualTarget.Id) ||
		!CompareString(&t.Input, t.ActualTarget.Input) ||
		!CompareString(&t.InputPath, t.ActualTarget.InputPath) ||
		!CompareString(&t.RoleArn, t.ActualTarget.RoleArn) ||
		!CompareEcsParameters(&t.EcsParameters, t.ActualTarget.EcsParameters) ||
		!CompareKinesisParameters(&t.KinesisParameters, t.ActualTarget.KinesisParameters) {
		t.NeedUpdate = true
	}
}
JudgeTargetNeedUpdate is judge the target need update
compare target and ActualTarget
package main
import (
	"github.com/aws/aws-sdk-go/service/cloudwatchevents"
)
func AssociateRules(cweRules []*cloudwatchevents.Rule, describedRules []Rule) []Rule {
	dupCWERules := make([]*cloudwatchevents.Rule, len(cweRules))
	copy(dupCWERules, cweRules)
	for i, rule := range describedRules {
		for j, cweRule := range dupCWERules {
			if *cweRule.Name == rule.Name {
				describedRules[i].ActualRule = *cweRule
				dupCWERules = DeleteRuleFromSlice(dupCWERules, j)
				break
			}
		}
	}
	if len(dupCWERules) > 0 {
		for _, dupRule := range dupCWERules {
			describedRules = append(describedRules, Rule{
				ActualRule: *dupRule,
			})
		}
	}
	return describedRules
}
func AssociateTargets(cweTargets []*cloudwatchevents.Target, describedTargets []Target) []Target {
	dupCWETargets := make([]*cloudwatchevents.Target, len(cweTargets))
	copy(dupCWETargets, cweTargets)
	for i, target := range describedTargets {
		for j, cweTarget := range dupCWETargets {
			if CompareString(&target.Arn, cweTarget.Arn) && CompareString(&target.ID, cweTarget.Id) {
				describedTargets[i].ActualTarget = *cweTarget
				dupCWETargets = DeleteTargetFromSlice(dupCWETargets, j)
				break
			}
		}
	}
	if len(dupCWETargets) > 0 {
		for _, dupTarget := range dupCWETargets {
			describedTargets = append(describedTargets, Target{
				ActualTarget: *dupTarget,
			})
		}
	}
	return describedTargets
}
func JudgeRuleNeedUpdate(r *Rule) {
	if !CompareString(&r.Name, r.ActualRule.Name) ||
		!CompareString(&r.Description, r.ActualRule.Description) ||
		!CompareString(&r.EventPattern, r.ActualRule.EventPattern) ||
		!CompareString(&r.ScheduleExpression, r.ActualRule.ScheduleExpression) ||
		!CompareString(&r.State, r.ActualRule.State) {
		r.NeedUpdate = true
	}
}
func JudgeRuleNeedDelete(r *Rule) {
	if r.Name == "" &&
		r.Description == "" &&
		r.EventPattern == "" &&
		r.ScheduleExpression == "" &&
		r.RoleArn == "" &&
		r.State == "" &&
		r.ActualRule.Name != nil {
		r.NeedDelete = true
	}
}