From c95557af27c03af293b8f1ee3ebfa9de318caf85 Mon Sep 17 00:00:00 2001 From: Clint Shryock Date: Fri, 29 May 2015 10:09:54 -0500 Subject: [PATCH] Check node length to match expected node count --- builtin/providers/aws/resource_aws_elasticache_cluster.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/builtin/providers/aws/resource_aws_elasticache_cluster.go b/builtin/providers/aws/resource_aws_elasticache_cluster.go index ee7848387..1095a9307 100644 --- a/builtin/providers/aws/resource_aws_elasticache_cluster.go +++ b/builtin/providers/aws/resource_aws_elasticache_cluster.go @@ -337,6 +337,11 @@ func CacheClusterStateRefreshFunc(conn *elasticache.ElastiCache, clusterID, give // return given state if it's not in pending if givenState != "" { + // check to make sure we have the node count we're expecting + if int64(len(c.CacheNodes)) != *c.NumCacheNodes { + log.Printf("[DEBUG] Node count is not what is expected: %d found, %d expected", len(c.CacheNodes), *c.NumCacheNodes) + return nil, "creating", nil + } // loop the nodes and check their status as well for _, n := range c.CacheNodes { if n.CacheNodeStatus != nil && *n.CacheNodeStatus != "available" {