From ef4e89c7beb59e53dc5cc0cc5a5dbd00a7abfcb6 Mon Sep 17 00:00:00 2001 From: Benjamin Lau Date: Mon, 5 Jun 2017 07:07:46 -0700 Subject: [PATCH] [provider/aws] check that we actually have NodeGroupMembers (#13488) --- .../aws/resource_aws_elasticache_replication_group.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/builtin/providers/aws/resource_aws_elasticache_replication_group.go b/builtin/providers/aws/resource_aws_elasticache_replication_group.go index 993079409..ff739f2ce 100644 --- a/builtin/providers/aws/resource_aws_elasticache_replication_group.go +++ b/builtin/providers/aws/resource_aws_elasticache_replication_group.go @@ -267,6 +267,10 @@ func resourceAwsElasticacheReplicationGroupRead(d *schema.ResourceData, meta int d.Set("replication_group_id", rgp.ReplicationGroupId) if rgp.NodeGroups != nil { + if len(rgp.NodeGroups[0].NodeGroupMembers) == 0 { + return nil + } + cacheCluster := *rgp.NodeGroups[0].NodeGroupMembers[0] res, err := conn.DescribeCacheClusters(&elasticache.DescribeCacheClustersInput{