func appIndep(app *App) []grp.InstanceGroup {
	result := []grp.InstanceGroup{}
	for _, account := range app.accounts {
		for _, regionName := range account.RegionNames() {
			result = append(result, grp.New(app.Name(), account.Name(), regionName, "", ""))
		}
	}
	return result
}
appindep returns a list of groups grouped by (app, account, region)
package deploy
import (
	"fmt"
	"log"
	"github.com/Netflix/chaosmonkey"
	"github.com/Netflix/chaosmonkey/grp"
)
func (app *App) EligibleInstanceGroups(cfg chaosmonkey.AppConfig) []grp.InstanceGroup {
	if !cfg.Enabled {
		log.Fatalf("app %s unexpectedly disabled", app.Name())
	}
	grouping := cfg.Grouping
	indep := cfg.RegionsAreIndependent
	switch {
	case grouping == chaosmonkey.App && indep:
		return appIndep(app)
	case grouping == chaosmonkey.App && !indep:
		return appDep(app)
	case grouping == chaosmonkey.Stack && indep:
		return stackIndep(app)
	case grouping == chaosmonkey.Stack && !indep:
		return stackDep(app)
	case grouping == chaosmonkey.Cluster && indep:
		return clusterIndep(app)
	case grouping == chaosmonkey.Cluster && !indep:
		return clusterDep(app)
	default:
		panic(fmt.Sprintf("Unknown grouping: %d", grouping))
	}
}